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.

Thanks

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.

Regards,
/Daniel

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

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