On Apr 21, 4:37 pm, Michael Pavling pavl...@gmail.com wrote:
On 21 April 2010 20:36, Thomas Allen thomasmal...@gmail.com wrote:
active = request.request_uri == url
Would using url_for() not save you a lot of hassle generating that url?
Thanks Michael, url_for was what I was looking for
On 21 April 2010 22:00, Thomas Allen thomasmal...@gmail.com wrote:
On Apr 21, 4:37 pm, Michael Pavling pavl...@gmail.com wrote:
On 21 April 2010 20:36, Thomas Allen thomasmal...@gmail.com wrote:
active = request.request_uri == url
Would using url_for() not save you a lot of hassle
Ah, that makes sense now. For the sake of correctness, the final code
(with a yield and without the unused routes variable):
def menu_item text, url = {}
unless url[:access] and active_user.cannot? url[:access]
unless url.is_a? String
if url[:controller]
url = url_for url
3 matches
Mail list logo