fixes for form

This commit is contained in:
Saurabh Bhatia 2014-07-03 22:34:44 +08:00
parent 4903f162be
commit d4799d6711
3 changed files with 4 additions and 2 deletions

View File

@ -31,6 +31,8 @@ class Book
has_and_belongs_to_many :book_authors
accepts_nested_attributes_for :book_authors
has_and_belongs_to_many :book_author_types
belongs_to :book_type
before_validation :add_http

View File

@ -6,6 +6,7 @@ class BookAuthorType
field :key, type: String
field :title, type: String, localize: true
has_and_belongs_to_many :books
has_and_belongs_to_many :book_authors
end

View File

@ -43,7 +43,6 @@
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'book[book_author_type_ids][]', author_type.id, @book.book_author_type_ids.include?(author_type.id)%>
<%= author_type.title %>
<%= hidden_field_tag 'book[book_author_type_ids][]', '' %>
<% end %>
<% end %>
</div>