luckyframework / luckyframework/lucky

Add link_to_if and link_to_unless

Open
#1,024 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.