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

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -