Displaying 3 results from an estimated 3 matches for "adwr".
Did you mean:
addr
2008 Apr 25
2
Can't Understand Why This Works
I have 3 methods:
def add_to_cart
# do some stuff
redirect_to_index
end
def empty_cart
# do some stuff
redirect_to_index("your cart was emptied")
end
def redirect_to_index(msg = nil)
flash[:notice] = msg if msg
redirect_to :action => :index
end
How come the flash notice works if I''m setting msg = nil? For example,
if I''m in empty_cart and pass
2006 Feb 18
4
Basic question: Where to initialize a flag?
I have found that if I initialize a flag in my controller (under def
Initialize), it appears everytime I call a controller action, the flag
is set to the initialize value (even though I''m not calling the
initialized action). Am I observing this clearly?
I don''t think I should initialize a flag in the index file. So where?
Specifically, I want to know if this action is a
2006 May 13
3
Non-customizable parts in the routes hierarchy-chain.
Hi
I created a custom route that looks like this:
map.connect '':controller/:table/:action/:id''
Hierarchically, :table is above :action and :id. So, if we call
ActionController::Base#url_for with an argument :table=>nil, we''re
supposed to get a url with :action and :id set to nil as well.
However, this is not the case:
url_for(:table=>nil) from