Ruby on Rails Question: Inside the controller you have seven REST actions. Almost all of them have respond to do format xml/html or json. I have no idea what this means. Can you please explain it's purpose. For example:
def index
@tweets = Tweet.all
respond_to do |format|
format.html
format.json { render json: @tweets }
end
end
What is the purpose of the "respond to" part that contains the html and json? What do these formats do? Also, what is the difference between xml and html? Sometimes I see xml and other times html.
Thank you