themoviedb-api

Rails - continuing to work on check_box_tag

丶灬走出姿态 提交于 2020-02-06 08:48:26
问题 Continuing my project on themoviedb api, here is now what I have. I added a method to pass the attributes of the query. My method is: def tmdb_search params.require(:tmdb_ids).permit(:id, :title, :release_date) end I pass this to: def create_from_tmdb(tmdb_search) tmdb_search = params[:tmdb_ids] @movie = Tmdb::Movie.find(tmdb_search) end I proceed then in adding the movie to my db: def add_tmdb(create_from_tmdb) create_from_tmdb = (params[:tmdb_ids]) @movie = Movie.new(create_from_tmdb)

undefined method `model_name' for Tmdb::Movie:Class

风格不统一 提交于 2019-12-13 05:14:23
问题 I'm using this gem - TMDb - to build a simple app. When I visit this URL i get the error: .../movies/97857/movie_reviews/new Form: <%= form_for @movie do |movie_form| %> <%= fields_for :movie_review, @movie.movie_review do |movie_review_fields| %> Title : <%= movie_review_fields.text_field :title %> <% end %> <%= f.submit %> <% end %> Source code 回答1: form_for expects an ActiveRecord object (which has an instance method called model_name ). @movie is a non-ActiveRecord object that comes from

Matching genre ids with genre names in TMDb with JavaScript (Ember.js)

若如初见. 提交于 2019-12-11 17:43:44
问题 I'm sure a lot of you have used the TMDb (The Movie Database) api for movies. But I'm having issues with showing the genre names for each movie displayed. I'm trying to replace each number in genre_ids , from movies api, with their corresponding name from genres api, as showing numbers to users doesn't say much! But I don't get the desired result. I'm not sure what the correct way is... Movie adapter import DS from 'ember-data'; const apiKey = 'SOME_API_KEY_HERE'; export default DS