pug - Jade-Lang + Laravel + select option -


i have jade file , have select input setup following(using laravel well):

option(value="1", selected!='{!! $client->single_check == 1 ? "true" : "false" !!}') yes option(value="0", selected!='{!! $client->single_check == 0 ? "true" : "false" !!}') no 

i new jade trying figure out how use correctly. selected="true" doesn't work has selected=true, or way make "selected" or doesn't show selected @ all. know correct way should doing this? if take away "!=" , make "=" wont work. if take away quote marks wont work either. have feeling simple i'm not finding in documents.

this morning tried creating mixin , using inside option tag didnt work either.

 option(value="1", +lv('{{ $client->single_check == 1 ? "selected" : "" }}')) yes  option(value="0", +lv('{{ $client->single_check == 0 ? "selected" : "" }}')) no 

mixin:

mixin lv(content)   !{content} 

if has better way let me know , mark yours answer! created whole new option mixin:

+lopt('1', '{{ $client->single_check == 1 ? "selected" : ""}}', 'yes')   +lopt('0', '{{ $client->single_check == 0 ? "selected" : ""}}', 'no') 

mixin:

mixin lopt(val, sel, text)    | <option value="!{val}" !{sel}>!{text}</option> 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -