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:
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:
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:
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.
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