Ruby on Rails Saturday, October 15, 2016

On 15 October 2016 at 16:40, Walter Lee Davis <waltd@wdstudio.com> wrote:

> On Oct 15, 2016, at 3:25 AM, kinoe - <kinoe48@gmail.com> wrote:
>
> I have routes.rb:
> resources :user
> #that have default
> #      path        verb
> # user_index get     "user#index''
> #                         post    "user#create"
> #new_user     get       "user#new"
> for moment i using method "new" as new.htmk(form login)&"create" as process get data from db.
> new.html.erb
> <%=form_for :blog,url: user_index_path do lbl%>
> ........
> user_controller.rb
> def new
> @blog   = Box.new
> end
> #procces login
> def create
> @b =Box.find_by(search_params)
> .....
> end
> if i try make routes like this
> get '/user/login',to: "user#login"
> that only for view html verb get,how make process it that verb post like deafult routes? thank you.

Start here: http://guides.rubyonrails.org/routing.html

Read that entire page, and try what it suggests. If you have questions after that, post what you tried and what happened when you did so here, and someone can help you.

Also I think you would benefit from working right through a good tutorial such as railstutorial.org (which is free to use online).

Colin
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLv1DF0xwNVufVrB%3DFerY0RasvuzLphgCyH7kwAmT08ybw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment