fixes for form
This commit is contained in:
parent
4903f162be
commit
d4799d6711
|
@ -31,6 +31,8 @@ class Book
|
||||||
has_and_belongs_to_many :book_authors
|
has_and_belongs_to_many :book_authors
|
||||||
accepts_nested_attributes_for :book_authors
|
accepts_nested_attributes_for :book_authors
|
||||||
|
|
||||||
|
has_and_belongs_to_many :book_author_types
|
||||||
|
|
||||||
belongs_to :book_type
|
belongs_to :book_type
|
||||||
before_validation :add_http
|
before_validation :add_http
|
||||||
|
|
||||||
|
|
|
@ -7,5 +7,6 @@ class BookAuthorType
|
||||||
field :key, type: String
|
field :key, type: String
|
||||||
field :title, type: String, localize: true
|
field :title, type: String, localize: true
|
||||||
|
|
||||||
|
has_and_belongs_to_many :books
|
||||||
has_and_belongs_to_many :book_authors
|
has_and_belongs_to_many :book_authors
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
<%= 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)%>
|
<%= check_box_tag 'book[book_author_type_ids][]', author_type.id, @book.book_author_type_ids.include?(author_type.id)%>
|
||||||
<%= author_type.title %>
|
<%= author_type.title %>
|
||||||
<%= hidden_field_tag 'book[book_author_type_ids][]', '' %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue