text_field_tag question

14 views
Skip to first unread message

Dave Castellano

unread,
Aug 16, 2014, 4:32:44 PM8/16/14
to rubyonra...@googlegroups.com
Hi,

I'm using a text_field_tag to provide a place for user input which does
not need a model or table associated with it. It is used for jQuery to
compare a users input with another field value.
If I place the text_field_tag within a form_for it looks for a route
which I do not want or need and an error is generated.

If I place it outside the form_for it works fine but then I can't
position it on the page where I want it very easily.

I am a novice and am wondering if I am either using the wrong type of
input field or really do need to keep it outside the form_for and deal
with its page positioning thru CSS.

Thanks,

Dave Castellano

--
Posted via http://www.ruby-forum.com/.

Dave Castellano

unread,
Aug 17, 2014, 5:50:30 PM8/17/14
to rubyonra...@googlegroups.com
Dave Castellano wrote in post #1155335:
> Hi,
>
> I'm using a text_field_tag to provide a place for user input which does
> not need a model or table associated with it. It is used for jQuery to
> compare a users input with another field value.
> If I place the text_field_tag within the form_for code for the page,
> upon data entry it looks for a route which I do not want or need and an
> error is generated.
>
Sorry, looks like this is not a Rails problem at all. The form is
submitted when I press the enter key by default so I guess I have to
disable it in jQuery!
Reply all
Reply to author
Forward
0 new messages