I encountered the same problem. I found that when passing the option in
JavaScript, instead through the ruby method, the option gets
interpreted right.
So I did mimic the "in_place_editor_field".
If you can do without the separate CSS-file, this could be a fast
solution.
Instead of 'in_place_editor_field :user, :email'(in my case) I wrote
the 'span' tag it would generate:
<span id="user_email_<%= @user[:id] %>_in_place_editor"
class="in_place_editor_field"><%= @user.email %></span>
The tag id is generated like
"#{object}_#{method}_#{object.id}_in_place_editor".
The method needed\generated from the 'in_place_edit_for' in the
controller is named like "set_#{object}_#{method}". so for me it came
to this:
<% url = url_for({ :action => "set_user_email", :id => @user[:id] })
-%>
Then I added the InPlaceEditor function to the same rhtml file:
<script type="text/javascript">
new Ajax.InPlaceEditor('user_email_<%= @user[:id]
%>_in_place_editor', '<%= url %>', {highlightcolor:'#550000',
highlightendcolor:'#005500'});
</script>
And it worked.
On Nov 21, 9:11 pm, Sébastien Gruhier <[EMAIL PROTECTED]> wrote:
> You could find a zip file herehttp://www.xilinus.com/inplace.zip
> it includes a html sample file
>
> Let me know if it's fine for you.
>
> BTW, is there a better place to post it?
>
> Seb
>
> On Nov 21, 2006, at 4:41 PM, jeremy*pinnix wrote:
>
>
>
> > I would greatly appreciate that Seb!
>
> > On Nov 21, 3:44 am, "seb" <[EMAIL PROTECTED]> wrote:
> >> I have done a extension to inplace editor to set highlightcolor and
> >> highlightendcolor in a CSS file which is better when you need to skin
> >> websites.
> >> If you are interested, I can post it in the mailing-list
>
> >> Seb
>
> >> On Nov 21, 9:08 am, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
>
> >>> jeremy*pinnix a écrit :
>
> >>>> How can you change thehighlightcolorfor in_place_editor_field?
>
> >>>> I tried:
>
> >>>> <%= in_place_editor_field :client, :name, {}, {:highlightcolor =>
> >>>> '"#d81983"', :highlightendcolor => '"#d81983"'} %>
>
> >>>> (both with and without the double-quotes) and it just doesn't
> >>>> pass the
> >>>> javascript options...Well, so far, this helper isn't up to par
> >>>> with all the options used by
> >>> the JS object. It's also scheduled for extraction as a plugin by
> >>> Rails
> >>> 2.0 time, like many other script.aculo.us helpers, or so it seems.
>
> >>> You have only two choices:
> >>> - copy/paste to create a custom helper in your
> >>> app/helpers/application_helper.rb
> >>> - write the thing straight in JavaScript, tailored to your needs.
>
> >>> --
> >>> Christophe Porteneuve a.k.a. TDD
> >>> "[They] did not know it was impossible, so they did it." --Mark
> >>> Twain
> >>> Email: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---