Hi, I have a form like this. <% form_for(@search) do |f| %> <%= f.error_messages %> <p> <%= f.label :country %><br /> <%= f.text_field :country %> </p> <p> <%= f.label :city %><br /> <%= f.text_field :city %> </p> <p> <%= f.submit ''Search'' %> </p> <% end %> When a user is login i want to store the searches of the form. So the user view recent searches. Someone ideas/tips? Grtz..remco -- Posted via http://www.ruby-forum.com/.
On Wed, Jul 29, 2009 at 7:27 AM, Remco Swoany<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> When a user is login i want to store the searches of the form. So the > user view recent searches. > > Someone ideas/tips?"saving data in a database" is pretty basic Rails. :-) Perhaps you could pose a more specific question? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan
Hassan Schroeder wrote:> On Wed, Jul 29, 2009 at 7:27 AM, Remco > Swoany<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> When a user is login i want to store the searches of the form. So the >> user view recent searches. >> >> Someone ideas/tips? > > "saving data in a database" is pretty basic Rails. :-) > > Perhaps you could pose a more specific question? > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassanWhen a (login) user searches for a country or city and get the results, i want to store the user search-query in the database. The user can view their recent searches...if they are login... remco -- Posted via http://www.ruby-forum.com/.
On Wed, Jul 29, 2009 at 11:39 AM, Remco Swoany<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> When a (login) user searches for a country or city and get the results, > i want to store the user search-query in the database. The user can view > their recent searches...if they are login...OK, sounds pretty straightforward. User, Search, user has_many searches -- what''s the issue? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan