Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Error:
- wrong argument type Hash (expected Data) (TypeError)
- /Users/radar/Sites/sportsbet/app/controllers/competitions_controller.rb:7:in `to_json'
- /Users/radar/Sites/sportsbet/app/controllers/competitions_controller.rb:7:in `index'
- ## Codez:
- def index
- columns = %w[away_team_api_id away_team_name start_time api_id week home_team_api_id home_team_name season_id]
- competitions = @league.current_season.competitions.all(:select => columns * ',', :order => :week)
- render :json => competitions.to_json(:methods => [:league_name, :season_name, :sport_name, :season_api_id])
- end
Add Comment
Please, Sign In to add comment