Hi, I have a search form that looks like this. (I posted this problem
yesterday, and I got a helpful response on how to do this in
javascript, but I'd like to try to do it in Ruby on Rails. I'd like to
try to understand what's going on with this error message.)
"test search" is the value of the form's search_term, right? i don't
see how you populate recent_search. what does
recent_search.search_term.inspect return?
Yes, "test search" is the value of the form's search_term.
recent_search is coming out of an object in my controller -- maybe
this will make it clearer. Here's the partial that I'm trying to get
to render, with a link to a form submit:
recent_search.search_term is an old search that a user did, that I
pull out of the database. It it indeed being pulled out of the
database -- I can see it right there on the page, because the
beginning of my link_to is that string, and it renders properly.
Maybe I don't understand what you're getting at.
Somehow I think this form is sending a value to a key:
hm. maybe i'm too new to this to be useful. i'm confused that your
form_for takes :search_term, and your text field inside the form does
too. i thought form_for took the name of an object that _contained_
attributes whose names map to fields. so it's looking for
search_term.search_term?