Hi
I had ajax commenting on my app, which worked perfectly on Rails
v1.2.6, but does not work the same in Rails 2.02. Basically the
comment gets added, but the visual effects do not work (ie lines 2 + 3
of create.rjs)
create.js
page.insert_html :bottom, ''comments'', :partial =>
''comment''
page.visual_effect :appear, "comment_#{@comment.id}"
page.visual_effect :highlight, "comment_#{@comment.id}", {:startcolor
=> ''"#84E003"''}
commentscontroller.rb:
def create
@comment = Comment.new(params[:comment])
@comment.user = User.find(current_user)
@comment.story = Story.find(params[:story_id])
respond_to do |format|
if @comment.save
format.html { redirect_to story_url(@comment.story) }
format.js
else
format.html { redirect_to story_url(@comment.story) }
end
end
end
I have tried changing to create.js.rjs, but that makes no difference?
Doe anyone have any experience with this in Rails 2.0.2?
PJ.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Elaborate on "do not work" Do they get called and raise an error do they not get called at all? Is the page loading at all? Are you using Firefox? Do you have Firebug? What is Firebug telling you about the AJAX request? Do you like cheese on toast? What''s the square root of 24... the questions are endless. On Jan 23, 2008 12:07 PM, PJAY79 <pjay1979-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> > Hi > > I had ajax commenting on my app, which worked perfectly on Rails > v1.2.6, but does not work the same in Rails 2.02. Basically the > comment gets added, but the visual effects do not work (ie lines 2 + 3 > of create.rjs) > > create.js > page.insert_html :bottom, ''comments'', :partial => ''comment'' > page.visual_effect :appear, "comment_#{@comment.id<comment_#%7B-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org> > }" > page.visual_effect :highlight, "comment_#{@comment.id<comment_#%7B-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org>}", > {:startcolor > => ''"#84E003"''} > > commentscontroller.rb: > def create > @comment = Comment.new(params[:comment]) > @comment.user = User.find(current_user) > @comment.story = Story.find(params[:story_id]) > respond_to do |format| > if @comment.save > format.html { redirect_to story_url(@comment.story) } > format.js > else > format.html { redirect_to story_url(@comment.story) } > end > end > end > > I have tried changing to create.js.rjs, but that makes no difference? > > Doe anyone have any experience with this in Rails 2.0.2? > > PJ. > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Ryan There are no errors thrown in the console or in Firefox. The comment is added, but without the visual effects, as i said.... so i guess they do not get called at all.. I will have to install Firebug! It just seems odd to me as it was working perfect on Rails 1.2.6. P. On Jan 23, 3:08 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Elaborate on "do not work" > > Do they get called and raise an error do they not get called at all? Is the > page loading at all? Are you using Firefox? Do you have Firebug? What is > Firebug telling you about the AJAX request? Do you like cheese on toast? > What''s the square root of 24... the questions are endless. > > On Jan 23, 2008 12:07 PM, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > > Hi > > > I had ajax commenting on my app, which worked perfectly on Rails > > v1.2.6, but does not work the same in Rails 2.02. Basically the > > comment gets added, but the visual effects do not work (ie lines 2 + 3 > > of create.rjs) > > > create.js > > page.insert_html :bottom, ''comments'', :partial => ''comment'' > > page.visual_effect :appear, "comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id> > > }" > > page.visual_effect :highlight, "comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}", > > {:startcolor > > => ''"#84E003"''} > > > commentscontroller.rb: > > def create > > @comment = Comment.new(params[:comment]) > > @comment.user = User.find(current_user) > > @comment.story = Story.find(params[:story_id]) > > respond_to do |format| > > if @comment.save > > format.html { redirect_to story_url(@comment.story) } > > format.js > > else > > format.html { redirect_to story_url(@comment.story) } > > end > > end > > end > > > I have tried changing to create.js.rjs, but that makes no difference? > > > Doe anyone have any experience with this in Rails 2.0.2? > > > PJ. > > -- > Ryan Bigghttp://www.frozenplague.net > Feel free to add me to MSN and/or GTalk as this email.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ok i installed Firebug.
I looked in ''console > response''
This is what appears...
try {
new Insertion.Bottom("comments", "\u003Cdiv
id=\"comment_52\" class\"comment\"\u003E\n\u003Cp\u003E
\"praveen\"\u003Cbr /\u003E\n\n\u003Cimg
alt=\"Imgp1090_thumb\" id\"avatar_thumb\"
src=\"/avatars/0000
/0001/IMGP1090_thumb.JPG?1200983769\" /\u003E\n\n\u003Ca
href=\"/users/
1\"\u003EPraveen\u003C/a\u003E
from Australia said this on January 23, 2008 16:48.\u003C/p\u003E\n\n
\u003Ca href=\"#\" onclick=\"if
(confirm(''Are you sure?'')) { new
Ajax.Request(''/comments/52?
story_id=4'', {asynchronous:true, evalScripts
:true, method:''delete''}); }; return
false;\"\u003EDESTROY\u003C/a\u003E
\n\n\u003C/div\u003E\n");
new Effect.Appear("comment_52",{});
new
Effect.Highlight("comment_52",{startcolor:''"#84E003"''});
} catch (e) { alert(''RJS error:\n\n'' + e.toString());
alert(''new
Insertion.Bottom(\"comments\", \"\\u003Cdiv
id=\\\"comment_52\\\"
class=\\\"comment\\\"\\u003E\\n\\u003Cp\\u003E\\
\"praveen\\\"\\u003Cbr /\\u003E
\\n\\n\\u003Cimg alt=\\\"Imgp1090_thumb\\\"
id=\\\"avatar_thumb\\\"
src=\\\"/avatars/0000/0001/IMGP1090_thumb
.JPG?1200983769\\\" /\\u003E\\n\\n\\u003Ca href=\\\"/users/1\\\"\
\u003EPraveen\\u003C/a\\u003E from Australia
said this on January 23, 2008 16:48.\\u003C/p\\u003E\\n\\n\\u003Ca
href=\\\"#\\\" onclick=\\\"if (confirm
(\''Are you sure?\'')) { new
Ajax.Request(\''/comments/52?story_id=4\'',
{asynchronous:true, evalScripts
:true, method:\''delete\''}); }; return
false;\\\"\\u003EDESTROY\\u003C/a
\\u003E\\n\\n\\u003C/div\\u003E
\\n\");\nnew Effect.Appear(\"comment_52\",{});\nnew
Effect.Highlight(\"comment_52\",{startcolor:\''\"
#84E003\"\''});''); throw e }
???
PJ
On Jan 23, 4:34 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
wrote:> Hi Ryan
>
> There are no errors thrown in the console or in Firefox. The comment
> is added, but without the visual effects, as i said.... so i guess
> they do not get called at all..
>
> I will have to install Firebug!
>
> It just seems odd to me as it was working perfect on Rails 1.2.6.
>
> P.
>
> On Jan 23, 3:08 pm, "Ryan Bigg"
<radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > Elaborate on "do not work"
>
> > Do they get called and raise an error do they not get called at all?
Is the
> > page loading at all? Are you using Firefox? Do you have Firebug? What
is
> > Firebug telling you about the AJAX request? Do you like cheese on
toast?
> > What''s the square root of 24... the questions are endless.
>
> > On Jan 23, 2008 12:07 PM, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > Hi
>
> > > I had ajax commenting on my app, which worked perfectly on Rails
> > > v1.2.6, but does not work the same in Rails 2.02. Basically the
> > > comment gets added, but the visual effects do not work (ie lines
2 + 3
> > > of create.rjs)
>
> > > create.js
> > > page.insert_html :bottom, ''comments'', :partial
=> ''comment''
> > > page.visual_effect :appear,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>
> > > }"
> > > page.visual_effect :highlight,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}",
> > > {:startcolor
> > > => ''"#84E003"''}
>
> > > commentscontroller.rb:
> > > def create
> > > @comment = Comment.new(params[:comment])
> > > @comment.user = User.find(current_user)
> > > @comment.story = Story.find(params[:story_id])
> > > respond_to do |format|
> > > if @comment.save
> > > format.html { redirect_to story_url(@comment.story) }
> > > format.js
> > > else
> > > format.html { redirect_to story_url(@comment.story) }
> > > end
> > > end
> > > end
>
> > > I have tried changing to create.js.rjs, but that makes no
difference?
>
> > > Doe anyone have any experience with this in Rails 2.0.2?
>
> > > PJ.
>
> > --
> > Ryan Bigghttp://www.frozenplague.net
> > Feel free to add me to MSN and/or GTalk as this email.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Anyone?
I''ve seen this type of problem a lot on doing a google search...and on
this list...
"alert(''RJS error:\n\n'' + e.toString())"
But everyone seems to have different ideas as to what is the problem
and some solutions work for some and not for others...
Nothing i''ve tried works...
PJ.
On Jan 23, 4:54 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
wrote:> Ok i installed Firebug.
>
> I looked in ''console > response''
>
> This is what appears...
>
> try {
>
> new Insertion.Bottom("comments", "\u003Cdiv
id=\"comment_52\" class> \"comment\"\u003E\n\u003Cp\u003E
>
> \"praveen\"\u003Cbr /\u003E\n\n\u003Cimg
alt=\"Imgp1090_thumb\" id> \"avatar_thumb\"
src=\"/avatars/0000
>
> /0001/IMGP1090_thumb.JPG?1200983769\" /\u003E\n\n\u003Ca
href=\"/users/
> 1\"\u003EPraveen\u003C/a\u003E
>
> from Australia said this on January 23, 2008 16:48.\u003C/p\u003E\n\n
> \u003Ca href=\"#\" onclick=\"if
>
> (confirm(''Are you sure?'')) { new
Ajax.Request(''/comments/52?
> story_id=4'', {asynchronous:true, evalScripts
>
> :true, method:''delete''}); }; return
false;\"\u003EDESTROY\u003C/a\u003E
> \n\n\u003C/div\u003E\n");
>
> new Effect.Appear("comment_52",{});
>
> new
Effect.Highlight("comment_52",{startcolor:''"#84E003"''});
>
> } catch (e) { alert(''RJSerror:\n\n'' + e.toString());
alert(''new
>
> Insertion.Bottom(\"comments\", \"\\u003Cdiv
>
> id=\\\"comment_52\\\"
class=\\\"comment\\\"\\u003E\\n\\u003Cp\\u003E\\
> \"praveen\\\"\\u003Cbr /\\u003E
>
> \\n\\n\\u003Cimg alt=\\\"Imgp1090_thumb\\\"
id=\\\"avatar_thumb\\\"
> src=\\\"/avatars/0000/0001/IMGP1090_thumb
>
> .JPG?1200983769\\\" /\\u003E\\n\\n\\u003Ca
href=\\\"/users/1\\\"\
> \u003EPraveen\\u003C/a\\u003E from Australia
>
> said this on January 23, 2008 16:48.\\u003C/p\\u003E\\n\\n\\u003Ca
> href=\\\"#\\\" onclick=\\\"if (confirm
>
> (\''Are you sure?\'')) { new
Ajax.Request(\''/comments/52?story_id=4\'',
> {asynchronous:true, evalScripts
>
> :true, method:\''delete\''}); }; return
false;\\\"\\u003EDESTROY\\u003C/a
> \\u003E\\n\\n\\u003C/div\\u003E
>
> \\n\");\nnew Effect.Appear(\"comment_52\",{});\nnew
> Effect.Highlight(\"comment_52\",{startcolor:\''\"
>
> #84E003\"\''});''); throw e }
>
> ???
>
> PJ
>
> On Jan 23, 4:34 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > Hi Ryan
>
> > There are no errors thrown in the console or in Firefox. The comment
> > is added, but without the visual effects, as i said.... so i guess
> > they do not get called at all..
>
> > I will have to install Firebug!
>
> > It just seems odd to me as it was working perfect on Rails 1.2.6.
>
> > P.
>
> > On Jan 23, 3:08 pm, "Ryan Bigg"
<radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > Elaborate on "do not work"
>
> > > Do they get called and raise anerrordo they not get called at
all? Is the
> > > page loading at all? Are you using Firefox? Do you have Firebug?
What is
> > > Firebug telling you about the AJAX request? Do you like cheese on
toast?
> > > What''s the square root of 24... the questions are
endless.
>
> > > On Jan 23, 2008 12:07 PM, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > Hi
>
> > > > I had ajax commenting on my app, which worked perfectly on
Rails
> > > > v1.2.6, but does not work the same in Rails 2.02. Basically
the
> > > > comment gets added, but the visual effects do not work (ie
lines 2 + 3
> > > > of create.rjs)
>
> > > > create.js
> > > > page.insert_html :bottom, ''comments'',
:partial => ''comment''
> > > > page.visual_effect :appear,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>
> > > > }"
> > > > page.visual_effect :highlight,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}",
> > > > {:startcolor
> > > > => ''"#84E003"''}
>
> > > > commentscontroller.rb:
> > > > def create
> > > > @comment = Comment.new(params[:comment])
> > > > @comment.user = User.find(current_user)
> > > > @comment.story = Story.find(params[:story_id])
> > > > respond_to do |format|
> > > > if @comment.save
> > > > format.html { redirect_to story_url(@comment.story) }
> > > > format.js
> > > > else
> > > > format.html { redirect_to story_url(@comment.story) }
> > > > end
> > > > end
> > > > end
>
> > > > I have tried changing to create.js.rjs, but that makes no
difference?
>
> > > > Doe anyone have any experience with this in Rails 2.0.2?
>
> > > > PJ.
>
> > > --
> > > Ryan Bigghttp://www.frozenplague.net
> > > Feel free to add me to MSN and/or GTalk as this email.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Have you found a solution to this. I am having the same problem.
I do something like this:
page.replace "student_#{@student.id}", :partial =>
"show", :locals => {:rendition => @rendition}
page.visual_effect :highlight, "student_#{@student.id}",
{:endcolor => "''#EAE8D5''", :endcolor =>
"''#EAE8D5''"}
If I comment out the 2nd line the replace works fine. The highlight
seems to kill any kind of javascript running.
On Jan 24, 3:21 am, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
wrote:> Anyone?
>
> I''ve seen this type of problem a lot on doing a google
search...and on
> this list...
>
> "alert(''RJS error:\n\n'' + e.toString())"
>
> But everyone seems to have different ideas as to what is the problem
> and some solutions work for some and not for others...
>
> Nothing i''ve tried works...
>
> PJ.
>
> On Jan 23, 4:54 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > Ok i installed Firebug.
>
> > I looked in ''console > response''
>
> > This is what appears...
>
> > try {
>
> > new Insertion.Bottom("comments", "\u003Cdiv
id=\"comment_52\" class> >
\"comment\"\u003E\n\u003Cp\u003E
>
> > \"praveen\"\u003Cbr /\u003E\n\n\u003Cimg
alt=\"Imgp1090_thumb\" id> > \"avatar_thumb\"
src=\"/avatars/0000
>
> > /0001/IMGP1090_thumb.JPG?1200983769\" /\u003E\n\n\u003Ca
href=\"/users/
> > 1\"\u003EPraveen\u003C/a\u003E
>
> > from Australia said this on January 23, 2008 16:48.\u003C/p\u003E\n\n
> > \u003Ca href=\"#\" onclick=\"if
>
> > (confirm(''Are you sure?'')) { new
Ajax.Request(''/comments/52?
> > story_id=4'', {asynchronous:true, evalScripts
>
> > :true, method:''delete''}); }; return
false;\"\u003EDESTROY\u003C/a\u003E
> > \n\n\u003C/div\u003E\n");
>
> > new Effect.Appear("comment_52",{});
>
> > new
Effect.Highlight("comment_52",{startcolor:''"#84E003"''});
>
> > } catch (e) { alert(''RJSerror:\n\n'' + e.toString());
alert(''new
>
> > Insertion.Bottom(\"comments\", \"\\u003Cdiv
>
> > id=\\\"comment_52\\\"
class=\\\"comment\\\"\\u003E\\n\\u003Cp\\u003E\\
> > \"praveen\\\"\\u003Cbr /\\u003E
>
> > \\n\\n\\u003Cimg alt=\\\"Imgp1090_thumb\\\"
id=\\\"avatar_thumb\\\"
> > src=\\\"/avatars/0000/0001/IMGP1090_thumb
>
> > .JPG?1200983769\\\" /\\u003E\\n\\n\\u003Ca
href=\\\"/users/1\\\"\
> > \u003EPraveen\\u003C/a\\u003E from Australia
>
> > said this on January 23, 2008 16:48.\\u003C/p\\u003E\\n\\n\\u003Ca
> > href=\\\"#\\\" onclick=\\\"if (confirm
>
> > (\''Are you sure?\'')) { new
Ajax.Request(\''/comments/52?story_id=4\'',
> > {asynchronous:true, evalScripts
>
> > :true, method:\''delete\''}); }; return
false;\\\"\\u003EDESTROY\\u003C/a
> > \\u003E\\n\\n\\u003C/div\\u003E
>
> > \\n\");\nnew Effect.Appear(\"comment_52\",{});\nnew
> >
Effect.Highlight(\"comment_52\",{startcolor:\''\"
>
> > #84E003\"\''});''); throw e }
>
> > ???
>
> > PJ
>
> > On Jan 23, 4:34 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > Hi Ryan
>
> > > There are no errors thrown in the console or in Firefox. The
comment
> > > is added, but without the visual effects, as i said.... so i
guess
> > > they do not get called at all..
>
> > > I will have to install Firebug!
>
> > > It just seems odd to me as it was working perfect on Rails 1.2.6.
>
> > > P.
>
> > > On Jan 23, 3:08 pm, "Ryan Bigg"
<radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > Elaborate on "do not work"
>
> > > > Do they get called and raise anerrordo they not get called
at all? Is the
> > > > page loading at all? Are you using Firefox? Do you have
Firebug? What is
> > > > Firebug telling you about the AJAX request? Do you like
cheese on toast?
> > > > What''s the square root of 24... the questions are
endless.
>
> > > > On Jan 23, 2008 12:07 PM, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > Hi
>
> > > > > I had ajax commenting on my app, which worked perfectly
on Rails
> > > > > v1.2.6, but does not work the same in Rails 2.02.
Basically the
> > > > > comment gets added, but the visual effects do not work
(ie lines 2 + 3
> > > > > of create.rjs)
>
> > > > > create.js
> > > > > page.insert_html :bottom, ''comments'',
:partial => ''comment''
> > > > > page.visual_effect :appear,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>
> > > > > }"
> > > > > page.visual_effect :highlight,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}",
> > > > > {:startcolor
> > > > > => ''"#84E003"''}
>
> > > > > commentscontroller.rb:
> > > > > def create
> > > > > @comment = Comment.new(params[:comment])
> > > > > @comment.user = User.find(current_user)
> > > > > @comment.story = Story.find(params[:story_id])
> > > > > respond_to do |format|
> > > > > if @comment.save
> > > > > format.html { redirect_to
story_url(@comment.story) }
> > > > > format.js
> > > > > else
> > > > > format.html { redirect_to
story_url(@comment.story) }
> > > > > end
> > > > > end
> > > > > end
>
> > > > > I have tried changing to create.js.rjs, but that makes
no difference?
>
> > > > > Doe anyone have any experience with this in Rails
2.0.2?
>
> > > > > PJ.
>
> > > > --
> > > > Ryan Bigghttp://www.frozenplague.net
> > > > Feel free to add me to MSN and/or GTalk as this email.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
change create.js to create.js.rjs I just did a refresher on rjs for rails 2 I wrote up what I changes. I was using Peepcode rjs screencast my post http://johnivanoff.blogspot.com/#2317945271487058293 peepcode http://peepcode.com/products/rjs-templates HTH john i On Feb 14, 3:48 pm, jdhale <jason.d.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Have you found a solution to this. I am having the same problem. > > I do something like this: > > page.replace "student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}", :partial => > "show", :locals => {:rendition => @rendition} > page.visual_effect :highlight, "student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}", > {:endcolor => "''#EAE8D5''", :endcolor => "''#EAE8D5''"} > > If I comment out the 2nd line the replace works fine. The highlight > seems to kill any kind of javascript running. > > On Jan 24, 3:21 am, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > Anyone? > > > I''ve seen this type of problem a lot on doing a google search...and on > > this list... > > > "alert(''RJS error:\n\n'' + e.toString())" > > > But everyone seems to have different ideas as to what is the problem > > and some solutions work for some and not for others... > > > Nothing i''ve tried works... > > > PJ. > > > On Jan 23, 4:54 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > Ok i installed Firebug. > > > > I looked in ''console > response'' > > > > This is what appears... > > > > try { > > > > new Insertion.Bottom("comments", "\u003Cdiv id=\"comment_52\" class> > > \"comment\"\u003E\n\u003Cp\u003E > > > > \"praveen\"\u003Cbr /\u003E\n\n\u003Cimg alt=\"Imgp1090_thumb\" id> > > \"avatar_thumb\" src=\"/avatars/0000 > > > > /0001/IMGP1090_thumb.JPG?1200983769\" /\u003E\n\n\u003Ca href=\"/users/ > > > 1\"\u003EPraveen\u003C/a\u003E > > > > from Australia said this on January 23, 2008 16:48.\u003C/p\u003E\n\n > > > \u003Ca href=\"#\" onclick=\"if > > > > (confirm(''Are you sure?'')) { new Ajax.Request(''/comments/52? > > > story_id=4'', {asynchronous:true, evalScripts > > > > :true, method:''delete''}); }; return false;\"\u003EDESTROY\u003C/a\u003E > > > \n\n\u003C/div\u003E\n"); > > > > new Effect.Appear("comment_52",{}); > > > > new Effect.Highlight("comment_52",{startcolor:''"#84E003"''}); > > > > } catch (e) { alert(''RJSerror:\n\n'' + e.toString()); alert(''new > > > > Insertion.Bottom(\"comments\", \"\\u003Cdiv > > > > id=\\\"comment_52\\\" class=\\\"comment\\\"\\u003E\\n\\u003Cp\\u003E\\ > > > \"praveen\\\"\\u003Cbr /\\u003E > > > > \\n\\n\\u003Cimg alt=\\\"Imgp1090_thumb\\\" id=\\\"avatar_thumb\\\" > > > src=\\\"/avatars/0000/0001/IMGP1090_thumb > > > > .JPG?1200983769\\\" /\\u003E\\n\\n\\u003Ca href=\\\"/users/1\\\"\ > > > \u003EPraveen\\u003C/a\\u003E from Australia > > > > said this on January 23, 2008 16:48.\\u003C/p\\u003E\\n\\n\\u003Ca > > > href=\\\"#\\\" onclick=\\\"if (confirm > > > > (\''Are you sure?\'')) { new Ajax.Request(\''/comments/52?story_id=4\'', > > > {asynchronous:true, evalScripts > > > > :true, method:\''delete\''}); }; return false;\\\"\\u003EDESTROY\\u003C/a > > > \\u003E\\n\\n\\u003C/div\\u003E > > > > \\n\");\nnew Effect.Appear(\"comment_52\",{});\nnew > > > Effect.Highlight(\"comment_52\",{startcolor:\''\" > > > > #84E003\"\''});''); throw e } > > > > ??? > > > > PJ > > > > On Jan 23, 4:34 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > Hi Ryan > > > > > There are no errors thrown in the console or in Firefox. The comment > > > > is added, but without the visual effects, as i said.... so i guess > > > > they do not get called at all.. > > > > > I will have to install Firebug! > > > > > It just seems odd to me as it was working perfect on Rails 1.2.6. > > > > > P. > > > > > On Jan 23, 3:08 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Elaborate on "do not work" > > > > > > Do they get called and raise anerrordo they not get called at all? Is the > > > > > page loading at all? Are you using Firefox? Do you have Firebug? What is > > > > > Firebug telling you about the AJAX request? Do you like cheese on toast? > > > > > What''s the square root of 24... the questions are endless. > > > > > > On Jan 23, 2008 12:07 PM, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > > Hi > > > > > > > I had ajax commenting on my app, which worked perfectly on Rails > > > > > > v1.2.6, but does not work the same in Rails 2.02. Basically the > > > > > > comment gets added, but the visual effects do not work (ie lines 2 + 3 > > > > > > of create.rjs) > > > > > > > create.js > > > > > > page.insert_html :bottom, ''comments'', :partial => ''comment'' > > > > > > page.visual_effect :appear, "comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id> > > > > > > }" > > > > > > page.visual_effect :highlight, "comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}", > > > > > > {:startcolor > > > > > > => ''"#84E003"''} > > > > > > > commentscontroller.rb: > > > > > > def create > > > > > > @comment = Comment.new(params[:comment]) > > > > > > @comment.user = User.find(current_user) > > > > > > @comment.story = Story.find(params[:story_id]) > > > > > > respond_to do |format| > > > > > > if @comment.save > > > > > > format.html { redirect_to story_url(@comment.story) } > > > > > > format.js > > > > > > else > > > > > > format.html { redirect_to story_url(@comment.story) } > > > > > > end > > > > > > end > > > > > > end > > > > > > > I have tried changing to create.js.rjs, but that makes no difference? > > > > > > > Doe anyone have any experience with this in Rails 2.0.2? > > > > > > > PJ. > > > > > > -- > > > > > Ryan Bigghttp://www.frozenplague.net > > > > > Feel free to add me to MSN and/or GTalk as this email.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 15, 9:41 am, John Ivanoff <john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> change > create.js > to > create.js.rjs > > I just did a refresher on rjs for rails 2 > > I wrote up what I changes. I was using Peepcode rjs screencast > my posthttp://johnivanoff.blogspot.com/#2317945271487058293 > > peepcodehttp://peepcode.com/products/rjs-templates > > HTH > john i > > On Feb 14, 3:48 pm, jdhale <jason.d.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Have you found a solution to this. I am having the same problem. > > > I do something like this: > > > page.replace "student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}", :partial => > > "show", :locals => {:rendition => @rendition} > > page.visual_effect :highlight, "student...@student.id}", > > {:endcolor => "''#EAE8D5''", :endcolor => "''#EAE8D5''"} > > > If I comment out the 2nd line the replace works fine. The highlight > > seems to kill any kind of javascript running. > > > On Jan 24, 3:21 am, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > Anyone? > > > > I''ve seen this type of problem a lot on doing a google search...and on > > > this list... > > > > "alert(''RJS error:\n\n'' + e.toString())" > > > > But everyone seems to have different ideas as to what is the problem > > > and some solutions work for some and not for others... > > > > Nothing i''ve tried works... > > > > PJ. > > > > On Jan 23, 4:54 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > Ok i installed Firebug. > > > > > I looked in ''console > response'' > > > > > This is what appears... > > > > > try { > > > > > new Insertion.Bottom("comments", "\u003Cdiv id=\"comment_52\" class> > > > \"comment\"\u003E\n\u003Cp\u003E > > > > > \"praveen\"\u003Cbr /\u003E\n\n\u003Cimg alt=\"Imgp1090_thumb\" id> > > > \"avatar_thumb\" src=\"/avatars/0000 > > > > > /0001/IMGP1090_thumb.JPG?1200983769\" /\u003E\n\n\u003Ca href=\"/users/ > > > > 1\"\u003EPraveen\u003C/a\u003E > > > > > from Australia said this on January 23, 2008 16:48.\u003C/p\u003E\n\n > > > > \u003Ca href=\"#\" onclick=\"if > > > > > (confirm(''Are you sure?'')) { new Ajax.Request(''/comments/52? > > > > story_id=4'', {asynchronous:true, evalScripts > > > > > :true, method:''delete''}); }; return false;\"\u003EDESTROY\u003C/a\u003E > > > > \n\n\u003C/div\u003E\n"); > > > > > new Effect.Appear("comment_52",{}); > > > > > new Effect.Highlight("comment_52",{startcolor:''"#84E003"''}); > > > > > } catch (e) { alert(''RJSerror:\n\n'' + e.toString()); alert(''new > > > > > Insertion.Bottom(\"comments\", \"\\u003Cdiv > > > > > id=\\\"comment_52\\\" class=\\\"comment\\\"\\u003E\\n\\u003Cp\\u003E\\ > > > > \"praveen\\\"\\u003Cbr /\\u003E > > > > > \\n\\n\\u003Cimg alt=\\\"Imgp1090_thumb\\\" id=\\\"avatar_thumb\\\" > > > > src=\\\"/avatars/0000/0001/IMGP1090_thumb > > > > > .JPG?1200983769\\\" /\\u003E\\n\\n\\u003Ca href=\\\"/users/1\\\"\ > > > > \u003EPraveen\\u003C/a\\u003E from Australia > > > > > said this on January 23, 2008 16:48.\\u003C/p\\u003E\\n\\n\\u003Ca > > > > href=\\\"#\\\" onclick=\\\"if (confirm > > > > > (\''Are you sure?\'')) { new Ajax.Request(\''/comments/52?story_id=4\'', > > > > {asynchronous:true, evalScripts > > > > > :true, method:\''delete\''}); }; return false;\\\"\\u003EDESTROY\\u003C/a > > > > \\u003E\\n\\n\\u003C/div\\u003E > > > > > \\n\");\nnew Effect.Appear(\"comment_52\",{});\nnew > > > > Effect.Highlight(\"comment_52\",{startcolor:\''\" > > > > > #84E003\"\''});''); throw e } > > > > > ??? > > > > > PJ > > > > > On Jan 23, 4:34 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > Hi Ryan > > > > > > There are no errors thrown in the console or in Firefox. The comment > > > > > is added, but without the visual effects, as i said.... so i guess > > > > > they do not get called at all.. > > > > > > I will have to install Firebug! > > > > > > It just seems odd to me as it was working perfect on Rails 1.2.6. > > > > > > P. > > > > > > On Jan 23, 3:08 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Elaborate on "do not work" > > > > > > > Do they get called and raise anerrordo they not get called at all? Is the > > > > > > page loading at all? Are you using Firefox? Do you have Firebug? What is > > > > > > Firebug telling you about the AJAX request? Do you like cheese on toast? > > > > > > What''s the square root of 24... the questions are endless. > > > > > > > On Jan 23, 2008 12:07 PM, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > > > Hi > > > > > > > > I had ajax commenting on my app, which worked perfectly on Rails > > > > > > > v1.2.6, but does not work the same in Rails 2.02. Basically the > > > > > > > comment gets added, but the visual effects do not work (ie lines 2 + 3 > > > > > > > of create.rjs) > > > > > > > > create.js > > > > > > > page.insert_html :bottom, ''comments'', :partial => ''comment'' > > > > > > > page.visual_effect :appear, "comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id> > > > > > > > }" > > > > > > > page.visual_effect :highlight, "comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}", > > > > > > > {:startcolor > > > > > > > => ''"#84E003"''} > > > > > > > > commentscontroller.rb: > > > > > > > def create > > > > > > > @comment = Comment.new(params[:comment]) > > > > > > > -I4CJOCdi0N4BB6bauf/WkQ@public.gmane.org = User.find(current_user) > > > > > > > -I4CJOCdi0N7BqD8Ks/GSlw@public.gmane.org = Story.find(params[:story_id]) > > > > > > > respond_to do |format| > > > > > > > if @comment.save > > > > > > > format.html { redirect_to story_url(@comment.story) } > > > > > > > format.js > > > > > > > else > > > > > > > format.html { redirect_to story_url(@comment.story) } > > > > > > > end > > > > > > > end > > > > > > > end > > > > > > > > I have tried changing to create.js.rjs, but that makes no difference? > > > > > > > > Doe anyone have any experience with this in Rails 2.0.2? > > > > > > > > PJ. > > > > > > > -- > > > > > > Ryan Bigghttp://www.frozenplague.net > > > > > > Feel free to add me to MSN and/or GTalk as this email.Do you have a create.rhtml file as well? If you move it to create.html.erb, your problem will go away. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
I think you should have a create.html.erb file incase the user does
not have javascript turned on.
In the controller you have the respond_to
respond_to do |format|
format.js #create.js.rjs
format.html #create.html.erb
end
or a more detailed version . . .
respond_to do |format|
if @task.save
format.html do
flash[:notice] = ''Task was successfully created.''
redirect_to{ (@task)
end
format.js
else
format.html { render :action => "new" }
format.js { render :template => "shared/error.js.rjs" }
end
end
john i
On Feb 15, 9:09 am, Jeremy Mayhew
<jeremy.may...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> On Feb 15, 9:41 am, John Ivanoff
<john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
>
> > change
> > create.js
> > to
> > create.js.rjs
>
> > I just did a refresher on rjs for rails 2
>
> > I wrote up what I changes. I was using Peepcode rjs screencast
> > my posthttp://johnivanoff.blogspot.com/#2317945271487058293
>
> > peepcodehttp://peepcode.com/products/rjs-templates
>
> > HTH
> > john i
>
> > On Feb 14, 3:48 pm, jdhale
<jason.d.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > Have you found a solution to this. I am having the same problem.
>
> > > I do something like this:
>
> > > page.replace
"student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}", :partial =>
> > > "show", :locals => {:rendition => @rendition}
> > > page.visual_effect :highlight,
"student...@student.id}",
> > > {:endcolor => "''#EAE8D5''",
:endcolor => "''#EAE8D5''"}
>
> > > If I comment out the 2nd line the replace works fine. The
highlight
> > > seems to kill any kind of javascript running.
>
> > > On Jan 24, 3:21 am, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > Anyone?
>
> > > > I''ve seen this type of problem a lot on doing a
google search...and on
> > > > this list...
>
> > > > "alert(''RJS error:\n\n'' +
e.toString())"
>
> > > > But everyone seems to have different ideas as to what is the
problem
> > > > and some solutions work for some and not for others...
>
> > > > Nothing i''ve tried works...
>
> > > > PJ.
>
> > > > On Jan 23, 4:54 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > Ok i installed Firebug.
>
> > > > > I looked in ''console > response''
>
> > > > > This is what appears...
>
> > > > > try {
>
> > > > > new Insertion.Bottom("comments",
"\u003Cdiv id=\"comment_52\" class> > > > >
\"comment\"\u003E\n\u003Cp\u003E
>
> > > > > \"praveen\"\u003Cbr /\u003E\n\n\u003Cimg
alt=\"Imgp1090_thumb\" id> > > > >
\"avatar_thumb\" src=\"/avatars/0000
>
> > > > > /0001/IMGP1090_thumb.JPG?1200983769\"
/\u003E\n\n\u003Ca href=\"/users/
> > > > > 1\"\u003EPraveen\u003C/a\u003E
>
> > > > > from Australia said this on January 23, 2008
16:48.\u003C/p\u003E\n\n
> > > > > \u003Ca href=\"#\" onclick=\"if
>
> > > > > (confirm(''Are you sure?'')) { new
Ajax.Request(''/comments/52?
> > > > > story_id=4'', {asynchronous:true, evalScripts
>
> > > > > :true, method:''delete''}); }; return
false;\"\u003EDESTROY\u003C/a\u003E
> > > > > \n\n\u003C/div\u003E\n");
>
> > > > > new Effect.Appear("comment_52",{});
>
> > > > > new
Effect.Highlight("comment_52",{startcolor:''"#84E003"''});
>
> > > > > } catch (e) { alert(''RJSerror:\n\n'' +
e.toString()); alert(''new
>
> > > > > Insertion.Bottom(\"comments\",
\"\\u003Cdiv
>
> > > > > id=\\\"comment_52\\\"
class=\\\"comment\\\"\\u003E\\n\\u003Cp\\u003E\\
> > > > > \"praveen\\\"\\u003Cbr /\\u003E
>
> > > > > \\n\\n\\u003Cimg alt=\\\"Imgp1090_thumb\\\"
id=\\\"avatar_thumb\\\"
> > > > > src=\\\"/avatars/0000/0001/IMGP1090_thumb
>
> > > > > .JPG?1200983769\\\" /\\u003E\\n\\n\\u003Ca
href=\\\"/users/1\\\"\
> > > > > \u003EPraveen\\u003C/a\\u003E from Australia
>
> > > > > said this on January 23, 2008
16:48.\\u003C/p\\u003E\\n\\n\\u003Ca
> > > > > href=\\\"#\\\" onclick=\\\"if (confirm
>
> > > > > (\''Are you sure?\'')) { new
Ajax.Request(\''/comments/52?story_id=4\'',
> > > > > {asynchronous:true, evalScripts
>
> > > > > :true, method:\''delete\''}); }; return
false;\\\"\\u003EDESTROY\\u003C/a
> > > > > \\u003E\\n\\n\\u003C/div\\u003E
>
> > > > > \\n\");\nnew
Effect.Appear(\"comment_52\",{});\nnew
> > > > >
Effect.Highlight(\"comment_52\",{startcolor:\''\"
>
> > > > > #84E003\"\''});''); throw e }
>
> > > > > ???
>
> > > > > PJ
>
> > > > > On Jan 23, 4:34 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > Hi Ryan
>
> > > > > > There are no errors thrown in the console or in
Firefox. The comment
> > > > > > is added, but without the visual effects, as i
said.... so i guess
> > > > > > they do not get called at all..
>
> > > > > > I will have to install Firebug!
>
> > > > > > It just seems odd to me as it was working perfect
on Rails 1.2.6.
>
> > > > > > P.
>
> > > > > > On Jan 23, 3:08 pm, "Ryan Bigg"
<radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > > > > Elaborate on "do not work"
>
> > > > > > > Do they get called and raise anerrordo they
not get called at all? Is the
> > > > > > > page loading at all? Are you using Firefox?
Do you have Firebug? What is
> > > > > > > Firebug telling you about the AJAX request?
Do you like cheese on toast?
> > > > > > > What''s the square root of 24... the
questions are endless.
>
> > > > > > > On Jan 23, 2008 12:07 PM, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > > > Hi
>
> > > > > > > > I had ajax commenting on my app, which
worked perfectly on Rails
> > > > > > > > v1.2.6, but does not work the same in
Rails 2.02. Basically the
> > > > > > > > comment gets added, but the visual
effects do not work (ie lines 2 + 3
> > > > > > > > of create.rjs)
>
> > > > > > > > create.js
> > > > > > > > page.insert_html :bottom,
''comments'', :partial => ''comment''
> > > > > > > > page.visual_effect :appear,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>
> > > > > > > > }"
> > > > > > > > page.visual_effect :highlight,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}",
> > > > > > > > {:startcolor
> > > > > > > > =>
''"#84E003"''}
>
> > > > > > > > commentscontroller.rb:
> > > > > > > > def create
> > > > > > > > @comment =
Comment.new(params[:comment])
> > > > > > > >
-I4CJOCdi0N4BB6bauf/WkQ@public.gmane.org = User.find(current_user)
> > > > > > > >
-I4CJOCdi0N7BqD8Ks/GSlw@public.gmane.org = Story.find(params[:story_id])
> > > > > > > > respond_to do |format|
> > > > > > > > if @comment.save
> > > > > > > > format.html { redirect_to
story_url(@comment.story) }
> > > > > > > > format.js
> > > > > > > > else
> > > > > > > > format.html { redirect_to
story_url(@comment.story) }
> > > > > > > > end
> > > > > > > > end
> > > > > > > > end
>
> > > > > > > > I have tried changing to create.js.rjs,
but that makes no difference?
>
> > > > > > > > Doe anyone have any experience with this
in Rails 2.0.2?
>
> > > > > > > > PJ.
>
> > > > > > > --
> > > > > > > Ryan Bigghttp://www.frozenplague.net
> > > > > > > Feel free to add me to MSN and/or GTalk as
this email.
>
> Do you have a create.rhtml file as well? If you move it to
> create.html.erb, your problem will go away.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@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
-~----------~----~----~----~------~----~------~--~---
Hi there Thanks for tips. I tried these changes and i can get various effects to work eg blind_down, slide_down, pulsate, fade, shake... However the HIGHLIGHT effect does not seem to work, and it does not throw up any errors in the console either! What am i doing wrong with this? Is there a different way to code this? Thanks for the help...:) PJ. On Feb 17, 4:12 am, John Ivanoff <john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I think you should have a create.html.erb file incase the user does > not have javascript turned on. > > In the controller you have the respond_to > > respond_to do |format| > format.js #create.js.rjs > format.html #create.html.erb > end > > or a more detailed version . . . > > respond_to do |format| > if @task.save > format.html do > flash[:notice] = ''Task was successfully created.'' > redirect_to{ (@task) > end > format.js > else > format.html { render :action => "new" } > format.js { render :template => "shared/error.js.rjs" } > end > end > > john i > > On Feb 15, 9:09 am, Jeremy Mayhew <jeremy.may...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Feb 15, 9:41 am, John Ivanoff <john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > change > > > create.js > > > to > > > create.js.rjs > > > > I just did a refresher on rjs for rails 2 > > > > I wrote up what I changes. I was using Peepcode rjs screencast > > > my posthttp://johnivanoff.blogspot.com/#2317945271487058293 > > > > peepcodehttp://peepcode.com/products/rjs-templates > > > > HTH > > > john i > > > > On Feb 14, 3:48 pm, jdhale <jason.d.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Have you found a solution to this. I am having the same problem. > > > > > I do something like this: > > > > > page.replace "student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}", :partial => > > > > "show", :locals => {:rendition => @rendition} > > > > page.visual_effect :highlight, "student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}", > > > > {:endcolor => "''#EAE8D5''", :endcolor => "''#EAE8D5''"} > > > > > If I comment out the 2nd line the replace works fine. The highlight > > > > seems to kill any kind of javascript running. > > > > > On Jan 24, 3:21 am, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > Anyone? > > > > > > I''ve seen this type of problem a lot on doing a google search...and on > > > > > this list... > > > > > > "alert(''RJS error:\n\n'' + e.toString())" > > > > > > But everyone seems to have different ideas as to what is the problem > > > > > and some solutions work for some and not for others... > > > > > > Nothing i''ve tried works... > > > > > > PJ. > > > > > > On Jan 23, 4:54 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > > Ok i installed Firebug. > > > > > > > I looked in ''console > response'' > > > > > > > This is what appears... > > > > > > > try { > > > > > > > new Insertion.Bottom("comments", "\u003Cdiv id=\"comment_52\" class> > > > > > \"comment\"\u003E\n\u003Cp\u003E > > > > > > > \"praveen\"\u003Cbr /\u003E\n\n\u003Cimg alt=\"Imgp1090_thumb\" id> > > > > > \"avatar_thumb\" src=\"/avatars/0000 > > > > > > > /0001/IMGP1090_thumb.JPG?1200983769\" /\u003E\n\n\u003Ca href=\"/users/ > > > > > > 1\"\u003EPraveen\u003C/a\u003E > > > > > > > from Australia said this on January 23, 2008 16:48.\u003C/p\u003E\n\n > > > > > > \u003Ca href=\"#\" onclick=\"if > > > > > > > (confirm(''Are you sure?'')) { new Ajax.Request(''/comments/52? > > > > > > story_id=4'', {asynchronous:true, evalScripts > > > > > > > :true, method:''delete''}); }; return false;\"\u003EDESTROY\u003C/a\u003E > > > > > > \n\n\u003C/div\u003E\n"); > > > > > > > new Effect.Appear("comment_52",{}); > > > > > > > new Effect.Highlight("comment_52",{startcolor:''"#84E003"''}); > > > > > > > } catch (e) { alert(''RJSerror:\n\n'' + e.toString()); alert(''new > > > > > > > Insertion.Bottom(\"comments\", \"\\u003Cdiv > > > > > > > id=\\\"comment_52\\\" class=\\\"comment\\\"\\u003E\\n\\u003Cp\\u003E\\ > > > > > > \"praveen\\\"\\u003Cbr /\\u003E > > > > > > > \\n\\n\\u003Cimg alt=\\\"Imgp1090_thumb\\\" id=\\\"avatar_thumb\\\" > > > > > > src=\\\"/avatars/0000/0001/IMGP1090_thumb > > > > > > > .JPG?1200983769\\\" /\\u003E\\n\\n\\u003Ca href=\\\"/users/1\\\"\ > > > > > > \u003EPraveen\\u003C/a\\u003E from Australia > > > > > > > said this on January 23, 2008 16:48.\\u003C/p\\u003E\\n\\n\\u003Ca > > > > > > href=\\\"#\\\" onclick=\\\"if (confirm > > > > > > > (\''Are you sure?\'')) { new Ajax.Request(\''/comments/52?story_id=4\'', > > > > > > {asynchronous:true, evalScripts > > > > > > > :true, method:\''delete\''}); }; return false;\\\"\\u003EDESTROY\\u003C/a > > > > > > \\u003E\\n\\n\\u003C/div\\u003E > > > > > > > \\n\");\nnew Effect.Appear(\"comment_52\",{});\nnew > > > > > > Effect.Highlight(\"comment_52\",{startcolor:\''\" > > > > > > > #84E003\"\''});''); throw e } > > > > > > > ??? > > > > > > > PJ > > > > > > > On Jan 23, 4:34 pm, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > > > Hi Ryan > > > > > > > > There are no errors thrown in the console or in Firefox. The comment > > > > > > > is added, but without the visual effects, as i said.... so i guess > > > > > > > they do not get called at all.. > > > > > > > > I will have to install Firebug! > > > > > > > > It just seems odd to me as it was working perfect on Rails 1.2.6. > > > > > > > > P. > > > > > > > > On Jan 23, 3:08 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Elaborate on "do not work" > > > > > > > > > Do they get called and raise anerrordo they not get called at all? Is the > > > > > > > > page loading at all? Are you using Firefox? Do you have Firebug? What is > > > > > > > > Firebug telling you about the AJAX request? Do you like cheese on toast? > > > > > > > > What''s the square root of 24... the questions are endless. > > > > > > > > > On Jan 23, 2008 12:07 PM, PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > > > > > Hi > > > > > > > > > > I had ajax commenting on my app, which worked perfectly on Rails > > > > > > > > > v1.2.6, but does not work the same in Rails 2.02. Basically the > > > > > > > > > comment gets added, but the visual effects do not work (ie lines 2 + 3 > > > > > > > > > of create.rjs) > > > > > > > > > > create.js > > > > > > > > > page.insert_html :bottom, ''comments'', :partial => ''comment'' > > > > > > > > > page.visual_effect :appear, "comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id> > > > > > > > > > }" > > > > > > > > > page.visual_effect :highlight, "comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}", > > > > > > > > > {:startcolor > > > > > > > > > => ''"#84E003"''} > > > > > > > > > > commentscontroller.rb: > > > > > > > > > def create > > > > > > > > > @comment = Comment.new(params[:comment]) > > > > > > > > > @comment.user = User.find(current_user) > > > > > > > > > @comment.story = Story.find(params[:story_id]) > > > > > > > > > respond_to do |format| > > > > > > > > > if @comment.save > > > > > > > > > format.html { redirect_to story_url(@comment.story) } > > > > > > > > > format.js > > > > > > > > > else > > > > > > > > > format.html { redirect_to story_url(@comment.story) } > > > > > > > > > end > > > > > > > > > end > > > > > > > > > end > > > > > > > > > > I have tried changing to create.js.rjs, but that makes no difference? > > > > > > > > > > Doe anyone have any experience with this in Rails 2.0.2? > > > > > > > > > > PJ. > > > > > > > > > -- > > > > > > > > Ryan Bigghttp://www.frozenplague.net > > > > > > > > Feel free to add me to MSN and/or GTalk as this email. > > > Do you have a create.rhtml file as well? If you move it to > > create.html.erb, your problem will go away.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
For my Highlighting I am using this code
(in the js.rjs file)
page.insert_html :bottom, ''tasks'', :partial => @task #
adds new
task into the partial
page[''task_form''].reset
#
resets the form
page.visual_effect :highlight, "task_#{@task.id}", #
highlights the just added div that has the new task
:startcolor => ''#336699''
I use a partial in my index.html.erb view.
<div id="tasks">
<%= render :partial => @tasks %>
</div>
_task.html.erb file
<% div_for task do %>
<%= h(task.name) %>
<% end %>
the div_for task do gives the div an id = to task_1 (or what ever the
id of the task is.)
Example:
I have one task that has an id of 1
I add a new task. It gets an id of 2
In the rjs
1) It adds a new div, with an id = task_2, into the div on the index
view that has the id of "tasks".
2) It clears the form with the reset.
3) highlight the task_2
my form view
<% remote_form_for(:task, :url => tasks_path, :html => {:id =>
"task_form"}) do |f| %>
<p>
<b>Name</b><br />
<%= f.text_field :name %>
</p>
<p>
<b>Value</b><br />
<%= f.text_field :value %>
</p>
<p>
<%= f.submit "Create" %>
</p>
<% end %>
hth
On Feb 16, 6:40 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
wrote:> Hi there
>
> Thanks for tips.
>
> I tried these changes and i can get various effects to work eg
> blind_down, slide_down, pulsate, fade, shake...
>
> However the HIGHLIGHT effect does not seem to work, and it does not
> throw up any errors in the console either!
>
> What am i doing wrong with this? Is there a different way to code
> this?
>
> Thanks for the help...:)
>
> PJ.
>
> On Feb 17, 4:12 am, John Ivanoff
<john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > I think you should have a create.html.erb file incase the user does
> > not have javascript turned on.
>
> > In the controller you have the respond_to
>
> > respond_to do |format|
> > format.js #create.js.rjs
> > format.html #create.html.erb
> > end
>
> > or a more detailed version . . .
>
> > respond_to do |format|
> > if @task.save
> > format.html do
> > flash[:notice] = ''Task was successfully
created.''
> > redirect_to{ (@task)
> > end
> > format.js
> > else
> > format.html { render :action => "new" }
> > format.js { render :template =>
"shared/error.js.rjs" }
> > end
> > end
>
> > john i
>
> > On Feb 15, 9:09 am, Jeremy Mayhew
<jeremy.may...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > On Feb 15, 9:41 am, John Ivanoff
<john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > change
> > > > create.js
> > > > to
> > > > create.js.rjs
>
> > > > I just did a refresher on rjs for rails 2
>
> > > > I wrote up what I changes. I was using Peepcode rjs
screencast
> > > > my posthttp://johnivanoff.blogspot.com/#2317945271487058293
>
> > > > peepcodehttp://peepcode.com/products/rjs-templates
>
> > > > HTH
> > > > john i
>
> > > > On Feb 14, 3:48 pm, jdhale
<jason.d.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > > Have you found a solution to this. I am having the
same problem.
>
> > > > > I do something like this:
>
> > > > > page.replace
"student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}", :partial =>
> > > > > "show", :locals => {:rendition =>
@rendition}
> > > > > page.visual_effect :highlight,
"student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}",
> > > > > {:endcolor =>
"''#EAE8D5''", :endcolor =>
"''#EAE8D5''"}
>
> > > > > If I comment out the 2nd line the replace works fine.
The highlight
> > > > > seems to kill any kind of javascript running.
>
> > > > > On Jan 24, 3:21 am, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > Anyone?
>
> > > > > > I''ve seen this type of problem a lot on
doing a google search...and on
> > > > > > this list...
>
> > > > > > "alert(''RJS error:\n\n'' +
e.toString())"
>
> > > > > > But everyone seems to have different ideas as to
what is the problem
> > > > > > and some solutions work for some and not for
others...
>
> > > > > > Nothing i''ve tried works...
>
> > > > > > PJ.
>
> > > > > > On Jan 23, 4:54 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > > Ok i installed Firebug.
>
> > > > > > > I looked in ''console >
response''
>
> > > > > > > This is what appears...
>
> > > > > > > try {
>
> > > > > > > new Insertion.Bottom("comments",
"\u003Cdiv id=\"comment_52\" class> > > > > >
> \"comment\"\u003E\n\u003Cp\u003E
>
> > > > > > > \"praveen\"\u003Cbr
/\u003E\n\n\u003Cimg alt=\"Imgp1090_thumb\" id> > > > >
> > \"avatar_thumb\" src=\"/avatars/0000
>
> > > > > > > /0001/IMGP1090_thumb.JPG?1200983769\"
/\u003E\n\n\u003Ca href=\"/users/
> > > > > > > 1\"\u003EPraveen\u003C/a\u003E
>
> > > > > > > from Australia said this on January 23, 2008
16:48.\u003C/p\u003E\n\n
> > > > > > > \u003Ca href=\"#\"
onclick=\"if
>
> > > > > > > (confirm(''Are you sure?''))
{ new Ajax.Request(''/comments/52?
> > > > > > > story_id=4'', {asynchronous:true,
evalScripts
>
> > > > > > > :true, method:''delete''});
}; return false;\"\u003EDESTROY\u003C/a\u003E
> > > > > > > \n\n\u003C/div\u003E\n");
>
> > > > > > > new Effect.Appear("comment_52",{});
>
> > > > > > > new
Effect.Highlight("comment_52",{startcolor:''"#84E003"''});
>
> > > > > > > } catch (e) {
alert(''RJSerror:\n\n'' + e.toString()); alert(''new
>
> > > > > > > Insertion.Bottom(\"comments\",
\"\\u003Cdiv
>
> > > > > > > id=\\\"comment_52\\\"
class=\\\"comment\\\"\\u003E\\n\\u003Cp\\u003E\\
> > > > > > > \"praveen\\\"\\u003Cbr /\\u003E
>
> > > > > > > \\n\\n\\u003Cimg
alt=\\\"Imgp1090_thumb\\\" id=\\\"avatar_thumb\\\"
> > > > > > >
src=\\\"/avatars/0000/0001/IMGP1090_thumb
>
> > > > > > > .JPG?1200983769\\\"
/\\u003E\\n\\n\\u003Ca href=\\\"/users/1\\\"\
> > > > > > > \u003EPraveen\\u003C/a\\u003E from Australia
>
> > > > > > > said this on January 23, 2008
16:48.\\u003C/p\\u003E\\n\\n\\u003Ca
> > > > > > > href=\\\"#\\\" onclick=\\\"if
(confirm
>
> > > > > > > (\''Are you sure?\'')) { new
Ajax.Request(\''/comments/52?story_id=4\'',
> > > > > > > {asynchronous:true, evalScripts
>
> > > > > > > :true, method:\''delete\''});
}; return false;\\\"\\u003EDESTROY\\u003C/a
> > > > > > > \\u003E\\n\\n\\u003C/div\\u003E
>
> > > > > > > \\n\");\nnew
Effect.Appear(\"comment_52\",{});\nnew
> > > > > > >
Effect.Highlight(\"comment_52\",{startcolor:\''\"
>
> > > > > > > #84E003\"\''});'');
throw e }
>
> > > > > > > ???
>
> > > > > > > PJ
>
> > > > > > > On Jan 23, 4:34 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > > > Hi Ryan
>
> > > > > > > > There are no errors thrown in the
console or in Firefox. The comment
> > > > > > > > is added, but without the visual
effects, as i said.... so i guess
> > > > > > > > they do not get called at all..
>
> > > > > > > > I will have to install Firebug!
>
> > > > > > > > It just seems odd to me as it was
working perfect on Rails 1.2.6.
>
> > > > > > > > P.
>
> > > > > > > > On Jan 23, 3:08 pm, "Ryan
Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > > > > > > Elaborate on "do not
work"
>
> > > > > > > > > Do they get called and raise
anerrordo they not get called at all? Is the
> > > > > > > > > page loading at all? Are you using
Firefox? Do you have Firebug? What is
> > > > > > > > > Firebug telling you about the AJAX
request? Do you like cheese on toast?
> > > > > > > > > What''s the square root of
24... the questions are endless.
>
> > > > > > > > > On Jan 23, 2008 12:07 PM, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > > > > > Hi
>
> > > > > > > > > > I had ajax commenting on my
app, which worked perfectly on Rails
> > > > > > > > > > v1.2.6, but does not work the
same in Rails 2.02. Basically the
> > > > > > > > > > comment gets added, but the
visual effects do not work (ie lines 2 + 3
> > > > > > > > > > of create.rjs)
>
> > > > > > > > > > create.js
> > > > > > > > > > page.insert_html :bottom,
''comments'', :partial => ''comment''
> > > > > > > > > > page.visual_effect :appear,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>
> > > > > > > > > > }"
> > > > > > > > > > page.visual_effect :highlight,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}",
> > > > > > > > > > {:startcolor
> > > > > > > > > > =>
''"#84E003"''}
>
> > > > > > > > > > commentscontroller.rb:
> > > > > > > > > > def create
> > > > > > > > > > @comment =
Comment.new(params[:comment])
> > > > > > > > > > @comment.user =
User.find(current_user)
> > > > > > > > > > @comment.story =
Story.find(params[:story_id])
> > > > > > > > > > respond_to do |format|
> > > > > > > > > > if @comment.save
> > > > > > > > > > format.html { redirect_to
story_url(@comment.story) }
> > > > > > > > > > format.js
> > > > > > > > > > else
> > > > > > > > > > format.html { redirect_to
story_url(@comment.story) }
> > > > > > > > > > end
> > > > > > > > > > end
> > > > > > > > > > end
>
> > > > > > > > > > I have tried changing to
create.js.rjs, but that makes no difference?
>
> > > > > > > > > > Doe anyone have any experience
with this in Rails 2.0.2?
>
> > > > > > > > > > PJ.
>
> > > > > > > > > --
> > > > > > > > > Ryan
Bigghttp://www.frozenplague.net
> > > > > > > > > Feel free to add me to MSN and/or
GTalk as this email.
>
> > > Do you have a create.rhtml file as well? If you move it to
> > > create.html.erb, your problem will go away.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
I''m having the same problems, except I can''t even seem to get
any of
the effects to work or calls like ''page.call :my_function''.
I''ve got
an index.html.erb file, and an index.hs.rjs file. The js.rjs file just
has:
page.visual_effect :highlight, "my_div"
and my controller has:
respond_to do |format|
format.js { render :template => "index.js.rjs" }
end
But whatever I do I can''t seem to make this work. It always complains
with the try/catch error that has something like "alert(''RJS
error:\n
\n'' + e.toString())". I''ve also tried changing the
page.visual_effect
to a page.call, and I cant make this work either. Any ideas?
Why the hell did this change in rails 2.0 anyway, what was wrong with
the way it worked, where you could just do:
render :update do |page|
page.call :alert, "Im js"
end
And not have to worry about creating a stupid js.rjs file.
On Feb 16, 8:38 pm, John Ivanoff
<john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> For my Highlighting I am using this code
>
> (in the js.rjs file)
> page.insert_html :bottom, ''tasks'', :partial => @task
# adds new
> task into the partial
> page[''task_form''].reset
#
> resets the form
> page.visual_effect :highlight,
"task...-mWU5Wp1MBnA@public.gmane.org}", #
> highlights the just added div that has the new task
> :startcolor => ''#336699''
>
> I use a partial in my index.html.erb view.
> <div id="tasks">
> <%= render :partial => @tasks %>
> </div>
>
> _task.html.erb file
> <% div_for task do %>
> <%= h(task.name) %>
> <% end %>
>
> the div_for task do gives the div an id = to task_1 (or what ever the
> id of the task is.)
> Example:
> I have one task that has an id of 1
> I add a new task. It gets an id of 2
>
> In the rjs
> 1) It adds a new div, with an id = task_2, into the div on the index
> view that has the id of "tasks".
> 2) It clears the form with the reset.
> 3) highlight the task_2
>
> my form view
>
> <% remote_form_for(:task, :url => tasks_path, :html => {:id =>
> "task_form"}) do |f| %>
> <p>
> <b>Name</b><br />
> <%= f.text_field :name %>
> </p>
> <p>
> <b>Value</b><br />
> <%= f.text_field :value %>
> </p>
> <p>
> <%= f.submit "Create" %>
> </p>
> <% end %>
>
> hth
>
> On Feb 16, 6:40 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > Hi there
>
> > Thanks for tips.
>
> > I tried these changes and i can get various effects to work eg
> > blind_down, slide_down, pulsate, fade, shake...
>
> > However the HIGHLIGHT effect does not seem to work, and it does not
> > throw up any errors in the console either!
>
> > What am i doing wrong with this? Is there a different way to code
> > this?
>
> > Thanks for the help...:)
>
> > PJ.
>
> > On Feb 17, 4:12 am, John Ivanoff
<john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > I think you should have a create.html.erb file incase the user
does
> > > not have javascript turned on.
>
> > > In the controller you have the respond_to
>
> > > respond_to do |format|
> > > format.js #create.js.rjs
> > > format.html #create.html.erb
> > > end
>
> > > or a more detailed version . . .
>
> > > respond_to do |format|
> > > if @task.save
> > > format.html do
> > > flash[:notice] = ''Task was successfully
created.''
> > > redirect_to{ (@task)
> > > end
> > > format.js
> > > else
> > > format.html { render :action => "new" }
> > > format.js { render :template =>
"shared/error.js.rjs" }
> > > end
> > > end
>
> > > john i
>
> > > On Feb 15, 9:09 am, Jeremy Mayhew
<jeremy.may...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > On Feb 15, 9:41 am, John Ivanoff
<john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > > change
> > > > > create.js
> > > > > to
> > > > > create.js.rjs
>
> > > > > I just did a refresher on rjs for rails 2
>
> > > > > I wrote up what I changes. I was using Peepcode rjs
screencast
> > > > > my
posthttp://johnivanoff.blogspot.com/#2317945271487058293
>
> > > > > peepcodehttp://peepcode.com/products/rjs-templates
>
> > > > > HTH
> > > > > john i
>
> > > > > On Feb 14, 3:48 pm, jdhale
<jason.d.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > > > Have you found a solution to this. I am having
the same problem.
>
> > > > > > I do something like this:
>
> > > > > > page.replace
"student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}", :partial =>
> > > > > > "show", :locals => {:rendition =>
@rendition}
> > > > > > page.visual_effect:highlight,
"student...-oe7qfRrRQfe8rHFcjEY/OA@public.gmane.org}",
> > > > > > {:endcolor =>
"''#EAE8D5''", :endcolor =>
"''#EAE8D5''"}
>
> > > > > > If I comment out the 2nd line the replace works
fine. The highlight
> > > > > > seems to kill any kind of javascript running.
>
> > > > > > On Jan 24, 3:21 am, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > > Anyone?
>
> > > > > > > I''ve seen this type of problem a lot
on doing a google search...and on
> > > > > > > this list...
>
> > > > > > > "alert(''RJS
error:\n\n'' + e.toString())"
>
> > > > > > > But everyone seems to have different ideas as
to what is the problem
> > > > > > > and some solutions work for some and not for
others...
>
> > > > > > > Nothing i''ve tried works...
>
> > > > > > > PJ.
>
> > > > > > > On Jan 23, 4:54 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > > > Ok i installed Firebug.
>
> > > > > > > > I looked in ''console >
response''
>
> > > > > > > > This is what appears...
>
> > > > > > > > try {
>
> > > > > > > > new
Insertion.Bottom("comments", "\u003Cdiv
id=\"comment_52\" class> > > > > > > >
\"comment\"\u003E\n\u003Cp\u003E
>
> > > > > > > > \"praveen\"\u003Cbr
/\u003E\n\n\u003Cimg alt=\"Imgp1090_thumb\" id> > > > >
> > > \"avatar_thumb\" src=\"/avatars/0000
>
> > > > > > > >
/0001/IMGP1090_thumb.JPG?1200983769\" /\u003E\n\n\u003Ca
href=\"/users/
> > > > > > > > 1\"\u003EPraveen\u003C/a\u003E
>
> > > > > > > > from Australia said this on January 23,
2008 16:48.\u003C/p\u003E\n\n
> > > > > > > > \u003Ca href=\"#\"
onclick=\"if
>
> > > > > > > > (confirm(''Are you
sure?'')) { new Ajax.Request(''/comments/52?
> > > > > > > > story_id=4'',
{asynchronous:true, evalScripts
>
> > > > > > > > :true,
method:''delete''}); }; return
false;\"\u003EDESTROY\u003C/a\u003E
> > > > > > > > \n\n\u003C/div\u003E\n");
>
> > > > > > > > new
Effect.Appear("comment_52",{});
>
> > > > > > > > new
Effect.Highlight("comment_52",{startcolor:''"#84E003"''});
>
> > > > > > > > } catch (e) {
alert(''RJSerror:\n\n'' + e.toString()); alert(''new
>
> > > > > > > > Insertion.Bottom(\"comments\",
\"\\u003Cdiv
>
> > > > > > > > id=\\\"comment_52\\\"
class=\\\"comment\\\"\\u003E\\n\\u003Cp\\u003E\\
> > > > > > > > \"praveen\\\"\\u003Cbr
/\\u003E
>
> > > > > > > > \\n\\n\\u003Cimg
alt=\\\"Imgp1090_thumb\\\" id=\\\"avatar_thumb\\\"
> > > > > > > >
src=\\\"/avatars/0000/0001/IMGP1090_thumb
>
> > > > > > > > .JPG?1200983769\\\"
/\\u003E\\n\\n\\u003Ca href=\\\"/users/1\\\"\
> > > > > > > > \u003EPraveen\\u003C/a\\u003E from
Australia
>
> > > > > > > > said this on January 23, 2008
16:48.\\u003C/p\\u003E\\n\\n\\u003Ca
> > > > > > > > href=\\\"#\\\"
onclick=\\\"if (confirm
>
> > > > > > > > (\''Are you sure?\'')) {
new Ajax.Request(\''/comments/52?story_id=4\'',
> > > > > > > > {asynchronous:true, evalScripts
>
> > > > > > > > :true,
method:\''delete\''}); }; return
false;\\\"\\u003EDESTROY\\u003C/a
> > > > > > > > \\u003E\\n\\n\\u003C/div\\u003E
>
> > > > > > > > \\n\");\nnew
Effect.Appear(\"comment_52\",{});\nnew
> > > > > > > >
Effect.Highlight(\"comment_52\",{startcolor:\''\"
>
> > > > > > > > #84E003\"\''});'');
throw e }
>
> > > > > > > > ???
>
> > > > > > > > PJ
>
> > > > > > > > On Jan 23, 4:34 pm, PJAY79
<pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > > > > Hi Ryan
>
> > > > > > > > > There are no errors thrown in the
console or in Firefox. The comment
> > > > > > > > > is added, but without the visual
effects, as i said.... so i guess
> > > > > > > > > they do not get called at all..
>
> > > > > > > > > I will have to install Firebug!
>
> > > > > > > > > It just seems odd to me as it was
working perfect on Rails 1.2.6.
>
> > > > > > > > > P.
>
> > > > > > > > > On Jan 23, 3:08 pm, "Ryan
Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > > > > > > > Elaborate on "do not
work"
>
> > > > > > > > > > Do they get called and raise
anerrordo they not get called at all? Is the
> > > > > > > > > > page loading at all? Are you
using Firefox? Do you have Firebug? What is
> > > > > > > > > > Firebug telling you about the
AJAX request? Do you like cheese on toast?
> > > > > > > > > > What''s the square
root of 24... the questions are endless.
>
> > > > > > > > > > On Jan 23, 2008 12:07 PM,
PJAY79 <pjay1...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> > > > > > > > > > > Hi
>
> > > > > > > > > > > I had ajax commenting on
my app, which worked perfectly on Rails
> > > > > > > > > > > v1.2.6, but does not work
the same in Rails 2.02. Basically the
> > > > > > > > > > > comment gets added, but
the visual effects do not work (ie lines 2 + 3
> > > > > > > > > > > of create.rjs)
>
> > > > > > > > > > > create.js
> > > > > > > > > > > page.insert_html :bottom,
''comments'', :partial => ''comment''
> > > > > > > > > > >
page.visual_effect:appear,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>
> > > > > > > > > > > }"
> > > > > > > > > > >
page.visual_effect:highlight,
"comment...-I4CJOCdi0N68rHFcjEY/OA@public.gmane.org<comment_#...@comment.id>}",
> > > > > > > > > > > {:startcolor
> > > > > > > > > > > =>
''"#84E003"''}
>
> > > > > > > > > > > commentscontroller.rb:
> > > > > > > > > > > def create
> > > > > > > > > > > @comment =
Comment.new(params[:comment])
> > > > > > > > > > > @comment.user =
User.find(current_user)
> > > > > > > > > > > @comment.story =
Story.find(params[:story_id])
> > > > > > > > > > > respond_to do
|format|
> > > > > > > > > > > if @comment.save
> > > > > > > > > > > format.html {
redirect_to story_url(@comment.story) }
> > > > > > > > > > > format.js
> > > > > > > > > > > else
> > > > > > > > > > > format.html {
redirect_to story_url(@comment.story) }
> > > > > > > > > > > end
> > > > > > > > > > > end
> > > > > > > > > > > end
>
> > > > > > > > > > > I have tried changing to
create.js.rjs, but that makes no difference?
>
> > > > > > > > > > > Doe anyone have any
experience with this in Rails2.0.2?
>
> > > > > > > > > > > PJ.
>
> > > > > > > > > > --
> > > > > > > > > > Ryan
Bigghttp://www.frozenplague.net
> > > > > > > > > > Feel free to add me to MSN
and/or GTalk as this email.
>
> > > > Do you have a create.rhtml file as well? If you move it to
> > > > create.html.erb, your problem will go away.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---