maybe somebody can help me with this. I need to execute javascript on the server side format.js do render :update do |page| page.insert_html :bottom, content_id, :partial => "add_to_favorite_from_dashboard", :locals => {:object => object, :favorite => favorite, :ftype => content_id}, :layout=>false #execute javascript function here _gaq.push([''_trackEvent'',event_category ,event_label, event_action]) end can I do something like this? -- 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.
On Tue, Dec 13, 2011 at 7:46 AM, gerbdla <gerbdla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > maybe somebody can help me with this. I need to execute javascript on > the server side > > > format.js do > render :update do |page| > page.insert_html :bottom, content_id, :partial => > "add_to_favorite_from_dashboard", :locals => {:object => > object, :favorite => favorite, :ftype => content_id}, :layout=>false > > #execute javascript function here > _gaq.push([''_trackEvent'',event_category ,event_label, event_action]) >you can use << page << ''alert("foo")''> end > > can I do something like this? > > -- > 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. > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- 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.
On Mon, Dec 12, 2011 at 3:46 PM, gerbdla <gerbdla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > maybe somebody can help me with this. I need to execute javascript on > the server sideWhy?> format.js do > render :update do |page| > page.insert_html :bottom, content_id, :partial => > "add_to_favorite_from_dashboard", :locals => {:object => > object, :favorite => favorite, :ftype => content_id}, :layout=>false > > #execute javascript function here > _gaq.push([''_trackEvent'',event_category ,event_label, event_action]) > > endIn the context of a page (even partial) render, you presumably want to include JS that will be executed on the client, yes? What do you expect the above line to accomplish? But if you really want to execute some JS on the server side, pull it out of that render action and look at the Johnson gem. HTH, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
On Tuesday 13 December 2011 05:16 AM, gerbdla wrote:> maybe somebody can help me with this. I need to execute javascript on > the server side > > > format.js do > render :update do |page| > page.insert_html :bottom, content_id, :partial => > "add_to_favorite_from_dashboard", :locals => {:object => > object, :favorite => favorite, :ftype => content_id}, :layout=>false > > #execute javascript function here > _gaq.push([''_trackEvent'',event_category ,event_label, event_action]) > > end > > can I do something like this? >try this code format.js {render :js => "alert(''Yse Javascript working fine.'');"} -- 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.
Hi, Anyone can help me how to give multiple search strings in imap_search function, i tried with regular expression as follws, since i want to search all strings in Subject starting with alphabet "s". $emails = imap_search($inbox,"BODY Sp*"); Kindly can u suggest any links on this multiple search -- 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.
Usha Murali wrote in post #1036452:> Hi, > > Anyone can help me how to give multiple search strings in imap_search > function, > > > i tried with regular expression as follws, since i want to search all > strings in Subject starting with alphabet "s". > > > $emails = imap_search($inbox,"BODY Sp*"); > > Kindly can u suggest any links on this multiple searchPlease do NOT hijack other posts and create a new post for this question. -- Posted via http://www.ruby-forum.com/. -- 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.
subbarao wrote in post #1036442:> On Tuesday 13 December 2011 05:16 AM, gerbdla wrote: >> #execute javascript function here >> _gaq.push([''_trackEvent'',event_category ,event_label, event_action]) >> >> end >> >> can I do something like this? >> > try this code > > format.js {render :js => "alert(''Yse Javascript working fine.'');"}This a nice railscast. You can see how you can create a js.erb file with the same name of your method that will be executed as part of a js format response: http://railscasts.com/episodes/205-unobtrusive-javascript -- Posted via http://www.ruby-forum.com/. -- 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.