Problem
When you get the above error you cannot login to your application.
Solution
You will need to delete the cookies for the authentication, so in Firefox (Linux) go to Preferences, remove individual cookies for the specific domain.
Fri 26 Mar 2010
Posted by kosmas under linux, Mandriva, ruby on rails
No Comments
Problem
When you get the above error you cannot login to your application.
Solution
You will need to delete the cookies for the authentication, so in Firefox (Linux) go to Preferences, remove individual cookies for the specific domain.
Tue 18 Dec 2007
Posted by kosmas under ruby on rails
No Comments
Problem
You want to use the easiest authentication method, in order to add users/permissions to your application.
Solution
script/plugin install http://svn.techno-weenie.net/projects/plugins/acts_as_authenticated
script/generate authenticated user account
create table "users", :force => true do |t|
t.column :login, :string
...
t.column :role, :string, :default => 'C'
...
end
add_column :customers, :user_id, :integer
...
def self.down
...
remove_column :customers, :user_id
end
rake db:migrate VERSION=xxx
include AuthenticatedSystem
before_filter :login_required, :except => [:login, :signup, :logout]
redirect_back_or_default(:controller => 'customers', :action => 'list') flash[:notice] = "Logged in successfully" else flash[:notice] = "Invalid Login/Password!"
<%= f.select :role, ['A','R','C'] %>
def conditions_for_collection ['customers.user_id = (?)', current_user.id] end
<%= render :partial => "layouts/menu"%>