luckyframework / lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
https://luckyframework.org
MIT License
2.6k stars 158 forks source link

Add link_to_if and link_to_unless #1024

Open paulcsmith opened 4 years ago

paulcsmith commented 4 years ago

They would work mostly like Rails except it would not have a block version as it is more confusing than helpful (IMO)

link_to_if user.admin?, "Admin", to: Admin::Users::Index
link_to_unless user.admin?, "Admin", to: Admin::Users::Index
paulcsmith commented 4 years ago

Actually I don't think this quite does what I wanted and it seems it is very rarely used in the wild. I'll leave this open, but it is not a priority