Created
March 27, 2014 14:38
-
-
Save bsylvain/9808974 to your computer and use it in GitHub Desktop.
Haml conditional form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -if current_admin_user.admin | |
| = form_tag copy_produits_backend_path, method: :post do | |
| %table | |
| %tr | |
| %th Nom | |
| %th Resume | |
| %th Famille | |
| %th Illustration | |
| %th Publié | |
| %th | |
| %th Actions | |
| [email protected] do |p| | |
| %tr | |
| %td | |
| = p.nom | |
| %td | |
| = truncate(p.resume,:length=>40).html_safe | |
| %td | |
| = p.famille | |
| %td | |
| = image_tag(p.illustration.url(:icone),:width=>'32') | |
| %td | |
| - if p.is_published? | |
| PUBLIÉ | |
| -else | |
| NON PUBLIÉ | |
| %td | |
| = link_to "Éditer", edit_backend_produit_path(p) | |
| %td | |
| -if current_admin_user.admin | |
| = submit_tag "copy" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment