Sha256: 3e221e838eac78911f8d6e121f8c9954d8c400e7f0e2e8029ce0733ac282dcbd
Contents?: true
Size: 1.44 KB
Versions: 4
Compression:
Stored size: 1.44 KB
Contents
#{ form_for( @category, :method => :post, :action => @form_save_url, :id => :category_form ) do |f| f.input_hidden(:category_group_id, @category_group_id) f.input_hidden(:id , @category.id) f.input_hidden(:csrf_token , get_csrf_token) f.g.div(:id => 'general') do f.input_text( lang('categories.labels.name'), :name, :placeholder => lang('categories.placeholders.name'), :required => :required, :maxlength => 255 ) f.input_text( lang('categories.labels.slug'), :slug, :placeholder => lang('categories.placeholders.slug') ) # Generate the dropdown that contains all possible parent categories parent_categories = {} Categories::Model::CategoryGroup[@category_group_id].categories.each do |c| if c.id != @category.id parent_categories[c.id] = c.name end end parent_categories[nil] = '--' if !parent_categories.empty? f.select( lang('categories.labels.parent'), :parent_id, :values => parent_categories, :size => 1, :selected => @category.parent_id ) end f.textarea( lang('categories.labels.description'), :description, :rows => 8 ) end f.g.div(:class => "clearfix") do f.g.div(:class => "button") do f.g.input(:type => 'submit', :value => lang('categories.buttons.save')) end end end }
Version data entries
4 entries across 4 versions & 1 rubygems