So, I have a controller called "Music" with one action, which is an index. On the page music/index.htmlI list the group of songs (through the song model), and below I have the opportunity to create a new song.
The song has checks that I tested and work perfectly. When a new song saves the "Songs" action in the controller, create me redirect_to => 'music_index_path'so that the person can see the new song in the list. However, when the Song does not save (does not pass validation), I cannot use it redirect_to, since the error_messages form is not portable. I need to use render, but can not say render :controller => 'music', :action => 'index.
My goal is to show error messages for the song form on the music / index.html page.
How can I do it? I am open to other ideas (e.g. changing controllers).
Thank!
source
share