Notes posted by Manfred
RSS feed
Example
NOTE: you pass all the keys and values in one long list:
fruit = ActiveSupport::OrderedHash[ 'apple', 'Apple', 'banana', 'Banana', 'kiwi', 'Kiwi fruit', ] fruit.keys => ["apple", "banana", "kiwi"]

Adding to the URL
If you want to use polymorphic routing for your object but you also need to specify other stuff like an anchor, you can explicitly generate the polymorphic url with extra options:
form_for @candidate, :url => polymorphic_path(@candidate, :anchor => 'signup')

*Described above
The documentation is referring to the module documentation: ActionController::Cookies

Optional local assigns
When you have a partial with optional local assigns, for instance:
<%= render :partial => 'articles/preview' %> <%= render :partial => 'articles/preview', :locals => { :show_call_out => true } %>
And you don’t want the partial to break when the local isn’t assigned, you can reference it through the local_assigns local variable instead of through the template binding:
<% if local_assigns[:show_call_out] %> <em><%= format @article.call_out %></em> <% end %>

Not really helpful
When you’re trying to construct a specialized path name for a partial based on a record type you’re probably better off writing your own helper.
def topic_partial_path(topic) ['admin', topic.class.table_name, "#{topic.class.table_name.singularize}_as_topic"].join('/') end