cujigar
1
This is my current ActionController code.
def index
list
render :action => ‘list’
end
def list
end
I wished this would work
alias index list
def list
end
But the problem is rails tries to render index.rhtml, instead of
list.rhtml when index action is invoked.
I want to be able write something like this
action_alias index list
which would add a method index to the class programatically.
please advise
cujigar
2
Why don’t you make that action you are aliasing to, render the
template you want it to render.
render :template => “somedir/somefile”
On Nov 17, 3:29 am, Jigar G. [email protected]
cujigar
3
dusty wrote:
Why don’t you make that action you are aliasing to, render the
template you want it to render.
render :template => “somedir/somefile”
On Nov 17, 3:29 am, Jigar G. [email protected]
As I have shown in the example, I have that as my current code, I was
looking to make it more concise.
cujigar
4
Jigar G. escribió:
I want to be able write something like this
action_alias index list
which would add a method index to the class programatically.
please advise
Maybe you can play with routes.rb
Regards
–
Rafael Garcia Ortega
cujigar
5
if you really just want one of those instead of two,
if you do it the RESTful way: get rid of the list action,
and stick with just the index action.
daniel
On Nov 17, 10:29 am, Jigar G. [email protected]