English 中文(简体)
render render 弃 真实情况
原标题:render form through jquery disables :remote => true

附录 我有这样的形式(在I ve set @alert =ert.new)。

<%= form_for( @alert, :remote => true ) do |f| %>
...

这部工程是罚款的,当我点击提交我时,我就拿了。

Procesing by CruelsController#create as JS

最后,我进入了 app/view/c。

However, if I render the form through a JQuery call the :remote => true seems to be forgotten.

$("div.new_alert").html( "<%= escape_javascript( render( :partial => "alerts/form" ) ) %>" );

现在,当我点击提交我时,我就跑了。

Processing by AlertsController#create as HTML

和形式. . .html

我能如何通过“联合之四”使形式成为形式,并且仍然能够作为联合材料处理?

问题回答

这一问题在从铁路提升到3.1时消失。 我不敢确定问题涉及3.0,但我最有可能用javascript_include_tag,这样,J Query可能部分被打断。 我在升级时清理了javascript_include_tag,现在我再也没有问题。





相关问题
Remove ActiveRecord in Rails 3

Now that Rails 3 beta is out, I thought I d have a look at rewriting an app I have just started work on in Rails 3 beta, both to get a feel for it and get a bit of a head-start. The app uses MongoDB ...

When will you upgrade your app to Rails 3? [closed]

Now that the Rails 3 beta is here, let s take a little straw poll. Please tell us briefly what your application does and when you will upgrade it to Rails 3. Or, if you re not planning on upgrading ...

Bundler isn t loading gems

I have been having a problem with using Bundler and being able to access my gems without having to require them somewhere, as config.gem used to do that for me (as far as I know). In my Rails 3 app, I ...

bypass attr_accessible/protected in rails

I have a model that, when it instantiates an object, also creates another object with the same user id. class Foo > ActiveRecord::Base after_create: create_bar private def create_bar Bar....

concat two fields activerecord

I m so used to oracle where you can simply concat(field1, , field2) but if I m using activerecord to find the field1 and field2, and I need a space in between, how do I accomplish this? Cheers ...

热门标签