0

I'm writing a plugin for my redmine and I need to pass a param from my view to my controller. I'm trying to pass the param @repository.url which already exists on my erb.html file.

Bellow are the code which I'm trying to work. Please, what am I doing wrong? :

_navigation.erb.html

<% 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', :with => "'id=' + $('@repository.url').value")%>
    </div>

gerar_versao_controller.rb

def exec_client(url_branch)
.
.
.
end

Thanks.

kamusett
  • 1,403
  • 1
  • 12
  • 22

1 Answers1

0

I think this should work for you.

<%= button_to_function l(:gerar_build_project), remote_function(:action => 'exec_client', :controller => 'GerarVersao', :with => "'id=' + $('#{@repository.url}').value") %>
rodmanhe
  • 1
  • 1
  • That did not work. I debugged the system and when I clicked on button nothing happened. This happens only I put the parameter **:with** in the clause, if I remove the parameter, my clause is called normally. I'm suspecting this method is deprecated. – kamusett Jun 13 '13 at 14:33
  • Yes, it is deprecated as of ROR 3.0.9 – rodmanhe Jun 13 '13 at 15:10
  • So, do you know how can I replace the remote_function to call a my function in controller? – kamusett Jun 13 '13 at 16:11