Class: Decidim::DecidimAwesome::Admin::MenuForm
- Inherits:
-
Form
- Object
- Form
- Decidim::DecidimAwesome::Admin::MenuForm
- Includes:
- TranslatableAttributes
- Defined in:
- app/forms/decidim/decidim_awesome/admin/menu_form.rb
Constant Summary collapse
- VISIBILITY_STATES =
%w(default hidden logged non_logged verified_user).freeze
Instance Method Summary collapse
-
#map_model(model) ⇒ Object
remove query string from native menu element (to avoid interactions with the locale in the generated url).
- #to_params ⇒ Object
Instance Method Details
#map_model(model) ⇒ Object
remove query string from native menu element (to avoid interactions with the locale in the generated url)
23 24 25 |
# File 'app/forms/decidim/decidim_awesome/admin/menu_form.rb', line 23 def map_model(model) self.url = Addressable::URI.parse(model.url).path if model.native? end |
#to_params ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'app/forms/decidim/decidim_awesome/admin/menu_form.rb', line 27 def to_params { label: raw_label, position:, url:, target:, visibility: } end |