I''m trying to incorporate a field where a user can enter a quantity (online store app). I''ve tried adding this to my views/onlinestore/index.rhtml: <td width="40" align="center"><%= text_field ''line_items'', ''quantity'' %> </td> (I''m a total newbie so if there is a better way to pass the qty for an online order please do suggest!) That does indeed put a quantity field where I want it but it''s pretty big. Changing the length of the dbase field doesn''t reduce it. Ideally I''d like it big enough to enter 3 digits and that''s it. How can I do that? Thanks in advance.. -- Posted via http://www.ruby-forum.com/.
> <%= text_field ''line_items'', ''quantity'' :size=>3%>On 13-Dec-05, at 8:47 PM, Vince W. wrote:> I''m trying to incorporate a field where a user can enter a quantity > (online store app). I''ve tried adding this to my > views/onlinestore/index.rhtml: > > <td width="40" align="center"><%= text_field ''line_items'', ''quantity'' > %> > </td> > > (I''m a total newbie so if there is a better way to pass the qty for an > online order please do suggest!) > > That does indeed put a quantity field where I want it but it''s pretty > big. Changing the length of the dbase field doesn''t reduce it. > Ideally > I''d like it big enough to enter 3 digits and that''s it. How can I do > that? > > Thanks in advance.. > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
bruce balmer wrote:>> <%= text_field ''line_items'', ''quantity'' :size=>3%>Ok, I got it, full line of code ended up being: <td width="40" align="center"><%= text_field ''line_items'', ''quantity'',{: size=>3} %> </td> Thanks Bruce! -- Posted via http://www.ruby-forum.com/.
Vince: You''re welcome. Odd thing is that you don''t need those curly braces around :size=>whatever. Maybe it is correct form and maybe it is important and MAYBE I am lucky that my sites are working. Anyone care to comment? bruce On 14-Dec-05, at 8:33 AM, Vince W. wrote:> bruce balmer wrote: >>> <%= text_field ''line_items'', ''quantity'' :size=>3%> > > Ok, I got it, full line of code ended up being: > > <td width="40" align="center"><%= text_field ''line_items'', > ''quantity'',{: > size=>3} %> </td> > > > Thanks Bruce! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails