Ruby Forum Rails I18n > write insert query in views

Posted by Dhaval Parikh (dhaval_parikh33)
on 03.10.2007 12:12
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.

Thanks

Dhaval Parikh
Posted by Daniel Brahneborg (Guest)
on 04.10.2007 08:05
(Received via mailing list)
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.

Regards,
/Daniel
Posted by Dhaval Parikh (dhaval_parikh33)
on 04.10.2007 11:02
well yes I know that but i actually want to do this while listing of the 
values..

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

thanks