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

Different Form html in development and production env for STI model #210

Closed
u2 opened this issue Mar 26, 2015 · 0 comments
Closed

Different Form html in development and production env for STI model #210

u2 opened this issue Mar 26, 2015 · 0 comments

Comments

@u2
Copy link

u2 commented Mar 26, 2015

class SetMeal < ActiveRecord::Base
end

class Example < SetMeal
  has_many :events, as: :eventable
end

class Package < SetMeal

end
          <%= bootstrap_form_for set_meal, url: update_is_top_admin_set_meal_path(set_meal), method: :patch, remote: true, id: 'top-form' do |f| %>
              <%= f.check_box :is_top %>
              <%= f.submit "Submit", class: "btn btn-primary" %>
          <% end %>

For developmen env

<form accept-charset="UTF-8" action="/admin/set_meals/31411/update_is_top" class="edit_set_meal" data-remote="true" id="edit_set_meal" method="post" role="form"><div style="display:none"><input name="utf8" type="hidden" value=""><input name="_method" type="hidden" value="patch"></div>
              <div class="checkbox"><label for="set_meal_is_top"><input name="set_meal[is_top]" type="hidden" value="0"><input checked="checked" id="set_meal_is_top" name="set_meal[is_top]" type="checkbox" value="1"> </label></div>
              <input class="btn btn-primary" name="commit" type="submit" value="">
</form>

For production env

<form accept-charset="UTF-8" action="/admin/set_meals/23440/update_is_top" class="edit_example" data-remote="true" id="edit_example_23440" method="post" role="form"><div style="display:none"><input name="utf8" type="hidden" value=""><input name="_method" type="hidden" value="patch"></div>
              <div class="checkbox"><label for="example_is_top"><input name="example[is_top]" type="hidden" value="0"><input checked="checked" id="example_is_top" name="example[is_top]" type="checkbox" value="1"> </label></div>
              <input class="btn btn-primary" name="commit" type="submit" value="">
</form>

The different is the params set_meal[] and example[].

@u2 u2 changed the title Different Form html in development and production env for STI modle Different Form html in development and production env for STI model Mar 26, 2015
@u2 u2 closed this as completed Feb 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant