Rails posting form data
I was looking at some tutorials on rai开发者_StackOverflowls and found that people use a separate create function for saving form data. When i tried the same i was unable to repopulate the form, that is shown in the index.html.erb and is rendered by the index function. should i add a manual render command?
- Set a member variable (e.g.) @elems to contain data
- In your view index.html.erb test for emptiness
- If not empty, populate form elements with @elems .
精彩评论