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
There's now json actions for calendar#show and events#show. However, it still barfs when the wrong token is specified (rather than returning 404).
Right now, the json returns are implemented using to_json, which is sorta fine, but doesn't allow for a lot of control over how the json is serialized and (in my opinion) mixes view and controller stuff into one magic railsy thing.
@mamhoff To limit the returned data, I think you can use something like to_json(only: [:title, ...]). Take a look here.
In terms of view/controller separation, as long as you just return json, I think it should be in the controller. The view is just used for presenting data to a user. In our case the presentation would be handled by a backbone template.
Yeah, I know. The before filter works great actually if you have valid
data, but barfs if your hash is invalid.
Am 12.03.2014 11:53 schrieb "Philipp Hansch" [email protected]:
@mamhoffhttps://github.com/mamhoff To limit the returned data, I think
you can use something like to_json(only: [:title, ...]). Take a look herehttp://apidock.com/rails/ActiveRecord/Serialization/to_json.
In terms of view/controller separation, as long as you just return json, I
thinkt should be in the controller. The view is just used for presenting
data to a user. In our case the presentation would be handled by a backbone
template.
Not sure about the token issue
Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-37395758
.
No description provided.
The text was updated successfully, but these errors were encountered: