While upgrading an old project to Rails 2.0.2 (and having trouble getting the will_paginate plugin to install), I discovered that there is a will_paginate gem:
http://mislav.caboo.se/rails/will_paginate-love/
Railscasts - will_paginate
Tech Tidbits - Ruby, Ruby On Rails, Merb, .Net, Javascript, jQuery, Ajax, CSS...and other random bits and pieces.
Saturday, April 26, 2008
Thursday, April 24, 2008
Rails - ActionController::InvalidAuthenticityToken
ActionController::InvalidAuthenticityToken in User#login
Showing user/login.html.erb where line #2 raised:
No :secret given to the #protect_from_forgery call.
Set that or use a session store capable of generating its
own keys (Cookie Session Store).
This happened after I switched from using the file system to a database for storing sessions (after uncommenting the line "
config.action_controller.session_store = :active_record_store
" in config/environment.rb
).Once you switch to database store, you'll need to comment the "
protect_from_forgery
" line in app/controllers/application.rb
# See ActionController::RequestForgeryProtection for details
# Uncomment the :secret if you're not using the cookie session store
#protect_from_forgery # :secret => 'b3e36f40312f075ea2697fb85180e312'
Rails 2.0.2 - setup with functional tests
If you want to use
setup
with functional tests in Rails 2.0.2, you'll need to rename the setup
method to setup_with_fixtures
and call super
before running your setup code:
def setup_with_fixtures
super
# Set up code here
end
Subscribe to:
Posts (Atom)
About Me
- Doug Sparling
- Developer (Ruby on Rails, iOS), musician/composer, Buddhist, HSP, Vegan, Aspie.
Labels
- .NET (8)
- accordion (1)
- ActiveRecord (1)
- ajax (2)
- APT (1)
- apt-get (1)
- ASP (1)
- ASP.NET .NET (5)
- Audio (1)
- aws (1)
- Bash (1)
- bdd (1)
- C# (1)
- cache_fu (1)
- caching (1)
- DocBook (1)
- DOM (1)
- Eclipse (1)
- Excel (1)
- Firefox (1)
- gem (5)
- Gems (5)
- git (1)
- GridView (2)
- Hibernate (1)
- iBATIS (1)
- Java (9)
- javascript (9)
- javascript css (1)
- jQuery (4)
- jsspec (1)
- mdb2 (2)
- Merb (2)
- mongrel (2)
- mp3 (2)
- Music (2)
- MySQL (2)
- nginx (1)
- openssl (1)
- osx (3)
- pdocast (1)
- pear (2)
- Perl (7)
- php (5)
- plugin (2)
- podcast (1)
- prototype (1)
- REST (1)
- RMagick MacOSX (1)
- rspec (1)
- ruby (14)
- ruby on rails (21)
- RubyGems Merb (1)
- s3 (1)
- screencasts (1)
- scriptaculous (1)
- scriptrunner ruby rails erlang (1)
- Sortable (1)
- subversion (1)
- testing (1)
- testing erlang tsung (1)
- tomcat (1)
- ubuntu (2)
- WebSphere (1)
- will_paginate (1)