Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%= simple_form_for [@anime, @animelist] do |f| %>
- <%= f.input :status %>
- <%= f.input :rating %>
- <%= f.input :rewatched %>
- <% end %>
- <p><a data-open="exampleModal1">Add to Animelist</a></p>
- <div class="reveal form" id="exampleModal1" data-reveal>
- <%= render partial: 'animelists/form' %>
- <button class="close-button" data-close aria-label="Close modal" type="button">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- def new
- @anime = Anime.friendly.find(params[:anime_id])
- @animelist = Animelist.new
- end
- def create
- @anime = Anime.friendly.find(params[:anime_id])
- @animelist = Animelist.new(animelist_params)
- @animelist.user_id = current_user.id
- @animelist.anime_id = @anime.id
- if @animelist.save
- redirect_to :back
- else
- render :new
- end
- end
- def show
- @anime = Anime.friendly.find(params[:id])
- @animelist = Animelist.new
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement