Rails specify controller action -
i have folder views/home contains initial screen rails app.
for users, home.index.html.erb displays partial containing list of workorkorders.
in other words i'm fetching list of workorder , list of worequests home/index.html.erb - therefore, i've added code read @workorders , @worequests home controller.
this code fetches workorders:
<% @workorders.notcompl.each |workorder| %>
the home controller contains code fetch workorders:
def index @workorders = workorder.all
i'd have _agentopenrequests.html.erb fetch of worequests. so, added following fetch wore quests:
def index2 @worequests = worequest.all
but, in partial thats executed home/index.html.erb file, how following line use index2
instead of index
?
<% @worequests.notcompl.each |worequest| %>
should put both @worequests , @workorders index
?
update1
i tried changing home controller this:
def index @workorders = workorder.all respond_to |format| format.html # index.html.erb format.json { render json: workorders3datatable.new(view_context) } end @worequests = worequest.all respond_to |format| format.html # index.html.erb end end
but,
doublerendererror - render and/or redirect called multiple times in action. please note may call render or redirect, , @ once per action.
update2
would make more sense have partial in worequests folder instead of home - so, worequests controller gets used?
if index2
pull collection of worequests, can copy/move index
action.
Comments
Post a Comment