Hello, i got this: site_controller Menu.content_columns.each do |column| in_place_edit_for :menu, column.name end :menu, is a model with the sections names and contents In my view i have: <%= in_place_editor_field "dataCenter", ''content'',{},{:rows=>8,:cols=>5}%> and it says: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id Extracted source (around line #1): 1: <%= in_place_editor_field "dataCenter", ''content'',{},{:rows=>8,:cols=>5}%> IF I PUT <%= in_place_editor "dataCenter", ''content'',{}%>, it does the work but without the size i want, i mean it just present all the data in a field. Any helps will be good, Regards, -- 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-/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 believe you need to swap your options around and send the size through the tag_options not editor_options like this: <%= in_place_editor_field "dataCenter",''content'',{:rows=>8,:cols=>5},{}%> Edgar Gonzalez wrote:> Hello, i got this: > > site_controller > Menu.content_columns.each do |column| > in_place_edit_for :menu, column.name > end > > :menu, is a model with the sections names and contents > > In my view i have: > <%= in_place_editor_field "dataCenter", > ''content'',{},{:rows=>8,:cols=>5}%> > > and it says: > > Called id for nil, which would mistakenly be 4 -- if you really wanted > the id of nil, use object_id > > Extracted source (around line #1): > 1: <%= in_place_editor_field "dataCenter", > ''content'',{},{:rows=>8,:cols=>5}%> > > IF I PUT > <%= in_place_editor "dataCenter", ''content'',{}%>, it does the work but > without the size i want, i mean it just present all the data in a field. > > Any helps will be good, > Regards, >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
actually, you can leave the last ar out completely (still on first cup of coffee :) <%= in_place_editor_field "dataCenter",''content'', :rows=>8, :cols=>5 %> William Pratt wrote:> I believe you need to swap your options around and send the size through > the tag_options not editor_options like this: > > <%= in_place_editor_field "dataCenter",''content'',{:rows=>8,:cols=>5},{}%> > > > > Edgar Gonzalez wrote: > >> Hello, i got this: >> >> site_controller >> Menu.content_columns.each do |column| >> in_place_edit_for :menu, column.name >> end >> >> :menu, is a model with the sections names and contents >> >> In my view i have: >> <%= in_place_editor_field "dataCenter", >> ''content'',{},{:rows=>8,:cols=>5}%> >> >> and it says: >> >> Called id for nil, which would mistakenly be 4 -- if you really wanted >> the id of nil, use object_id >> >> Extracted source (around line #1): >> 1: <%= in_place_editor_field "dataCenter", >> ''content'',{},{:rows=>8,:cols=>5}%> >> >> IF I PUT >> <%= in_place_editor "dataCenter", ''content'',{}%>, it does the work but >> without the size i want, i mean it just present all the data in a field. >> >> Any helps will be good, >> Regards, >> >> > >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey!, thanks for your answers, but i still get this message: :( Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id -- 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-/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 -~----------~----~----~----~------~----~------~--~---
If you use this the in-place editor is looking for a variable called @dataCenter. Did you come from Java? The ruby conventions is data_center as a variable name. I''m guessing you are inside of a partial that you are passing a collection? So your partial is creating a variable called dataCenter. So just add a line above your current line. Like this: <% @dataCenter = dataCenter %> <%= in_place_editor_field "dataCenter",''content'', :rows=>8, :cols=>5 %> You may also want to change dataCenter into a symbol, like :dataCenter. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hey! thanks Amos, it was because i was in a parcial, but could you explain me why i had to do the <% @dataCenter = dataCenter %>?? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
When you use a collections partial it takes each item in the collection and passes it to a variable with the same name as your partial. ie; I have a variable called @items that is an array of Item(s) <%= render :partial => ''item'', :collection => @items %> Inside the partial now there is an variable called item. Now I have the following in my partial: <%= in_place_editor :item, "name" %> The in-place editor isn''t looking for item, but is looking for @item. I believe that this should be changed, but that is the way it was made. So above that line I have to create @item so that in-place editor can use it. If I was writing a function the collections partial would have a signature like this: render( partial, collection ) The variable partial is what is used as your variable name in the partial you created. Now the in-place-editor is looking for @partial. I hope that doesn''t confuse you. -Amos On 8/22/07, Edgar Gonzalez <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hey! thanks Amos, it was because i was in a parcial, > but could you explain me why i had to do the <% @dataCenter = dataCenter > %>?? > -- > Posted via http://www.ruby-forum.com/. > > > >-- Amos King A. King Software Development and Consulting, L.C. http://dirtyInformation.com -- Looking for something to do? Visit http://ImThere.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-/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 -~----------~----~----~----~------~----~------~--~---