Search Results

Search found 4793 results on 192 pages for 'protected'.

Page 6/192 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Unable to use NSURLConnection to get contents of password/username protected webpage

    - by bubster
    I am trying to get the contents of a webpage that requires a password and user name to access. I am using a NSURLConnection object to get it however when I write the NSMutableData object that is returned to a file all I get is the login page. Normally when you try to load the password protected page when you are not logged in it redirects to the login page however I thought that if I provided valid credentials then this I would be able to view the password protected page. Also I do not know if it is relevant the website is using a microsoft mysql database on an IIS (internet information server). Note: [protectionSpace authenticationMethod] returns NSURLAuthenticationMethodServerTrust I am pretty unfamiliar with this so any ideas would be greatly appreciated. Below is all of the relevant code: - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { // This method is called when the server has determined that it // has enough information to create the NSURLResponse. // It can be called multiple times, for example in the case of a // redirect, so each time we reset the data. // receivedData is an instance variable declared elsewhere. [receivedData setLength:0]; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { // Append the new data to receivedData. // receivedData is an instance variable declared elsewhere. [receivedData appendData:data]; } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { // release the connection, and the data object //[connection release]; // receivedData is declared as a method instance elsewhere //[receivedData release]; // inform the user NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]); } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { // do something with the data // receivedData is declared as a method instance elsewhere NSLog(@"Succeeded! Received %d bytes of data",[receivedData length]); // release the connection, and the data object //[connection release]; //[receivedData release]; //Write data to a file [receivedData writeToFile:@"/Users/matsallen/Desktop/receivedData.html" atomically:YES]; } - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace: (NSURLProtectionSpace *)protectionSpace { NSLog(@"The connection encountered a protection space. The authentication method is %@", [protectionSpace authenticationMethod]); secureTrustReference = [protectionSpace serverTrust]; //SecTrustResultType *result; //OSStatus status = SecTrustEvaluate(secureTrustReference, result); //NSLog(@"Result of the trust evaluation is %@",status); return YES; } - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { NSURLCredential *newCredential; newCredential = [NSURLCredential credentialWithUser:@"username" password:@"password" persistence:NSURLCredentialPersistenceForSession]; newCredential = [NSURLCredential credentialForTrust:secureTrustReference]; // [[challenge sender] useCredential:newCredential forAuthenticationChallenge:challenge]; // [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge]; } #pragma mark - View lifecycle - (void)viewDidLoad { receivedData = [[NSMutableData alloc] init]; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. // Create the request. NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.markallenonline.com/secure/maoCoaching.aspx"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; // create the connection with the request // and start loading the data NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; if (theConnection) { // Create the NSMutableData to hold the received data. // receivedData is an instance variable declared elsewhere. receivedData = [NSMutableData data]; NSLog(@"Connection succeeded!"); } else { // Inform the user that the connection failed. NSLog(@"Connection failed!"); } }

    Read the article

  • How can I password protect an IIS directory with only FTP access?

    - by Tony Adams
    How can I password protect an IIS directory when I only have FTP access to the server? I can't adjust any IIS settings or add users or anything like that. The answer to: IIS Basic Authorization ala .htaccess/.htpasswd in apache does not help as I only have access to the server via FTP. I just need to password protect a directory. I've tried several variations of a web.config file. I can get a basic HTTP auth form to pop up when a user attempts to load a page from my test directory, but I can't configure the authentication part. The server complains that: Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. whenever I add an <authentication> section to my web.config. I'm grateful for any help anyone can offer. Edit: I don't know what version of IIS is running on this server, but here is the server tag from error messages: Version Information: Microsoft .NET Framework Version:1.1.4322.2490; ASP.NET Version:1.1.4322.2494

    Read the article

  • Excel 2010 Delete Rows with Locked Cells

    - by Roger
    I have a spreadsheet that has formulas that I want to lock, once the information in the row is completed, i.e. there is a discharge date, I want the end-user to be able to delete the row and insert it into another worksheet. I do not want to use VBA, I was successful in sequencing the protection steps, but now can not repeat the process. There has to be a way to use the protect sheet "delete rows" check box and locked cells together to enable this process

    Read the article

  • Setup Apache Password Protection

    - by Jiew Meng
    I have some difficulties setting up password protection in Apache In .htaccess, I have AuthUserFile /var/www/vhosts/domain.net/httpdocs/.htpasswd AuthGroupFile /dev/null AuthName "Test Server" AuthType Basic require user testuser Then in .htpasswd, I have something like testuser:encrypted password The problem now is I forgot what .htpasswd generator I used. When I try to add a new user and password, it doesn't work. eg. when I put require user newuser it fails always (prompt keeps reappearing). Then when I revert to testuser it works How can I setup such that I have 1 or some "admins" that can access everything and viewers that can view only specific folders ... eg / - only admins /folder1 - only admins or folder1's users /folder2 - only admins or folder2's users Also what do I do to not allow showing of directory listing

    Read the article

  • How to exclude a sub-folder from HTaccess RewriteRule

    - by amb9800
    I have WordPress installed in my root directory, for which a RewriteRule is in place. I need to password-protect a subfolder ("blue"), so I set the htaccess in that folder as such. Problem is that the root htaccess RewriteRule is applying to "blue" and thus I get a 404 in the main WordPress site (instead of opening the password dialog for the subfolder). Here's the root htaccess: RewriteEngine on <Files 403.shtml> order allow,deny allow from all </Files> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> I tried inserting this as the second line, to no avail: RewriteRule ^(blue)($|/) - [L] Also tried inserting this before the index.php RewriteRule: RewriteCond %{REQUEST_URI} !^/blue/ That didn't work either. Also inserted this into the subfolder's htaccess, which didn't work either: <IfModule mod_rewrite.c> RewriteEngine off </IfModule> Any ideas?

    Read the article

  • is it okay to use random URLs instead of passwords?

    - by stew
    Is it considered "safe" to use URL constructed from random characters like this? http://example.com/EU3uc654/Photos I'd like to put some files/picture galleries on a webserver that are only to be accessed by a small group of users. My main concern is that the files should not get picked up by search-engines or curious power-users that poke around my site. I've set up an .htaccess file, just to notice that clicking on http://user:pass@url/ links doesn't work well with some browsers/email clients, prompting dialogs and warnings messages that confuse my not-too-computer-savy users.

    Read the article

  • How add service reference in visual studio 2008 authenticating against password-protected web servic

    - by user312305
    Hello, first time here... great site Well, I want to reference a web service, and it requires user/pass authentication. In VS 2008, if I try to "add reference", or "add service reference", all I can type is the URL, there's no way to input my credentials. Obviously, if I try to load the ws, it shows me a nice message: "The request failed with HTTP status 403: Forbidden. Metadata contains a reference that cannot be resolved: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="weblogic"'. The remote server returned an error: (401) Unauthorized." So my question is: Is it possible (using VS 2008) to add a reference to a web service that is protected? How? Any help is kindly appreciated. Thanks!

    Read the article

  • Open protected web page passing in credentials programmatically

    - by beaudetious
    I have code examples from some of my previous work that help me to post form values to a web page (login credentials) and retrieve the text from that page. Now I want to pass in form values (login credentials again) but actually open that web page in a browser given those credentials. How do I do that? I'm not doing anything nefarious. In our CRM app (home-grown as it is), I want to create a link button that opens our web site's protected products page given the user's credentials (based on the user's login credentials). Normally, I'd copy the user's credentials in our login page which then takes me to the products page. I'm trying to do this now by just clicking a link button. Any suggestions?

    Read the article

  • Password Protected Wordpress MU

    - by HollerTrain
    I have a MU site related to Doctors and they will be publishing information that I cannot let outside sources and robots view. Is there a way that when you go to the main domain url, it shows a user/pass login for WP. I would set up the user/pass in the backend. Then they would login, then be able to view the website? I can't have it load up for anyone, I need the website to be password protected to even view the website in general. I know I can use .htaccess to have a user/pass, but it would be ideal to use the user/pass generated by WP so I don't have to mess with code when I create a user. Any help would be greatly appreciated.

    Read the article

  • Read/Write protected memory?

    - by PenguinBoy
    I'm trying to learn C++ currently, but I'm having issues with the code below. class Vector2 { public: double X; double Y; Vector2(double X, double Y) { this->X = X; this->Y = Y; }; SDL_Rect * getSdlOffset() { SDL_Rect * offset = new SDL_Rect(); offset->x = this->X; offset->y = this->Y; return offset; }; }; Visual studio throws throw the following error when calling getSdlOffset() An unhandled exception of type 'System.AccessViolationException' occurred in crossEchoTest.exe Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. I've got a C#/java background, and I'm lost... Any help would be much appreciated.

    Read the article

  • Why i can not acces the protected properties in my web application

    - by GigaPr
    Hi i have a web application which has a Base class in which i define all the properties common to the web pages. The base class extends System.Web.UI.Page Furthermore i have a Base User control class where are defined all the properties common to the user controls. the Base User Control extends System.Web.UI.UserControl all the properties in both base classes are protected. All the web pages extends the base class . All the controls extends the base user control class. The problem is i can not access the properties defined in the base class from the user controls and I can not extend two classes in the base user controls The question is how can i access the properties defined in the Base class from within the user controls? I hope i have been clear Thanks

    Read the article

  • Make Directory.GetFiles() ignore protected folders

    - by Kryptic
    Hello Everyone, I'm using the Directory.GetFiles() method to get a list of files to operate on. This method throws an UnauthorizedAccessException for example when trying to access a protected folder. I would like it to simply skip over such folders and continue. How can I accomplish this with either Directory.GetFiles (preferably) or another method? Update: Here is the code that throws the exception. I am asking the user to select a directory and then retrieving the list of files. I commented out the code (so this is now whole method) that iterates through the files and the problem still occurs. The exception is thrown on the Directory.GetFiles() line. FolderBrowserDialog fbd = new FolderBrowserDialog(); DialogResult dr = fbd.ShowDialog(); if (dr == System.Windows.Forms.DialogResult.Cancel) return; string directory = fbd.SelectedPath; string[] files = Directory.GetFiles(directory, "*.html", SearchOption.AllDirectories);

    Read the article

  • respond_to? and protected methods

    - by mlomnicki
    It may not be so obvious how respond_to? works in ruby. Consider that: class A def public_method end protected def protected_method end private def private_method end end obj = A.new obj.respond_to?(:public_method) # true - that's pretty obvious obj.respond_to?(:private_method) # false - as expected obj.respond_to?(:protected_method) # true - WTF? So if 'obj' responds to protected_method we should expect obj.protected_method not to raise an exception, shouldn't we? ...but it raises obviously Documentation points that calling respond_to? with 2nd argument set to true check private method as well obj.respond_to?(:private_method, true) # true And that's far more reasonable So the question is how to check if object responds to public method only? Is there a solution better than that? obj.methods.include?(:public_method) # true obj.methods.include?(:protected_method) # false

    Read the article

  • Securing input of private / protected methods?

    - by ts
    Hello, normally, all sane developers are trying to secure input of all public methods (casting to proper types, validating, sanitizing etc.) My question is: are you in your code validating also parameters passed to protected / private methods? In my opinion it is not necessary, if you securize properly parameters of public methods and return values from outside (other classes, db, user input etc...). But I am constantly facing frameworks and apps (ie. prestashop to name one) where validation is often repeated in method call, in method body and once again for securize returned value - which, I think, is creating performace overhead and is also a sign of bad design.

    Read the article

  • C# CreatePipe() -> Protected memory error

    - by M. Dimitri
    Hi all, I trying to create a pipe using C#. The code is quite simple but I get a error saying "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Here the COMPLETE code of my form : public partial class Form1 : Form { [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern bool CreatePipe(out SafeFileHandle hReadPipe, out SafeFileHandle hWritePipe, SECURITY_ATTRIBUTES lpPipeAttributes, int nSize); [StructLayout(LayoutKind.Sequential)] public struct SECURITY_ATTRIBUTES { public DWORD nLength; public IntPtr lpSecurityDescriptor; public bool bInheritHandle; } public Form1() { InitializeComponent(); } private void btCreate_Click(object sender, EventArgs e) { SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES(); sa.nLength = (DWORD)System.Runtime.InteropServices.Marshal.SizeOf(sa); sa.lpSecurityDescriptor = IntPtr.Zero; sa.bInheritHandle = true; SafeFileHandle hWrite = null; SafeFileHandle hRead = null; if (CreatePipe(out hRead, out hWrite, sa, 4096)) { MessageBox.Show("Pipe created !"); } else MessageBox.Show("Error : Pipe not created !"); } } At the top I declare : using DWORD = System.UInt32; Thank you very much if someone can help.

    Read the article

  • How to serialize a protected property in wcf

    - by Denis Rosca
    Hello everyone, I have to classes (Person and Address) that i need to send via wcf, the classes look like this: public class PersoanaFizica :IExtensibleDataObject { [DataMember] private Guid _id; [DataMember(Name = "Id")] protected virtual Guid Id { get { return _id; } set { _id = value; } } private ExtensionDataObject _extensionData; public virtual ExtensionDataObject ExtensionData { get { return _extensionData; } set { _extensionData = value; } } private string _firstName; [Searchable(PropertyName="FirstName")] [DataMember] public virtual string FirstName { get { return this._firstName; } set { this._firstName = value; } } private string _lastName; [Searchable(PropertyName="LastName")] [DataMember] public virtual string LastName { get { return this._lastName; } set { this. _lastName = value; } } private Address _address; [Searchable(PropertyName="Address")] [DataMember] public virtual Address Address { get { return this._address; } set { this._address = value; } } } public class Address : IExtensibleDataObject { [DataMember] private Guid _id; [DataMember] public virtual Guid Id { get { return _id; } set { _id = value; } } private ExtensionDataObject _extensionData; public virtual ExtensionDataObject ExtensionData { get { return _extensionData; } set { _extensionData = value; } } private string _country; [Searchable(PropertyName="Country")] [DataMember] public virtual string Country { get { return this._country; } set { this._country = value; } } // and some other properties related to the address } The problem is that when i try to send them via wcf, the client recieves the Id properties set to 00000-0000-00000-00000 or smth like this. Any idea why this is happening? And how to serialize the proper values? Thanks,Denis.

    Read the article

  • Attempted to read or write protected memory-Sql Compact and .NEt

    - by Jankhana
    I'm using Sql Compact3.5 as my DB with C# .NET . I have a strange problem with my application. I'm running the code in two PC with same configuration except the Sql Compact installed. In one PC where Sql Compact3.5 is not installed I'm getting this strange error: Exception :Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Inner Exception : Stack Trace : at System.Data.SqlServerCe.NativeMethods.CloseStore(IntPtr pSeStore) at System.Data.SqlServerCe.SqlCeConnection.ReleaseNativeInterfaces() at System.Data.SqlServerCe.SqlCeConnection.Dispose(Boolean disposing) at System.Data.SqlServerCe.SqlCeConnection.Finalize() Source : System.Data.SqlServerCe I don't know where i have went wrong. I checked my code and included try catch everywhere. I'm handling Unhandled exception also using this . I am getting this error from a console application which I'm starting from Windows Form. In both the application I've inserted the Unhandled Exception coding and it's getting executed and getting return to the texxt file. But still Microsoft Don't Error Report is getting generated and I get that Dialog box!!! Y still that dialog box is getting generated is the trouble!!! Is there any way to supress that Dialog box??? Y I'm getting this box when I'm handling the exception and it's executing my catch handler??? In another PC where SQL Compact is installed no error I get!!! Any idea y is that so???

    Read the article

  • Attempted to read or write protected memory

    - by Interfector
    I have a sample ASP.NET MVC 3 web application that is following Jonathan McCracken's Test-Drive Asp.NET MVC (great book , by the way) and I have stumbled upon a problem. Note that I'm using MVCContrib, Rhino and NUnit. [Test] public void ShouldSetLoggedInUserToViewBag() { var todoController = new TodoController(); var builder = new TestControllerBuilder(); builder.InitializeController(todoController); builder.HttpContext.User = new GenericPrincipal(new GenericIdentity("John Doe"), null); Assert.That(todoController.Index().AssertViewRendered().ViewData["UserName"], Is.EqualTo("John Doe")); } The code above always throws this error: System.AccessViolationException : Attempted to read or write protected memory. This is often an indication that other memory is corrupt. The controller action code is the following: [HttpGet] public ActionResult Index() { ViewData.Model = Todo.ThingsToBeDone; ViewBag.UserName = HttpContext.User.Identity.Name; return View(); } From what I have figured out, the app seems to crash because of the two assignements in the controller action. However, I cannot see how there are wrong!? Can anyone help me pinpoint the solution to this problem. Thank you.

    Read the article

  • Cookies not working for password-protected Pages on WordPress

    - by KaOSoFt
    Initially I had the issue reported in this question. Now, what I noticed is that there are some browsers that accept the password, and there are some which don't. Difference? For some reason the cookie is generated when I log in into the Administration module, but it isn't when I write down the password to access the page, forcing it to simply reload. I can see the cookie created for the log-in, but I can see none for the password-protected Page. These happens on Internet Explorer, both version 7 and 8; only on some machines, though, but most of them fail this. I already tried white-listing the URL, and even letting it accept ALL cookies, to no avail. What may be the cause? If perhaps it's got something to do with question above, please help me! Thanks in advance. PS: If you know of another, cookie-free method to make a simple authentication, please link me to it. Thanks. Oh, and by the way, this is inside an Intranet with static, class C IPs.

    Read the article

  • Is there any complications or side effects for changing final field access/visibility modifier from private to protected?

    - by Software Engeneering Learner
    I have a private final field in one class and then I want to address that field in a subclass. I want to change field access/visibility modifier from private to protected, so I don't have to call getField() method from subclass and I can instead address that field directly (which is more clear and cohessive). Will there be any side effects or complications if I change private to protected for a final field? UPDATE: from logical point of view, it's obvious that descendant should be able to directly access all predecessor fields, right? But there are certain constraints that are imposed on private final fields by JVM, like 100% initialization guarantee after construction phase(useful for concurrency) and so on. So I would like to know, by changing from private to protected, won't that or any other constraints be compromised?

    Read the article

  • Infinite loop using Spring Security - Login page is protected even though it should allow anonymous

    - by Tai Squared
    I have a Spring application (Spring version 2.5.6.SEC01, Spring Security version 2.0.5) with the following setup: web.xml <welcome-file-list> <welcome-file> index.jsp </welcome-file> </welcome-file-list> The index.jsp page is in the WebContent directory and simply contains a redirect: <c:redirect url="/login.htm"/> In the appname-servlet.xml, there is a view resolver to point to the jsp pages in WEB-INF/jsp <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <property name="prefix" value="/WEB-INF/jsp/" /> <property name="suffix" value=".jsp" /> </bean> In the security-config.xml file, I have the following configuration: <http> <!-- Restrict URLs based on role --> <intercept-url pattern="/WEB-INF/jsp/login.jsp*" access="ROLE_ANONYMOUS" /> <intercept-url pattern="/WEB-INF/jsp/header.jsp*" access="ROLE_ANONYMOUS" /> <intercept-url pattern="/WEB-INF/jsp/footer.jsp*" access="ROLE_ANONYMOUS" /> <intercept-url pattern="/login*" access="ROLE_ANONYMOUS" /> <intercept-url pattern="/index.jsp" access="ROLE_ANONYMOUS" /> <intercept-url pattern="/logoutSuccess*" access="ROLE_ANONYMOUS" /> <intercept-url pattern="/css/**" filters="none" /> <intercept-url pattern="/images/**" filters="none" /> <intercept-url pattern="/**" access="ROLE_ANONYMOUS" /> <form-login login-page="/login.jsp"/> </http> <authentication-provider> <jdbc-user-service data-source-ref="dataSource" /> </authentication-provider> However, I can't even navigate to the login page and get the following error in the log: WARNING: The login page is being protected by the filter chain, but you don't appear to have anonymous authentication enabled. This is almost certainly an error. I've tried changing the ROLE_ANONYMOUS to IS_AUTHENTICATED_ANONYMOUSLY, changing the login-page to index.jsp, login.htm, and adding different intercept-url values, but I can't get it so the login page is accesible and security applies to the other pages. What do I have to change to avoid this loop?

    Read the article

  • Can't mass-assign protected attributes -- unsolved issue

    - by nfriend21
    I have read about 10 different posts here about this problem, and I have tried every single one and the error will not go away. So here goes: I am trying to have a nested form on my users/new page, where it accepts user-attributes and also company-attributes. When you submit the form: Here's what my error message reads: ActiveModel::MassAssignmentSecurity::Error in UsersController#create Can't mass-assign protected attributes: companies app/controllers/users_controller.rb:12:in `create' Here's the code for my form: <%= form_for @user do |f| %> <%= render 'shared/error_messages', object: f.object %> <%= f.fields_for :companies do |c| %> <%= c.label :name, "Company Name"%> <%= c.text_field :name %> <% end %> <%= f.label :name %> <%= f.text_field :name %> <%= f.label :email %> <%= f.text_field :email %> <%= f.label :password %> <%= f.password_field :password %> <%= f.label :password_confirmation %> <%= f.password_field :password_confirmation %> <br> <% if current_page?(signup_path) %> <%= f.submit "Sign Up", class: "btn btn-large btn-primary" %> Or, <%= link_to "Login", login_path %> <% else %> <%= f.submit "Update User", class: "btn btn-large btn-primary" %> <% end %> <% end %> Users Controller: class UsersController < ApplicationController def index @user = User.all end def new @user = User.new end def create @user = User.create(params[:user]) if @user.save session[:user_id] = @user.id #once user account has been created, a session is not automatically created. This fixes that by setting their session id. This could be put into Controller action to clean up duplication. flash[:success] = "Your account has been created!" redirect_to tasks_path else render 'new' end end def show @user = User.find(params[:id]) @tasks = @user.tasks end def edit @user = User.find(params[:id]) end def update @user = User.find(params[:id]) if @user.update_attributes(params[:user]) flash[:success] = @user.name.possessive + " profile has been updated" redirect_to @user else render 'edit' end #if @task.update_attributes params[:task] #redirect_to users_path #flash[:success] = "User was successfully updated." #end end def destroy @user = User.find(params[:id]) unless current_user == @user @user.destroy flash[:success] = "The User has been deleted." end redirect_to users_path flash[:error] = "Error. You can't delete yourself!" end end Company Controller class CompaniesController < ApplicationController def index @companies = Company.all end def new @company = Company.new end def edit @company = Company.find(params[:id]) end def create @company = Company.create(params[:company]) #if @company.save #session[:user_id] = @user.id #once user account has been created, a session is not automatically created. This fixes that by setting their session id. This could be put into Controller action to clean up duplication. #flash[:success] = "Your account has been created!" #redirect_to tasks_path #else #render 'new' #end end def show @comnpany = Company.find(params[:id]) end end User model class User < ActiveRecord::Base has_secure_password attr_accessible :name, :email, :password, :password_confirmation has_many :tasks, dependent: :destroy belongs_to :company accepts_nested_attributes_for :company validates :name, presence: true, length: { maximum: 50 } VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, uniqueness: { case_sensitive: false } validates :password, length: { minimum: 6 } #below not needed anymore, due to has_secure_password #validates :password_confirmation, presence: true end Company Model class Company < ActiveRecord::Base attr_accessible :name has_and_belongs_to_many :users end Thanks for your help!!

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >