Commit 1e6dd4de
Changed files (3)
app
admin
views
admin
creations
db
app/admin/creations.rb
@@ -1,3 +1,3 @@
ActiveAdmin.register Creation do
-
+ form :partial => "form"
end
app/views/admin/creations/_form.html.erb
@@ -0,0 +1,8 @@
+<%= semantic_form_for [:admin, @creation] do |f| %>
+ <%= f.inputs @creation.attributes %>
+ <% for category in Category.all %>
+ <%= check_box_tag "creation[category_ids][]", category.id, @creation.categories.include?(category) %>
+ <%= category.name %>
+ <% end %>
+ <%= f.buttons :commit %>
+<% end %>
db/schema.rb
@@ -29,18 +29,18 @@ ActiveRecord::Schema.define(:version => 20120717123632) do
add_index "active_admin_comments", ["resource_type", "resource_id"], :name => "index_admin_notes_on_resource_type_and_resource_id"
create_table "admin_users", :force => true do |t|
- t.string "email", :default => "", :null => false
- t.string "encrypted_password", :default => "", :null => false
+ t.string "email", :default => "", :null => false
+ t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
- t.integer "sign_in_count", :default => 0
+ t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
add_index "admin_users", ["email"], :name => "index_admin_users_on_email", :unique => true
@@ -106,18 +106,18 @@ ActiveRecord::Schema.define(:version => 20120717123632) do
end
create_table "users", :force => true do |t|
- t.string "email", :default => "", :null => false
- t.string "encrypted_password", :default => "", :null => false
+ t.string "email", :default => "", :null => false
+ t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
- t.integer "sign_in_count", :default => 0
+ t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "name"
t.string "website"
t.string "twitter"