Rails

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 


Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts