Top "Respond-to" questions

ActionController::UnknownFormat

In my rails app I have a ajax request to the server, to store some data. This used to work …

ruby ajax ruby-on-rails-4 respond-to
Given a class, see if instance has method (Ruby)

I know in Ruby that I can use respond_to? to check if an object has a certain method. But, …

ruby respond-to
Rails: respond_to JSON and HTML

I have a controller "UserController" that should respond to normal and ajax requests to http://localhost:3000/user/3. When it is …

ruby-on-rails ruby ruby-on-rails-4 respond-to
how can I generate json from respond_to method in rails?

If I have a block of code like this: def show @post = Post.find(params[:id]) respond_to do |format| …

ruby-on-rails json respond-to
How to tell which format a controller has resolved to render

In a rails controller action with the following code: respond_to do |format| format.json{ render :json=> {:status => 200, :…

ruby-on-rails ruby-on-rails-3 controller respond-to
What does `:location => ...` and `head :ok` mean in the 'respond_to' format statement?

I am using Ruby on Rails 3 and I would like to know what the :location => ... and head :ok statements …

ruby-on-rails ruby ruby-on-rails-3 format respond-to
How does respond_to and respond_with work in rails?

When there is def some_action respond_to do |format| format.html {} format.js {} format.json { respond_with @objects} end …

ruby-on-rails ajax respond-to
Rails respond_with -- why does POST return a URL instead of the data?

This is a question "why does it work this way", not "how do I make this work". My app is …

ruby-on-rails-3 json rest respond-to