You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm trying to define a specific format (let's call it myformat) so as to do special operations when requests are made in this format. So, in my controller I have something like this:
def index
respond_to do |format|
format.xml do
#Some Code
end
format.json do
#Some Code
end
format.myformat do
#Some Code
end
end
The format is declared in the initializers/mime_types.rb as:
Sending requests to the server to the controller#index.myformat works fine except that the server response is a controller.myformat file. while I would like to get a controller.json one.
To be more precise, I would like RABL to render the views/controller/index.myformat.rabl BUT I want the response object to be built just as any json object with the .json extension?
Is there a way to do that with RABL? That would be much appreciated.
The text was updated successfully, but these errors were encountered:
Hello,
I'm trying to define a specific format (let's call it
myformat
) so as to do special operations when requests are made in this format. So, in my controller I have something like this:The format is declared in the
initializers/mime_types.rb
as:Sending requests to the server to the
controller#index.myformat
works fine except that the server response is acontroller.myformat
file. while I would like to get acontroller.json
one.To be more precise, I would like RABL to render the
views/controller/index.myformat.rabl
BUT I want the response object to be built just as anyjson
object with the .json extension?Is there a way to do that with RABL? That would be much appreciated.
The text was updated successfully, but these errors were encountered: