ruby - rails render format- why two formats -


this code generated scaffolding

  def index     @swimming_classschedules = swimming::classschedule.all      respond_to |format|       format.html # index.html.erb       format.json { render json: @swimming_classschedules }     end   end 

why generated 2 formats . seems use html format. when json format used?

sometimes need data in format of json. ruby on rails 1 of must used framework backend of mobile application (android, ios). android , ios support data in format of json. data of json format generated when scaffloding. in case of web application not necessary generate data in format of json.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -