Passing params from view to controller in ruby on rails -


this view code

_navigation.html.erb

<% if user.current.allowed_to?(:view_repository, @project) -%>     <div style="float: left; width: auto; padding-right: 1%">       <%= button_to_function l(:gerar_build_project), remote_function(:action => 'exec_client', :controller => 'gerarversao')%>     </div> | <% end -%> 

exec_client function in controller side. below following code:

gerar_versao_controller.rb

def exec_client(branch) hostname = 'localhost' port = 8522 s = tcpsocket.open(hostname, port) s.puts "msg_rv" s.puts branch.to_s s.close end 

this code doesn't works. error:

argumenterror (wrong number of arguments (0 1)):

the question is: how pass param branch controller function?

i think should use :with parameter @ example http://apidock.com/rails/actionview/helpers/prototypehelper/remote_function#529-example


Comments