luckyframework / luckyframework/lucky
Add link_to_if and link_to_unless
Open
Nobody has claimed this yet.
feature request
- Dominant language
- Crystal
- Stars
- 2.7k
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
They would work mostly like Rails except it would not have a block version as it is more confusing than helpful (IMO)
```crystal
link_to_if user.admin?, "Admin", to: Admin::Users::Index
link_to_unless user.admin?, "Admin", to: Admin::Users::Index
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing link_to helper and its tests in the Lucky framework, then compare their behavior with the Rails-style examples in this issue. Add link_to_if and link_to_unless without block forms, and confirm that the conditional examples produce the expected links and skipped output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100