0

I have the following code as a controller action:

def create
  render :js => "alert('hello')"
end

But when I go to this view, I get a missing template error – 'create.rhtml'. What is the correct way to render a javascript response in Rails 1.2.6?

4

1 回答 1

1

render :file 可能是你使用 Rails 的最佳选择。您也可以使用旧的 RJS 样式。

于 2012-08-13T17:15:19.950 回答