[Rails] Re: respond_with with templates and http status when creating an object

2011-08-17 Thread Michel Pigassou
Hmm anyone? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/J-GXrTJol8wJ. To post to this group, send email to rubyonrails-talk@googlegroups.com.

[Rails] Re: respond_with with templates and http status when creating an object

2011-08-15 Thread Michel Pigassou
I was able to perform what I'm talking about in an initializer, maybe it can help seeing the big picture: ```ruby ActionController::Responder.class_eval do def to_format if has_errors? api_behavior(nil) and return end controller.response.status = :created if post? && ! has_er