Skip to content

url should accept lambdas #7

@paveltyk

Description

@paveltyk

That would be good if SimpleNavigation::Item would accept lambdas as url attr. That way I can use routes for resources. I extended SimpleNavigation::Item as:
class SimpleNavigation::Item
def url; @url.is_a?(Proc) ? @url.call : @url; end
end
Now In SimpleNavigation::Configuration.run block I can do next:
primary.item :edit, 'edit', lambda { edit_apartment_path @apartment }, :unless => lambda { @apartment.nil? }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions