Save userform data in database

Hi,

I have a form like this.

<% form_for(@search) do |f| %>
<%= f.error_messages %>

<%= f.label :country %>
<%= f.text_field :country %>

<%= f.label :city %>
<%= f.text_field :city %>

<%= f.submit 'Search' %>

<% 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

On Wed, Jul 29, 2009 at 7:27 AM, Remco
Swoany[email protected] 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. :slight_smile:

Perhaps you could pose a more specific question?


Hassan S. ------------------------ [email protected]
twitter: @hassan

Hassan S. wrote:

On Wed, Jul 29, 2009 at 7:27 AM, Remco
Swoany[email protected] 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. :slight_smile:

Perhaps you could pose a more specific question?


Hassan S. ------------------------ [email protected]
twitter: @hassan

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…

remco

On Wed, Jul 29, 2009 at 11:39 AM, Remco
Swoany[email protected] 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 S. ------------------------ [email protected]
twitter: @hassan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs