...RVM on a Mac and cannot enter 8+ bit characters on an IRB or Rails console, you are missing the readline package. You will need to re-install your Ruby...
January has been a very bad month for Ruby on Rails developers, with two high-severity security bugs permitting remote code execution found in the framework and a separate-but...
...related compromise on rubygems.org, a community resource which virtually all Ruby on Rails developers sit downstream of. Many startups use Ruby on Rails. Other startups don’t but, like the...
...root_url, :data => { :foo => 'bar', :bam => 'baz' } This will produce: Label Only works in Rails 3. In Rails 2 you do = link_to 'Label', root_url, 'data-foo' => 'bar', 'data...
We're adding a script console-for to open a remote Rails console with one command. Also have a look at shell-for, which this script is relying on.
This card needs to be updated for Rails 3+. Since there is no --debugger flag you need to run: rdebug script/runner lib/scripts/something.rb That will open an debugging IRB right away...
Let's say you need to revert a migration that happened a while back. You'd create a new migration...
Yesterday, there was a blog post entitled “What the Hell is Happening to Rails” that stayed at the number one spot on Hacker News for quite a while. The post...
...the comments on the post reflect deep-seated concern about the recent direction of Rails. Others have addressed the core question about change in the framework, but I’d like...
...a dump from db/production_structure.sql: class LoadDump < ActiveRecord::Migration def up config = YAML.load_file('config/database.yml')[RAILS_ENV].symbolize_keys config[:flags] = Mysql2::Client::MULTI_STATEMENTS client = Mysql2::Client.new(config) sql = File.read...
See this Railscast. Basically you can simply write views like index.xlsx.erb: ID Name Release Date Price <% @products.each do |product| %> <%= product.id %> <%= product.name %> <%= product.released_on %> <%= product.price %> <% end %> This approach may help us...
...on how we make our app(s). In the beginning, there was the monolithic Rails app in the standard way with 100+ models and their many corresponding controllers and views...
...one via API. Our newest project is a single “app” made up of several Rails engines. We have found that this strikes a great balance between the (initial) straightforwardness of...
Lets say we have a user with a contract whereas contract is a mounted carrierwave file. Now we want to...
Sometimes you might want to limit the number of associated records in a has_many association, but cannot add a...
...all requests to a Rack application. You can use Sinatra, raw Rack, or even Rails as your application, allowing you to build up an equivalent to the remote service you...
The migration DSL now supports adding and removing foreign keys. They are dumped to schema.rb as well. At this time...
...notes # => collects TODO, FIXME and other Tags from comments and displays them rake about # (Rails 3+) => Rails, Ruby, Rake, Rack etc. versions, used middlewares, root dir, etc...
GoodJob is a new background worker gem. It's compatible with ActiveJob. We're huge fans of Sidekiq for its...
...my application' end end test_routes = Proc.new do get '/my_application' => 'my_application#show' end Rails.application.routes.eval_block(test_routes) Put it into a place like spec/support/test_routes.rb, or a similar place that...
Ever wondered if there is a reverse for Rails' .each(&:to_s) idiom? Turns out there is... You probably already know, that you can abbreviate code like dogs.each { |dog| dog.bark...
There is a bug in Rails 3's dbconsole script, which makes the following command open a database console for the development environment: rails dbconsole -p test
...write this instead: rails dbconsole test -p
This has to be added to the VirtualHost configuration for Apache for Rails 2 applications: RailsEnv development When running Rails 3, you need RackEnv development
...PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x Common table expressions Relation#with Model.from_cte Arrays Face.where.contains tags: %w[happy smiling...
Free Hoptoad/Airbrake alternative which can capture exceptions from any platform. It comes with a Rails notifier and a RESTful API to write your own notifiers for Javascript, etc.
Our new scope-based authorization gem for Ruby on Rails has been released. This might one day replace Aegis as our standard authorization solution...
Adds a slide out panel to your Rails application that directs clients to test stories that have been marked as 'delivered' in Pivotal Tracker...