Skip to content

Instantly share code, notes, and snippets.

@bsylvain
Created March 27, 2014 14:38
Show Gist options
  • Select an option

  • Save bsylvain/9808974 to your computer and use it in GitHub Desktop.

Select an option

Save bsylvain/9808974 to your computer and use it in GitHub Desktop.
Haml conditional form
-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