【发布时间】:2014-11-30 14:44:01
【问题描述】:
在控制器中
def test
command = 'pwd'
result = `#{command}`
respond_to do |format|
format.html { redirect_to(users_url) }
format.js { render :text => "$('#teste').html('#{result}');" }
end
end
我要显示变量结果
在视图中
<%= link_to 'Testar', test_users_path, :method => :get, :remote => true %>
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4