forms - submit button not working rails -
i've been having trouble form in ruby , rails application. using slim template engine create layouts. here form code
= form_tag(:action => '/project/new', :method => "post", class: 'form-horizontal') ##### bunch of input fields ####### button.btn.btn-large.btn-primary.btn-block.disabled#go type="submit" go! span.help-inline * required fields when click on submit button nothing happens. no call made action in controller. here controller code:
def new puts "here" redirect_to :action "show" , id: 87 end the 'here' never gets printed terminal. wrong way setting form? in advance
replace
= form_tag(:action => '/project/new', :method => "post", class: 'form-horizontal') with
= form_tag({:controller => 'project', :action => 'new'}, :method => "post", class: 'form-horizontal') form_tag accepts 2 arguments: path action , options hash. need tell ruby which delimiting first hash (or both) curly brackets.
Comments
Post a Comment