Skip to content

Instantly share code, notes, and snippets.

@phensalves
Created December 2, 2016 14:33
Show Gist options
  • Save phensalves/b5f7119fa934bb3907b10b9de1e7acc5 to your computer and use it in GitHub Desktop.
Save phensalves/b5f7119fa934bb3907b10b9de1e7acc5 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
private
def after_sign_in_path_for(resource_or_scope)
marvel_characters_path
end
def after_sign_out_path_for(resource_or_scope)
new_user_session_path
end
def get_all_characters
@characters = Api::CharacterManager.new
@characters.create_characters
@characters = Character.paginate(page: params[:page], per_page: 10)
end
def get_all_character_comics
@character = get_character
@manager = Api::CharacterManager.new({character: @character.id})
@manager.associate_comics
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment