...print, if present requires interactive_editor, if present (basically makes vim available) loads .irbrc_rails if in Rails (e.g. for the Rails console) .irbrc_rails defines efind(email), which is...
...to find users by email requires hirb, if present set the prompt to your Rails app's name Of course you can put anything into these files...
...code below is a rough equivalent to the simple_format helper that ships with Rails: function simpleFormat(str) { str = str.replace(/\r\n?/, "\n"); str = $.trim(str); if (str.length > 0) {
...str.replace(/\n\n+/g, ' '); str = str.replace(/\n/g, ' '); str = ' ' + str + ' '; } return str; } Unlike the Rails helper, this does not preserve whitespace. You probably don't care...
I got these warnings while deploying a Rails 3.2 app with asset pipeline enabled: *** [err :: host.tld] find: `/opt/www/hollyapp.com/releases/20120503115342/public/images': No such file or directory *** [err :: host.tld] find: `/opt/www/hollyapp.com/releases/20120503115342/public/stylesheets': No such file...
...fix this issue. This patch is planned to be included in the next makandra Rails LTS release...
...route that only responds to a given format, here is how you do it: Rails 3 match 'sitemap.xml' => 'feeds#sitemap', :constraints => { :format => 'xml' }, :as => 'sitemap' Rails 2 map.sitemap 'sitemap.xml', :controller...
If you have the following deprecation warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated. Specify all the necessary parameters instead. that is for example...
...to append filepaths to it. With this method, Ruby code can look like this: Rails.root/"features"/"fixtures"/"picture.jpg" Alternatively you can use the #join method, which feels less magic: Rails.root.join...
This will only work with warnings that go through ActiveSupport and only in Rails 3.0 or higher...
...your console prompt so you don't accidentally break production Officially supporting IRB (standard rails console) and pry (via pry-rails gem). Example: $ rails console Loading development environment (Rails...
...the gem. The gem is there for you should you one day upgrade to Rails 3.2+. Please don't use the defaults gem which we original forked away from in...
A couple of Railsconfs ago, Courtenay and I did indeed discuss
Katapult 0.3.0 brings Rails 5 and Ruby 2.5 support with a new design, plus a ton of smaller features, fixes and improvements. Features Generating a Rails 5.1.4 app on Ruby...
To simulate Rails' to_sentence in your JavaScript application, you can use these few lines of CoffeeScript code: joinSentence = (array) -> if array.length > 1 array[0..-2].join(', ') + ', and ' + array...
...staging or production environments, chances are that JavaScript compression is the culprit. By default, Rails 3.2 compresses JavaScript with UglifyJS. I have seen a few cases where this actually breaks...
...reload the page, log into the site and reload the cookie information site. For Rails powered sites, you should see a cookie named '_your_site_session' and -- depending on your...
Using Scenic, you can bring the power of SQL views to your Rails application without having to switch your schema format to SQL. Scenic provides a convention for versioning views...
...for features. If you don't have separate environments, you can't check your Rails.env. I managed to distinguish between specs and features by asking Capybara. Note that this only...
...the need to enter user and password, you can say the following in any Rails 2 project: script/dbconsole -p In Rails 3 you can say: rails dbconsole -p
Gem to get Rails 3's new ActiveRecord query interface (where, order) and the new scope syntax (chaining scope definitions) in Rails 2. You also get #to_sql for scopes...
...different take on what we're doing with ActiveType. Since it lives under the rails organization it might be part of Rails...
EdgeRider 0.3.0 adds support for Rails 4.1 and Ruby 2.1. It forward-ports ActiveRecord::Base.scoped to Rails...
In an environment: config.logger = Logger.new('/dev/null')
Very detailed guide to caching Ruby on Rails. Goes well with the official Rails guide on caching...
With the impending release of Ruby on Rails 4, it looks like a lot of developers will be updating their web applications in the coming new year.
...a series of blog posts going over everything you will need to know about Rails 4 for an effortless upgrade...