Class: Admin::Atreides::GithubController

Inherits:
Atreides::AdminController
  • Object
show all
Defined in:
app/controllers/admin/atreides/github_controller.rb

Instance Method Summary collapse

Instance Method Details

#callbackObject



28
29
30
31
32
# File 'app/controllers/admin/atreides/github_controller.rb', line 28

def callback
  render :text => Atreides::Github.get_token(params[:code]).inspect
rescue OAuth2::Error => e
  render :text => e.response.inspect
end

#connectObject



24
25
26
# File 'app/controllers/admin/atreides/github_controller.rb', line 24

def connect
  redirect_to(Atreides::Github.authorize_url)
end

#indexObject



6
7
8
9
10
11
12
13
# File 'app/controllers/admin/atreides/github_controller.rb', line 6

def index
  @show_as_dash = true
  @issues = Atreides::Github.all(:state => params[:state] || "open")
  super do |wants|
    wants.html
    wants.js
  end
end

#showObject



15
16
17
18
19
20
21
22
# File 'app/controllers/admin/atreides/github_controller.rb', line 15

def show
  @issue = Atreides::Github.find(params[:id])
  @comments = @issue.comments
  super do |wants|
    wants.html
    wants.js
  end
end