Even though the gradual engagement meme has been around for a while, and everyone just hates signup forms, they just...
The Juggernaut plugin for Ruby on Rails aims to revolutionize your Rails app by letting the server initiate a connection and push data to the client. In other words your...
MailStyle allows you to write the css for your html emails as you normally would, then writes the styles inline...
Rails 2.3 has a ton of really nice functionality locked up in monolithic components. I’ve posted quite a bit about how we’ve opened up a lot of that...
...of ActionController. ActiveModel is another way we’ve exposed useful functionality to you in Rails...
Info on install database_cleaner.
It occurred to me that many Rails/Passenger/Apache applications may have caching set up in a way that it appears to be caching, when it is not actually caching...
Where there was once a consistent API to manipulate and hook into the lifecycle of a persistent object, plugins must...
This will only work with warnings that go through ActiveSupport and only in Rails 3.0 or higher...
Starting from 4.1, Rails automatically detects the inverse of an association, based on heuristics. Unfortunately, it does not seem to notify you when it fails to infer the :inverse_of...
Rails' params hash contains any request parameters (URL parameters or request payload) as well as routing parameters like :controller, :action, or :id. To access only URL parameters, use request.query_parameters...
Rails 5 will introduce ActiveRecord::Relation#or. On Rails 4 and 3.2 you can use the activerecord_any_of gem which seems to be free of ugly hacks and nicely...
After starting the Rails server in a freshly generated Rails 3.1 project you could see an error message such as /usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime...
Don't write resources :people, :concerns => :trashable Write resources :people do concerns :trashable end Why Writing a controller...
In specs, the session never persists but is always a new object for each request. Data put into the session...
When using form_for you can give the form's target URL either as a string or an array:
You might find that your Passenger ignores all RailsSomething directives in the vhost for your new Rails 3 application. The culprit is a file config.ru which makes Passenger consider your...
...application a Rack (non-Rails) application. To fix this you can either use RackEnv in lieu of RailsEnv (it works fine) or delete the config.ru. Unless you have a good...
Rails 2.3.16+ on Ruby 1.9 causes warnings like this: .../gems/activesupport-2.3.17/lib/active_support/core_ext/string/output_safety.rb:22: warning: regexp match /.../n against to UTF-8 string Many thanks to grosser for supplying a monkey-patch for...
...Rails 2.3 (Commit f93e3f0ec3 fixed it for Rails 3). Just put it into config/initializers/ to make those warnings go away. Since we're using RSpec on most projects, I've...
Today I learned that Ruby on Rails has shipped with a built-in slug generator since Rails 2.2: > "What Up Dog".parameterize => "what-up-dog" > "foo/bar".parameterize => "foo-bar"
Rails’ reputation as a relatively secure Web framework is well deserved. Out-of-the-box, there is protection against many common attacks: cross site scripting (XSS), cross site request forgery...
...the default behavior could be more secure. This post explores potential security issues in Rails 3 that are fixed in Rails 4, as well as some that are still risky...
The Ruby on Rails security list archive can be found here: http://groups.google.com/group/rubyonrails-security You can subscribe to this mailing list without a Google account by pasting this URL into...
Rails 4 introduced raising an error on pending migrations. This is most annoying when you are crafting a migration but need to play with your application to figure out how...
After switching to Rails 3 you may get a LoadError with the following message when trying to use your application via passenger: no such file to load -- dispatcher Your Passenger...