joestelmach.com

Live Search With Ruby On Rails Part 3

In my previous posts on Rails Live Search (1, 2) I outlined some reservations I had regarding a typical live search implementation. One outstanding issue was that the framework provides a text_field html helper that seems unusable due to the fact that all form elements must be backed by the model. As tomtoday pointed out to me, this is simply not true. The Rails framework does provide a facility to render form elements that are not backed by the model using the _tag helper elements (text_field_tag, select_tag, etc.)

Many thanks to tomtoday for pointing this out to me. There's even a big fat section in the Agile Web Development With Rails book titled Working With Nonmodel Fields on page 366. Exactly how did I miss that!?

Comments
blog comments powered by Disqus