This might be a stupid question, but I am quite the noob and I can''t find it in agile. I have this in my html: <span class=''class''><%= dynamic content %></span> and I want to put <span class=''class'' name=@ruby_variable ><%= dynamic content %></span> so I can put it as a target from another page. cheers, Jason -- Posted via http://www.ruby-forum.com/.
On Dec 10, 2005, at 3:06 PM, Jason wrote:> This might be a stupid question, but I am quite the noob and I can''t > find it in agile. > > I have this in my html: > > <span class=''class''><%= dynamic content %></span> > > and I want to put > > <span class=''class'' name=@ruby_variable ><%= dynamic content %></span> > > so I can put it as a target from another page. > > cheers, > > Jason > > > -- > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Try this:> <span class=''class'' name=<%= @ruby_variable %> ><%= dynamic content > %></span>-Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732
On 12/10/05, Jason <jpfeifer-fVOoFLC7IWo@public.gmane.org> wrote:> <span class=''class'' name=@ruby_variable ><%= dynamic content %></span><span class=''class'' name=''<%= @ruby_variable %>''><%= dynamic content %></span>
jeremyevans0 wrote:> On 12/10/05, Jason <jpfeifer-fVOoFLC7IWo@public.gmane.org> wrote: >> <span class=''class'' name=@ruby_variable ><%= dynamic content %></span> > > <span class=''class'' name=''<%= @ruby_variable %>''><%= dynamic content > %></span>Thanks. I''m saying to myself duuuh! Brainfart. -- Posted via http://www.ruby-forum.com/.
I''m a noob also. I believe the answer is to rap the @ruby_variable in the erb delimiters so name=<%=@ruby_variable %> bruce On 10-Dec-05, at 4:06 PM, Jason wrote:> This might be a stupid question, but I am quite the noob and I can''t > find it in agile. > > I have this in my html: > > <span class=''class''><%= dynamic content %></span> > > and I want to put > > <span class=''class'' name=@ruby_variable ><%= dynamic content %></span> > > so I can put it as a target from another page. > > cheers, > > Jason > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
brucebalmer wrote:> I''m a noob also. I believe the answer is to rap the @ruby_variable > in the erb delimiters so > > name=<%=@ruby_variable %> > > brucehey bruce, the solution jeremy posted works. I had thought that putting putting ruby code <%= @variable %> in quotes ''<%= @variable %>'' would force a string and not ruby. But that works. -- Posted via http://www.ruby-forum.com/.
You should quote the name. Avoid problems and make "good" html. <span class=''class'' name=''<%= ruby_var %>''><%= dynamic content %></span> My current project uses many of these for using same structure with different classes: <span class=''<%= class_var %>'' id=''<%= id_var %>''><%= dynamic content %></span> Also: ''id'' should generally be used rather than ''name''. I believe it''s safe to say that ''id'' will respond everywhere ''name'' would, plus ''id'' can be used as an object: <span id=''xyz''><script>xyz.style... (But sometimes I use the same ''name'' for multiple objects to do group operations: document.all(''myButtons'').style...) Rich Clingman ----- Original Message ----- From: "Bruce Balmer" <brucebalmer-ee4meeAH724@public.gmane.org> To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> Sent: Saturday, December 10, 2005 4:37 PM Subject: Re: [Rails] assiging an attribute in rhtml> I''m a noob also. I believe the answer is to rap the @ruby_variable in the > erb delimiters so > > name=<%=@ruby_variable %> > > bruce > > > On 10-Dec-05, at 4:06 PM, Jason wrote: > >> This might be a stupid question, but I am quite the noob and I can''t >> find it in agile. >> >> I have this in my html: >> >> <span class=''class''><%= dynamic content %></span> >> >> and I want to put >> >> <span class=''class'' name=@ruby_variable ><%= dynamic content %></span> >> >> so I can put it as a target from another page. >> >> cheers, >> >> Jason >> >> >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> 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 >
By way of correction of myself...> Also: ''id'' should generally be used rather than ''name''. I believe it''s safe > to say that ''id'' will respond everywhere ''name'' would...You still need to use ''name'' in form variables, ''id'' is not adequate. <input type=text NAME=whatever... Rich Clingman ----- Original Message ----- From: "Rich Clingman" <Rich-oBnrtXkpV0tBDgjK7y7TUQ@public.gmane.org> To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> Sent: Saturday, December 10, 2005 6:46 PM Subject: Re: [Rails] assiging an attribute in rhtml> You should quote the name. Avoid problems and make "good" html. > > <span class=''class'' name=''<%= ruby_var %>''><%= dynamic content %></span> > > My current project uses many of these for using same structure with > different classes: > > <span class=''<%= class_var %>'' id=''<%= id_var %>''><%= dynamic content > %></span> > > Also: ''id'' should generally be used rather than ''name''. I believe it''s safe > to say that ''id'' will respond > everywhere ''name'' would, plus ''id'' can be used as an object: <span > id=''xyz''><script>xyz.style... > (But sometimes I use the same ''name'' for multiple objects to do group > operations: document.all(''myButtons'').style...) > > Rich Clingman > > > ----- Original Message ----- > From: "Bruce Balmer" <brucebalmer-ee4meeAH724@public.gmane.org> > To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > Sent: Saturday, December 10, 2005 4:37 PM > Subject: Re: [Rails] assiging an attribute in rhtml > > >> I''m a noob also. I believe the answer is to rap the @ruby_variable in the >> erb delimiters so >> >> name=<%=@ruby_variable %> >> >> bruce >> >> >> On 10-Dec-05, at 4:06 PM, Jason wrote: >> >>> This might be a stupid question, but I am quite the noob and I can''t >>> find it in agile. >>> >>> I have this in my html: >>> >>> <span class=''class''><%= dynamic content %></span> >>> >>> and I want to put >>> >>> <span class=''class'' name=@ruby_variable ><%= dynamic content %></span> >>> >>> so I can put it as a target from another page. >>> >>> cheers, >>> >>> Jason >>> >>> >>> -- >>> Posted via http://www.ruby-forum.com/. >>> _______________________________________________ >>> 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 >> > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >