Hi,
if someone could tell how to work around this.
I''m calling a partial like so:
render :partial => ''space_line'', :locals =>
{:external_space =>
@new_space.external_space, :space => @new_space}
Within the partial I have the following text_area code:
text_area( :external_space, :space_comment, :style => "width:
100%", :class => "rich_text_editor")
I assumed the text_area helper would access the local
variable :external_space, but of course does not. Instead it looks for
@external_space. If it doesn''t find one, it creates an empty text
area.
Can I somehow provide a local variable, or am I out of luck here?
Best regards
jak4
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
On Mar 16, 1:45 pm, jak4 <johannes.kae...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I assumed the text_area helper would access the local > variable :external_space, but of course does not. Instead it looks for > @external_space. If it doesn''t find one, it creates an empty text > area. > > Can I somehow provide a local variable, or am I out of luck here? >either assign the local variable to an instance variable (yuck) or use form for which allows you to bind fields to non-instance variables. Fred> Best regards > jak4--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i am guessing fred wants you to use form_for :) On Mar 16, 3:40 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Mar 16, 1:45 pm, jak4 <johannes.kae...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I assumed the text_area helper would access the local > > variable :external_space, but of course does not. Instead it looks for > > @external_space. If it doesn''t find one, it creates an empty text > > area. > > > Can I somehow provide a local variable, or am I out of luck here? > > either assign the local variable to an instance variable (yuck) or use > form for which allows you to bind fields to non-instance variables. > > Fred > > > Best regards > > jak4--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think you are right ;). But since form_for didn''t work I went with the yuck part and hope that nobody will ever find out. On Mar 17, 11:28 am, "\"Wolas!\"" <jcpen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i am guessing fred wants you to use form_for :) > > On Mar 16, 3:40 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > On Mar 16, 1:45 pm, jak4 <johannes.kae...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I assumed thetext_areahelper would access the local > > > variable :external_space, but of course does not. Instead it looks for > > > @external_space. If it doesn''t find one, it creates an empty text > > > area. > > > > Can I somehow provide a local variable, or am I out of luck here? > > > either assign the local variable to an instance variable (yuck) or use > > form for which allows you to bind fields to non-instance variables. > > > Fred > > > > Best regards > > > jak4 > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---