Routing based on db item values

How to enable routing if agreement parameter equals 1 to agreement and
othwerwise to options ?

See example:

def select
@imitem = Imitem.find(params[:id])

if (@imitem.update_attributes(params[:agreement]))
redirect_to :action => ‘agreement’, :id => @imitem
else
render :action => ‘options’, :id => @imitem
end
end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs