i using scaffold on ruby on rails, , great , all, makes simpler, dont understand 1 thing , books or web dont have clear solution.
for exmaple, use scaffold , create table user , can make /user/1 , see user id 1 , , if make /user/edit/1 edit user id number 1, on controller code this
def show @user = user.find(params[:id]) respond_to |format| format.html # show.html.erb format.json { render json: @user } end end
according mvc ive worked, controller first in respond, so, in way should able indicate use show method, how? dont have else added on routes file. idea??
the default routes "http verb: get, path: /photos/:id, action: show, used for: display specific photo". see documentation.
Comments
Post a Comment