well, first thing that comes to my mind is this:
should_render = {1 => 'page1', 'other_value' => 'otherpage', 'yet_another', => 'anotherpage', :default => 'returnpage' }
if should_render.include? result
render :action => should_render[result]
else
render :action => should_render[:default]
end
and of course you could bring the should_render hash from the Application Controller or anywhere else. Hope it helps.
Mxg – Maximiliano Guzman
RE: How is design done on larger rails sites?
0
(
0 points)
by
mxg on Sun Feb 10 16:56:09 -0500 2008
well, first thing that comes to my mind is this:
should_render = {1 => 'page1', 'other_value' => 'otherpage', 'yet_another', => 'anotherpage', :default => 'returnpage' }
if should_render.include? result
render :action => should_render[result]
else
render :action => should_render[:default]
end
and of course you could bring the should_render hash from the Application Controller or anywhere else. Hope it helps.
Mxg