Forum: Ruby on Rails render :update, error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
abusiek (Guest)
on 2009-03-25 03:11
(Received via mailing list)
Hi!

In my view i have remote_form_for and action in controller:

 def save_offer_basics
    @offer = Offer.new params[:offer_basics]
    @offer.user_id = current_user.id
    @offer.enable_validation_group :offer_basic

    render :update do |page|
      if @offer.valid?
       @offer.save
        flash[:notice] = 'Podstawowe dane oferty zosta³y zapisane!
Kolejnym krokiem jest wybranie kategorii.'
        page[:mdiv].replace_html message_block(:on => [:offer])
        page[:offer_basics_id].value = @offer.id
      else
       page[:mdiv].replace_html message_block(:on => [:offer])
      end
      page[:mdiv].show
    end
  end

Unfortunetly it never saves. When i debug code with netbeans it stops
on line render :update do |page| with exception:

undefined method `class_eval' for
#<ActionView::Helpers::PrototypeHelper::JavaScriptGenerator:
0xb5f0165c>

with trace

    <div id="Application-Trace" style="display: block;">
      <pre><code>vendor/plugins/validationgroup/lib/
validation_group.rb:7:in `extended'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/helpers/
prototype_helper.rb:587:in `ext
end'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/helpers/
prototype_helper.rb:587:in `inc
lude_helpers_from_context'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/helpers/
prototype_helper.rb:586:in `eac
h'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/helpers/
prototype_helper.rb:586:in `inc
lude_helpers_from_context'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/helpers/
prototype_helper.rb:580:in `ini
tialize'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/
base.rb:917:in `new'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/
base.rb:917:in `render_with_no_la
yout'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/
layout.rb:259:in `render_without_
benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/
benchmarking.rb:51:in `render'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/
core_ext/benchmark.rb:8:in `realt
ime'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/
benchmarking.rb:51:in `render'
app/controllers/offer/create_controller.rb:31:in `save_offer_basics'

Thanks for any help :)

Adrian
Frederick C. (Guest)
on 2009-03-25 11:14
(Received via mailing list)
On Mar 25, 1:10 am, abusiek <removed_email_address@domain.invalid> wrote:

>       <pre><code>vendor/plugins/validationgroup/lib/
> validation_group.rb:7:in `extended'

This is some of your code (or a plugin you have installed). It's been
evaluated in the context of the javascript generator class and you to
be careful in there because most methods that exist are undefined in
there.

Fred
This topic is locked and can not be replied to.