Class: Muck::AccessCodeRequestsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/muck/access_code_requests_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/controllers/muck/access_code_requests_controller.rb', line 18

def create
  if logged_in?
    @indicate_logged_in = true
    respond_to do |format|
      format.js do
        render :template => 'access_code_requests/create.js', :layout => false
      end
      format.html do
        flash[:notice] = translate('muck.users.beta_code_not_required')
        redirect_to user_path(current_user)
      end
    end
  else
    @access_code_request = AccessCodeRequest.create(params[:access_code_request])
    respond_to do |format|
      format.js do
        render :template => 'access_code_requests/create.js', :layout => false
      end
      format.html do
        @page_title = t('muck.users.request_access_code')
        if @access_code_request
          redirect_to access_code_request_path(@access_code_request)
        else
          render :template => "access_code_requests/new"
        end
      end
    end
  end
end

#newObject



12
13
14
15
16
# File 'app/controllers/muck/access_code_requests_controller.rb', line 12

def new
  @access_code_request = AccessCodeRequest.new
  @page_title = t('muck.users.request_access_code')
  render :template => 'access_code_requests/new'
end

#showObject



8
9
10
# File 'app/controllers/muck/access_code_requests_controller.rb', line 8

def show
  render :template => 'access_code_requests/show'
end