I have a controller:

class ItemsController < ApplicationController
respond_to :json

def index
groups = Item.all

respond_with(items)
end
end

I am curling *my_app/items.json* and see a response with JSON object — just
as expected. At this point I don't have any views associated with
controller, specifically I don't have *index.html.erb* (*.html*).

Now if only I create an *index.haml* (for instance), with a simple *%h1
Hello, world!* line, requesting (again via curl) *my_app/items.json* returns
an html string with *<h1>Hello, world!</h1>*. Note that I didn't alter the
controller code — it just remains untouched.

I'm sure I'm missing something. Any help on explaining of what's happening
here?

--
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/-/71blrVMlz6UJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Eugene Pirogov at Dec 29, 2011 at 1:03 am
    Oh, it's Rails 3.2.0.rc1 by the way.

    --
    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/-/kGmIUSK-JgIJ.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedDec 29, '11 at 1:02a
activeDec 29, '11 at 1:03a
posts2
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Eugene Pirogov: 2 posts

People

Translate

site design / logo © 2022 Grokbase