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
A great benefit to using mustache is the ability to reuse the views on the client. The gem should return the JSON representation of the mustache view when a JSON request is made.
Ideally this would require no additional effort on the controller. For example, this action below should return the rendered mustache if HTML is requested, or the JSON representation of the view if JSON is requested.
def index
@users = User.all
respond_with(@users)
end
Right now I'm looking into a mustache custom responder to intercept JSON requests and create a mustache view and call view.to_json instead of the default behavior of @users.to_json that would typically occur.
The text was updated successfully, but these errors were encountered:
A great benefit to using mustache is the ability to reuse the views on the client. The gem should return the JSON representation of the mustache view when a JSON request is made.
Ideally this would require no additional effort on the controller. For example, this action below should return the rendered mustache if HTML is requested, or the JSON representation of the view if JSON is requested.
def index
@users = User.all
respond_with(@users)
end
Right now I'm looking into a mustache custom responder to intercept JSON requests and create a mustache view and call view.to_json instead of the default behavior of @users.to_json that would typically occur.
The text was updated successfully, but these errors were encountered: