Skip to content

Commit

Permalink
value_select ok
Browse files Browse the repository at this point in the history
  • Loading branch information
librasteve committed Nov 20, 2024
1 parent 5dabd51 commit fbd9382
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/Routes/Examples/Value-Select.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use Cro::WebApp::Template;
sub value_select-routes() is export {

my $data = {
audi => { models => ["A1", "A4", "A6"] },
toyota => { models => ["Landcruiser", "Tacoma", "Yaris"] },
bmw => { models => ["325i", "325ix", "X5"] },
audi => { models => ["A1", "A4", "A6"] },
toyota => { models => ["Landcruiser", "Tacoma", "Yaris", "RAV4" ] },
bmw => { models => ["325i", "325ix", "X5"] },
};

route {
Expand All @@ -17,7 +17,7 @@ sub value_select-routes() is export {
}

get -> 'models', :$make! {
template 'models.crotmp', { models => $data{$make}<models> };
template 'index.crotmp', :fragment<partial>, { models => $data{$make}<models> };
}
}
}
2 changes: 2 additions & 0 deletions templates/value_select/index.crotmp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
<div>
<label>Model</label>
<select id="models" name="model">
<:fragment partial($_)>
<@models : $model>
<option value="<$model>"><$model></option>
</@>
</:>
</select>
<img class="htmx-indicator" width="20" src="/img/bars.svg">
</div>
Expand Down
3 changes: 0 additions & 3 deletions templates/value_select/models.crotmp

This file was deleted.

0 comments on commit fbd9382

Please sign in to comment.