ruby on rails - Render a new view upon json -


i trying build simple bit confused. have customer controller 2 actions, index , identification. views of these actions display image each. want able change index view identification view when ios app sends simple json request (it post, doesn"t matter want change view). customer_controller.rb is

def index     respond_to |format|         format.html # index.html.erb         format.json {render 'identification'}     end   end    def identification     @date = time.now.strftime("%a, %d %b %y")     @time = time.now.strftime("%h:%m %p")   end 

my routes.rb

get "customer/index"   post "customer/index"   "customer/identification" 

can point me right direction doing wrong? whenever ios app sends json nothing happens.

when call render 'identification' tells rails use 'identification' template, not call #identification method.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -