Write insert query in views

Hello frnds

Is there any method to write the insert query in the .rhtml file (eg:
-list.rhtml). If so please do let me know.


Dhaval P.

You really, really, don’t want to do this.
Fetching data directly from the views is bad, and storing data is
even worse.
Do all the database stuff in your controller. That way the view
becomes simpler, and your code becomes testable.


well yes I know that but i actually want to do this while listing of the

in my list.rhtml i m having @email which is storing email addresses so i
want to store those into my db how could i do that?

please let me know…