Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back-end field entries should be partialized #6

Open
robyurkowski opened this issue Aug 31, 2012 · 1 comment
Open

Back-end field entries should be partialized #6

robyurkowski opened this issue Aug 31, 2012 · 1 comment

Comments

@robyurkowski
Copy link
Contributor

Thought: when doing a form, instead of generating a long list of label/input pairs, each standard set should have its own partial with passed arguments. The advantage of this is that a user can override a single partial and update all the text / WYSIWYG / select items sitewise in one go.

At the very least, the complex items will need to be partialized, such as the WYSIWYG field (its markup is substantially more complicated).

@GeekOnCoffee
Copy link
Contributor

A potential alternative to partials: @preferences is defined in the controller as an array of already existing preferences... the preference_field_tag will spit out the appropriate form element (checkbox, text field, etc) based on the type of preference.

  <% @preferences.each do |key|
    type = Spree::Config.preference_type(key) %>
      <div class="field">
        <%= label_tag(key) %>
        <%= preference_field_tag(key, Spree::Config[key], :type => type) %>
      </div>
  <% end %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants