James..
Thanks! That worked. I actually did try putting in the brackets before since
I figured, as you did, that all key => value pairs would be collected into a
the tag_options hash. However I tried it with the "cancel_text"
argument,
which still doesn''t seem to work. So thats why I assumed it
wouldn''t work
with "rows."
I also found a minor bug in the 0.14.3 version of the Rdocs. The
"ok_text"
argument should actually be "save_text" since that is what the code is
looking for. Didn''t check to see if this was logged yet.
Appreciate the help.
Shane
On 11/16/05, James Adam
<james.adam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> On 11/16/05, Shane Vitarana
<shanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > I''m a Ruby newbie but I
> > understand that the last two hashes will be combined into one, so I
> don''t
> > have to explicity have an empty {} in there.
>
> This isn''t true. Arguments which look like key => value pairs
will be
> collected into a single Hash if now bracketing is given, but this
> single hash will be used for the tag_options parameter. For example:
>
> in_place_editor_field(arg1, arg2, :key1 => val1, :key2 => val2, :key3
=>
> val3)
>
> is the same as
>
> in_place_editor_field(arg1, arg2, {:key1 => val1, :key2 => val2,
> :key3 => val3})
>
> ... so the in_place_editor_options will be given the default value of
> an empty hash. If you want to pass anything for the
> in_place_editor_options parameter, you need to be explicit with your
> Hash brackets, i.e.
>
> in_place_editor_field(arg1, arg2, {:key1 => val1, :key2 => val2},
> {:in_place_option => val3})
>
> So, in your example
>
> <%= in_place_editor_field :event, :notes, :rows => 5 %>
>
> The paramter {:rows => 5 } is actually a part of the tag_options, when
> as far as I can tell, it should be in the in_place_editor_options. You
> want something like this (formatted weirdly here for comments):
>
> <%= in_place_editor_field(:event, :notes,
> {},
> # tag_options
> {:rows => 5})
> # in_place_editor_options
> %>
>
> - james
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails