Displaying 1 result from an estimated 1 matches for "auth_label".
Did you mean:
auth_labels
2010 May 13
1
link_to using smart API
Trying to use the "smart" API for link_to
def create_link(object, label = nil)
label ||= auth_labels[:new]
link = link_to(label, [:new, object]) if can?(:create, object)
link.sub /new\./, ''new/''
end
But this generates a link like /projects/new.1 , instead of /projects/
new
I would assume it would make sense to pass it the class instead, like
this, sense in this case the...