Module: Spud::Admin::PostsHelper
- Defined in:
- app/helpers/spud/admin/posts_helper.rb
Instance Method Summary collapse
- #options_for_parent_category(parent_id = 0) ⇒ Object
- #spud_post_site_check_box_tag(site, post) ⇒ Object
- #spud_post_site_label_tag(site) ⇒ Object
Instance Method Details
#options_for_parent_category(parent_id = 0) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'app/helpers/spud/admin/posts_helper.rb', line 3 def (parent_id = 0) if @categories[parent_id] return @categories[parent_id].collect{ |c| opts = [c.name, c.id] opts += (c.id) } else return [] end end |
#spud_post_site_check_box_tag(site, post) ⇒ Object
14 15 16 |
# File 'app/helpers/spud/admin/posts_helper.rb', line 14 def spud_post_site_check_box_tag(site, post) return check_box_tag 'spud_post[spud_site_ids][]', site[:site_id], post.spud_site_ids.include?(site[:site_id]), :id => "spud_post_site_id_#{site[:site_id]}" end |
#spud_post_site_label_tag(site) ⇒ Object
18 19 20 |
# File 'app/helpers/spud/admin/posts_helper.rb', line 18 def spud_post_site_label_tag(site) return label_tag "spud_post_site_id_#{site[:site_id]}", site[:site_name], :class => 'checkbox inline' end |