I have 30 actions which all render basically the same thing, basically
their name and a message either indicating success or failure:
The trouble is, in order to do this I have a layout (partly shown
above) and then 30 blank files in my view directory named after the
actions they are associated with. I see no reason I have to create 30
blank view files. However, if I don’t create the file then Rails will
not render the view because it will error out on not being able to
find an associated view file for this action.
I have considered adding a render line to the bottom of every action,
something like render :file => “layouts/mylayout” but it seems that’s
more or less a brute force resolution like making 30 files is a brute
force solution.
Can I specify a default file to render for every action in a
controller? Someone has to know a more elegant, railsy solution to
this problem!
Thanks for your help,
Chris