How To Add A Format To Rails Url Or Path Helpers

Posted by Weston Ganger on March 22, 2015

Sometimes you want to add a format such as .pdf or .json to an url/path helper. It easy just do:

your_path(format: :json)
your_url(format: :pdf)

Related External Links:

Posted in Rails and Tagged with rails helpers 

Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts