Guest User

Untitled

a guest
Jul 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. def index
  2. params[:format] ||= "json" # This will move to a before_filter
  3. self.response_body = Project.all.send("to_#{params[:format]}")
  4. self.content_type = Mime::Type.lookup_by_extension(params[:format])
  5. end
Add Comment
Please, Sign In to add comment