Last active
May 10, 2019 20:48
-
-
Save mbklein/621f36b87a833938688fa882ed8ea0f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!-- events/show.html.erb --> | |
<%= form_tag(event_medfiles_release_many_path, method: 'POST') do %> | |
<%= hidden_field_tag 'id', @event.id %> | |
<% @event.medfiles.each do |medfile| %> | |
<%= render(partial: 'medfiles/release_form', object: medfile, as: 'medfile') %> | |
<% end %> | |
<%= submit_tag 'Do The Thing' %> | |
<%= end %> |
This file contains hidden or 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
<!-- medfiles/_release_form.html.erb --> | |
<div> | |
Whatever text you need and also stuff from medfile <%= medfile.id %>, | |
since <pre>medfile</pre> is a local variable in this context. | |
Also <%= check_box_tag "publish[]" value="#{medfile.id}" %> | |
</div> |
This file contains hidden or 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
# config/routes.rb | |
# (somewhere near your other event and/or medfile resources) | |
resources :events do | |
post 'medfiles/release_many', to: 'medfiles#release_many' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment