I have looked around and seen similar problems but have not yet found a solution to this. Relatively new to RoR, I am trying to use render :update to modify the displayed page in the browser. No matter what I put in the render :update block, all I see is the code wrapped in the ''try'' statement that the generator creates. It''s not executed, it''s just displayed on the browser. I''m sure there is something basic I''m missing here. Any insight? Thanks, Michael -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
mstoth
2010-Apr-15 02:45 UTC
Re: render :update just displays code from JavaScriptGenerator
As an example, here''s the code in my controller: def destroy @rehearsal = Rehearsal.find(params[:id]) render :update do |page| page.call "delreh", "rehearsal_#{@rehearsal.id}" end end and after this method is called, this is what I see on the browser: try { delreh("rehearsal_15"); } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''delreh(\"rehearsal_15\");''); throw e } anyone please help. Thanks! On Apr 14, 7:48 pm, mstoth <mich...-pFXmGr0c18V4uZT98XS8CNBPR1lH4CV8@public.gmane.org> wrote:> I have looked around and seen similar problems but have not yet found > a solution to this. > > Relatively new to RoR, I am trying to use render :update to modify the > displayed page in the browser. > > No matter what I put in the render :update block, all I see is the > code wrapped in the ''try'' statement that the generator creates. It''s > not executed, it''s just displayed on the browser. I''m sure there is > something basic I''m missing here. > > Any insight? > > Thanks, > Michael-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Apr-15 07:32 UTC
Re: render :update just displays code from JavaScriptGenerator
On Apr 15, 3:45 am, mstoth <mich...-pFXmGr0c18V4uZT98XS8CNBPR1lH4CV8@public.gmane.org> wrote:> As an example, here''s the code in my controller: > > def destroy > @rehearsal = Rehearsal.find(params[:id]) > render :update do |page| > page.call "delreh", "rehearsal...-Aj1uj9O0yVhUsp14x37OKw@public.gmane.org}" > end > end >What does the link that invokes this look like ? You need to use link_to_remote (or similar) and you can''t use the update option to link_to_remote. Fred> and after this method is called, this is what I see on the browser: > > try { > delreh("rehearsal_15");} catch (e) { alert(''RJS error:\n\n'' + e.toString()); > > alert(''delreh(\"rehearsal_15\");''); throw e } > > anyone please help. Thanks! > > On Apr 14, 7:48 pm, mstoth <mich...-pFXmGr0c18V4uZT98XS8CNBPR1lH4CV8@public.gmane.org> wrote: > > > > > I have looked around and seen similar problems but have not yet found > > a solution to this. > > > Relatively new to RoR, I am trying to use render :update to modify the > > displayed page in the browser. > > > No matter what I put in the render :update block, all I see is the > > code wrapped in the ''try'' statement that the generator creates. It''s > > not executed, it''s just displayed on the browser. I''m sure there is > > something basic I''m missing here. > > > Any insight? > > > Thanks, > > Michael-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.