Sha256: 3bbac3a6842f312fe37cadd305eb38093888c77fe8345fe14e7d0f2ff448c8d4

Contents?: true

Size: 691 Bytes

Versions: 2

Compression:

Stored size: 691 Bytes

Contents

class <%= class_name %>Controller < ApplicationController

  hobo_user_controller

  auto_actions :all, :except => [ :index, :new, :create ]
<% if invite_only? -%>

  def create
    hobo_create do
      if valid?
        self.current_user = this
        this.password = this.password_confirmation = nil # don't trigger password change validations
        this.state = 'active'
        this.save
        flash[:notice] = "You are now the site administrator"
        redirect_to home_page
      end
    end
  end

  def do_accept_invitation
    do_transition_action :accept_invitation do
      self.current_user = this
      flash[:notice] = "You have signed up"
    end
  end
<% end -%>

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hobo-0.8.10 rails_generators/hobo_user_controller/templates/controller.rb
hobo-0.8.9 rails_generators/hobo_user_controller/templates/controller.rb