Skip to content

Instantly share code, notes, and snippets.

@maxivak
Last active October 11, 2017 13:43
Show Gist options
  • Save maxivak/ed5649cfc8bcac83dd5e to your computer and use it in GitHub Desktop.
Save maxivak/ed5649cfc8bcac83dd5e to your computer and use it in GitHub Desktop.
Rails routing CheatSheet

Rails routes, URLs Examples

Overwrite params for the current URL:

= link_to "Title", url_for params.merge(:format => "PDF", :page => nil)
  • add param to current url
=link_to t, url_for(request.parameters.merge(newparam: 'val'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment