-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fea907c
commit 20a58d8
Showing
4 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
app/controllers/spree/admin/taxons_controller_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Spree::Admin::TaxonsController.class_eval do | ||
before_filter :split_taxon_ids, only: [:new, :update] | ||
|
||
private | ||
# todo: rework this. Don't permit all params | ||
def taxon_params | ||
params.require(:taxon).permit! | ||
end | ||
|
||
def split_taxon_ids | ||
if params[:taxon][:property_ids].present? | ||
params[:taxon][:property_ids] = params[:taxon][:property_ids].split(',') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<div class="twelve columns alpha omega"> | ||
<%= @taxon.taxon_filter_ids %> | ||
<%= f.field_container :taxon_filters do %> | ||
<%= f.text_field :taxon_filter_ids, value: @taxon.taxon_filter_ids.join(',') %> | ||
<%= f.field_container :properties do %> | ||
<%= f.label :properties, Spree.t(:filterable_properties) %><br /> | ||
<%= f.text_field :property_ids, value: @taxon.property_ids.join(',') %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Spree::PermittedAttributes.taxon_attributes << :property_ids |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters