def index
@cellphones = Cellphone.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @cellphones }
end
SIMPLE ANSWERS PLEASE...
what is format.json used for?
do I have to create a view for it?
how does it relate to javascrip?
how does it relate to to ajax?
please give a simple example of how to use it...