Check Ick‘s maybe. You don’t need to significantly refactor your code, just intersperse maybe proxies when necessary:
params[:subject].maybe[:name]
The same author (raganwald) also wrote andand, with the same idea.
More Related Contents:
- How to convert a ruby hash object to JSON?
- Begin, Rescue and Ensure in Ruby?
- How to “pretty” format JSON output in Ruby on Rails
- Rails :dependent => :destroy VS :dependent => :delete_all
- difference between collection route and member route in ruby on rails?
- Disable ActiveRecord for Rails 4
- Using Rails serialize to save hash to database
- How do I validate a date in rails?
- How to handle Ruby on Rails error: “Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'”
- Nokogiri installation fails -libxml2 is missing
- Get person’s age in Ruby
- Rails formatting date
- accepts_nested_attributes_for with belongs_to polymorphic
- How do you configure WEBrick to use SSL in Rails?
- @ variables in Ruby on Rails
- gem install permission problem
- How to get request referer path?
- How to get a Date from date_select or select_date in Rails?
- Can I write PostgreSQL functions on Ruby on Rails?
- How can I use Ruby/Rails variables inside Sass?
- Double colons before class names in Ruby?
- url encode equivalent in ruby on rails
- Storing Objects in a Session in Rails
- Store the day of the week and time?
- What is the difference between pluck and collect in Rails?
- Looking for suggestions for building a secure REST API within Ruby on Rails
- Installing Ruby on Rails – Mac OS Lion
- Ruby: Create range of dates
- Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432?
- Unable to install MySQL2 gem on Windows 7