Hallo -- I''ve just installed the latest stable version of rails, and am following the rails recipies book''s first recipie -- using in_place_editor_field. My problem is that the code throws no error, but the resulting fields are not editable -- the values just come up as text, rather than clickable-then-editable fields. Can anyone help shed any light on why this might be the case? Cheers, doug. -- Posted via http://www.ruby-forum.com/.
Make sure you have <%= javascript_include_tag :defaults %> in your page/layout''s head. Pat On 3/14/06, doug livesey <biot023@gmail.com> wrote:> Hallo -- I''ve just installed the latest stable version of rails, and am > following the rails recipies book''s first recipie -- using > in_place_editor_field. > My problem is that the code throws no error, but the resulting fields > are not editable -- the values just come up as text, rather than > clickable-then-editable fields. > Can anyone help shed any light on why this might be the case? > Cheers, > doug. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
doug livesey
2006-Mar-14 20:16 UTC
[Rails] Re: in_place_editor_field -- values not clickable
Pat Maddox wrote:> Make sure you have > <%= javascript_include_tag :defaults %> > > in your page/layout''s head. > > PatYeah, that''s definately there. The layout is called ''contacts.rhtml'' and looks like this: <html> <head> <title>Contacts: <%= controller.action_name %></title> <%= stylesheet_link_tag ''scaffold'' %> <%= javascript_include_tag :defaults %> </head> <body> <p style="color: green"><%= flash[:notice] %></p> <%= @content_for_layout %> </body> </html> And the page is called ''show.rhtml'' and is like this: in Contact.content_columns %> <p> <b><%= column.human_name %>:</b> <%= in_place_editor_field :contact, column.name %> </p> <% end %> <%= link_to ''Back'', :action => ''list'' %> When they render, there''s javascript stuff in there, but it''s not doing what it''s supposed to -- for reference, a look at the source of one of the fields is: <p> <b>Name:</b> <span class="in_place_editor_field" id="contact_name_1_in_place_editor">Fat Mary</span><script type="text/javascript"> //<![CDATA[ new Ajax.InPlaceEditor(''contact_name_1_in_place_editor'', ''/contacts/set_contact_name/1'') //]]> </script> </p> I''m no js guru, but it *looks* like it should be ok! -- Posted via http://www.ruby-forum.com/.
Pat Maddox
2006-Mar-14 20:21 UTC
[Rails] Re: in_place_editor_field -- values not clickable
On 3/14/06, doug livesey <biot023@gmail.com> wrote:> Pat Maddox wrote: > > Make sure you have > > <%= javascript_include_tag :defaults %> > > > > in your page/layout''s head. > > > > Pat > > Yeah, that''s definately there. The layout is called ''contacts.rhtml'' and > looks like this: > > <html> > <head> > <title>Contacts: <%= controller.action_name %></title> > <%= stylesheet_link_tag ''scaffold'' %> > <%= javascript_include_tag :defaults %> > </head> > <body> > <p style="color: green"><%= flash[:notice] %></p> > <%= @content_for_layout %> > </body> > </html> > > And the page is called ''show.rhtml'' and is like this: > > in Contact.content_columns %> > <p> > <b><%= column.human_name %>:</b> > <%= in_place_editor_field :contact, column.name %> > </p> > <% end %> > <%= link_to ''Back'', :action => ''list'' %> > > > When they render, there''s javascript stuff in there, but it''s not doing > what it''s supposed to -- for reference, a look at the source of one of > the fields is: > > <p> > <b>Name:</b> > <span class="in_place_editor_field" > id="contact_name_1_in_place_editor">Fat Mary</span><script > type="text/javascript"> > //<![CDATA[ > new Ajax.InPlaceEditor(''contact_name_1_in_place_editor'', > ''/contacts/set_contact_name/1'') > //]]> > </script> > </p> > > I''m no js guru, but it *looks* like it should be ok! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Offhand, the js looks fine. Open the javascript console in Firefox, clear any errors (you''ll have a gazillion if you use gmail), and then reload the page. If there are any errors it will tell you immediately..if not, try clicking it and see if any errors come up. If there are still no errors and it still doesn''t work, it''s probably your js settings. Pat
doug livesey
2006-Mar-14 20:33 UTC
[Rails] Re: Re: in_place_editor_field -- values not clickable
> Offhand, the js looks fine. Open the javascript console in Firefox, > clear any errors (you''ll have a gazillion if you use gmail), and then > reload the page. If there are any errors it will tell you > immediately..if not, try clicking it and see if any errors come up. > If there are still no errors and it still doesn''t work, it''s probably > your js settings. > > PatI suspect I might be getting a big ''ah-ha!'' here, but I''m using IE6. Should I not expect the AJAX stuff to work with IE, or even other browsers that perhaps happen to have been to gmail? Also, I''ve been looking in IE & not finding much about js help -- is this a Firefox feature? Should I have firefox? I''m on an XP laptop. -- Posted via http://www.ruby-forum.com/.
doug livesey
2006-Mar-14 20:49 UTC
[Rails] Re: Re: in_place_editor_field -- values not clickable
> I suspect I might be getting a big ''ah-ha!'' here, but I''m using IE6. > Should I not expect the AJAX stuff to work with IE, or even other > browsers that perhaps happen to have been to gmail? > Also, I''ve been looking in IE & not finding much about js help -- is > this a Firefox feature? Should I have firefox? I''m on an XP laptop.Well, I just downloaded Firefox, and have been rather delighted so far! What it is telling me in the JavaScript console is this: Error: Ajax.InPlaceEditor is not a constructor Source File: http://localhost:3000/contacts/show/1 Line: 19 Unfortunately, I have no idea how to recify it, as I am simply following a recipie in the hope of learing Ruby AJAX. Does this suggest anything to you? (& thanks very much for pointing me towards Firefox -- I reckon it could well turn out to be an invalueable debugging tool!) doug. -- Posted via http://www.ruby-forum.com/.
Pat Maddox
2006-Mar-14 20:50 UTC
[Rails] Re: Re: in_place_editor_field -- values not clickable
On 3/14/06, doug livesey <biot023@gmail.com> wrote:> > Offhand, the js looks fine. Open the javascript console in Firefox, > > clear any errors (you''ll have a gazillion if you use gmail), and then > > reload the page. If there are any errors it will tell you > > immediately..if not, try clicking it and see if any errors come up. > > If there are still no errors and it still doesn''t work, it''s probably > > your js settings. > > > > Pat > > I suspect I might be getting a big ''ah-ha!'' here, but I''m using IE6. > Should I not expect the AJAX stuff to work with IE, or even other > browsers that perhaps happen to have been to gmail? > Also, I''ve been looking in IE & not finding much about js help -- is > this a Firefox feature? Should I have firefox? I''m on an XP laptop. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >I think you should expect the js stuff to work..it''s pretty simple js, and it''d be pretty pointless if the helpers generated code that doesn''t work for the majority of users. Is IE 6 the standard version, or the early release (shows how much I use it :). I''d recommend installing Firefox just because it has great standards support, and is nice for development - it''s got a lot of dev-friendly features built in. Install firefox, load up the js console to diagnose any errors..and if it works fine in Firefox, see if you can find a js console in IE and diagnose it there. Using Firefox to begin with though will help you narrow the problem. Pat
Pat Maddox
2006-Mar-14 20:56 UTC
[Rails] Re: Re: in_place_editor_field -- values not clickable
On 3/14/06, doug livesey <biot023@gmail.com> wrote:> > I suspect I might be getting a big ''ah-ha!'' here, but I''m using IE6. > > Should I not expect the AJAX stuff to work with IE, or even other > > browsers that perhaps happen to have been to gmail? > > Also, I''ve been looking in IE & not finding much about js help -- is > > this a Firefox feature? Should I have firefox? I''m on an XP laptop. > > Well, I just downloaded Firefox, and have been rather delighted so far! > What it is telling me in the JavaScript console is this: > > Error: Ajax.InPlaceEditor is not a constructor > Source File: http://localhost:3000/contacts/show/1 > Line: 19 > > Unfortunately, I have no idea how to recify it, as I am simply following > a recipie in the hope of learing Ruby AJAX. > Does this suggest anything to you? > (& thanks very much for pointing me towards Firefox -- I reckon it could > well turn out to be an invalueable debugging tool!) > doug. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >hrm..do you have the latest javascripts installed? Maybe you''re trying to do this on an old application. Do rake update_javascripts to..update the javascripts :) That''s probably not it, since my guess is you''re running Rails 1.0 on a brand new app. If that''s the case, then I really don''t know what the problem is. Pat
doug livesey
2006-Mar-14 20:58 UTC
[Rails] Re: Re: Re: in_place_editor_field -- values not clickable
Pat Maddox wrote:> On 3/14/06, doug livesey <biot023@gmail.com> wrote: >> Should I not expect the AJAX stuff to work with IE, or even other >> > I think you should expect the js stuff to work..it''s pretty simple js, > and it''d be pretty pointless if the helpers generated code that > doesn''t work for the majority of users. Is IE 6 the standard version, > or the early release (shows how much I use it :). I''d recommend > installing Firefox just because it has great standards support, and is > nice for development - it''s got a lot of dev-friendly features built > in. Install firefox, load up the js console to diagnose any > errors..and if it works fine in Firefox, see if you can find a js > console in IE and diagnose it there. Using Firefox to begin with > though will help you narrow the problem. > > PatCheers for that, & for Firefox! Like I said above, it has pointed me to: Error: Ajax.InPlaceEditor is not a constructor Unfortuantely, I don''t really know what to do w/ this! -- Posted via http://www.ruby-forum.com/.
doug livesey
2006-Mar-14 21:01 UTC
[Rails] Re: Re: Re: in_place_editor_field -- values not clickable
Pat Maddox wrote:> On 3/14/06, doug livesey <biot023@gmail.com> wrote: >> Source File: http://localhost:3000/contacts/show/1 >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > hrm..do you have the latest javascripts installed? Maybe you''re > trying to do this on an old application. Do rake update_javascripts > to..update the javascripts :) > > That''s probably not it, since my guess is you''re running Rails 1.0 on > a brand new app. If that''s the case, then I really don''t know what > the problem is. > > PatNo -- the response I get to ruby -v is: ruby 1.8.2 (2004-12-25) [i386-mswin32] And I just installed the latest version of rails, too! I tried the rake update_javascripts thing, but rake didn''t seem to recognise the command -- could that be a hint? -- Posted via http://www.ruby-forum.com/.
Pat Maddox
2006-Mar-14 21:10 UTC
[Rails] Re: Re: Re: in_place_editor_field -- values not clickable
On 3/14/06, doug livesey <biot023@gmail.com> wrote:> Pat Maddox wrote: > > On 3/14/06, doug livesey <biot023@gmail.com> wrote: > >> Source File: http://localhost:3000/contacts/show/1 > >> Posted via http://www.ruby-forum.com/. > >> _______________________________________________ > >> Rails mailing list > >> Rails@lists.rubyonrails.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > > > > hrm..do you have the latest javascripts installed? Maybe you''re > > trying to do this on an old application. Do rake update_javascripts > > to..update the javascripts :) > > > > That''s probably not it, since my guess is you''re running Rails 1.0 on > > a brand new app. If that''s the case, then I really don''t know what > > the problem is. > > > > Pat > > No -- the response I get to ruby -v is: > ruby 1.8.2 (2004-12-25) [i386-mswin32] > > And I just installed the latest version of rails, too! > I tried the rake update_javascripts thing, but rake didn''t seem to > recognise the command -- could that be a hint? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Ruby version shouldn''t matter. You said you have the latest version of Rails - just to make sure, type ''gem list rails'' at the command line. You should get "rails (1.0.0)". If not, you''ll need to ''gem update rails''. To see all available tasks, type ''rake -T'' in your app''s root dir. It''ll give you a list of all the rake commands it recognizes, and ''rake update_javascripts'' *should* be the last one on the list. If it''s not there then something''s wrong with your Rails install, and my guess is that it''s simply not up to date. It *could* be some Windows issue, I''m not sure. Pat
doug livesey
2006-Mar-14 21:52 UTC
[Rails] Re: Re: Re: Re: in_place_editor_field -- values not clickabl
> Ruby version shouldn''t matter. You said you have the latest version > of Rails - just to make sure, type ''gem list rails'' at the command > line. You should get "rails (1.0.0)". If not, you''ll need to ''gem > update rails''. > > To see all available tasks, type ''rake -T'' in your app''s root dir. > It''ll give you a list of all the rake commands it recognizes, and > ''rake update_javascripts'' *should* be the last one on the list. If > it''s not there then something''s wrong with your Rails install, and my > guess is that it''s simply not up to date. It *could* be some Windows > issue, I''m not sure. > > PatHi again -- I''ve run the rails update commands, but still to no avail. I still don''t get the update_javascripts rake task, and I still get the same error. Perplexing! I''ve even cleared all the caches & everything! I guess I shall have thoroughly investigate just what I''m running! from what I can tell, I''m up to date, but that doesn''t seem to be the case. Thanks very much for your input, doug. -- Posted via http://www.ruby-forum.com/.
doug livesey
2006-Mar-14 22:11 UTC
[Rails] Re: Re: Re: Re: in_place_editor_field -- values not clickabl
Yeah, you were right! The problem wasn''t my Ruby or Rails installation -- it was Rad Rails for Eclipse! (Well, me being dumb'', if we''re going to be pedantic...) I can''t believe I didn''t even think of that! Sorry about that -- hope the sense of closure helps take the sting out! & thanks very much again -- I would never have figured it out w/out your input. Cheers, doug. -- Posted via http://www.ruby-forum.com/.
What was the solution to your problem, Doug? What was it in Rad Rails that caused this problem? I''ve been trying to figure this out all morning w/o luck. Please help. Andrei
Include the ''controls'' library. Defaults library doesn''t exist in these later versions. Will solve this issue.
Andrei Erdoss wrote:> Include the ''controls'' library. Defaults library doesn''t exist in these > later versions. > > > > Will solve this issue.Hi -- all I did upon realising this was scale back how much I relied upon Rad Rails -- I just use it as an editor, really -- of course, I still use Eclipse find/replace & SVN etc., so it''s still worth having, but by going back to the console for most things, I stay totally up to date w/ features. Cheers, doug. -- Posted via http://www.ruby-forum.com/.