class Application < Rango::Controller
format(:json) do |object|
object.to_json
end
end
class Post < Application
def show(id)
if format.html?
render "post.html", post: post
else
display post
end
end
end
class Application < Rango::Controller
format(:json) do |object|
object.to_json
end
format(:html) do |object|
path = self.template_path(request.action)
render path
end
end
class Post < Application
def show(id)
display post
end
end
class Application < Rango::Controller format(:json) do |object| object.to_json end end class Post < Application def show(id) if format.html? render "post.html", post: post else display post end end endclass Application < Rango::Controller format(:json) do |object| object.to_json end format(:html) do |object| path = self.template_path(request.action) render path end end class Post < Application def show(id) display post end end