New help
flat | nested
How is design done on larger rails sites? (0 points)
in rails, design by jtoy on Thu Apr 13 09:40:37 -0500 2006

Hi, I am working on a the largest rails project I have worked on before. It’s large in terms of how many different directions the application can flow, so there will be many different views. How are people using rails to do the workflow on larger projects?
It is getting too tedious in the controller to have code like:

if @result ==1
render :action => ‘page1’
elsif @result ==2
render :action => ‘otherpage’
else
render :action => ‘returnpage’

How are rails developers managing these kinds of flows?
I would appreciate any suggestions.

RE: How is design done on larger rails sites? (0 points)
by mxg on Sun Feb 10 16:54:52 -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 – Maximiliano Guzman

RE: How is design done on larger rails sites? (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