Ruby按钮动作

时间:2014-02-25 10:30:47

标签: ruby-on-rails

我在控制器文件中有一个方法,我只想在按下按钮时激活它。

index.html.erb

<%= button_to 'Export POINT', :controller => 'my_controller', :action => 'create_file_txt' %>

my_controller.erb

def create_file_txt 
.
.
end

init.rb

permission :view_button_exp, {:controller => :my_controller, :action => :create_file_txt}, :require => :member

0 个答案:

没有答案