Sha256: e0b8eab6465da56c33700af36866db55a3850f40b25939ad3b9797c0f6253137

Contents?: true

Size: 582 Bytes

Versions: 6

Compression:

Stored size: 582 Bytes

Contents

class <%= user_plural_class_name %>Controller < ApplicationController
  def new
    @<%= user_singular_name %> = <%= user_class_name %>.new
  end
  
  def create
    @<%= user_singular_name %> = <%= user_class_name %>.new(params[:<%= user_singular_name %>])
    if @<%= user_singular_name %>.save
    <%- unless options[:authlogic] -%>
      session[:<%= user_singular_name %>_id] = @<%= user_singular_name %>.id
    <%- end -%>
      flash[:notice] = "Thank you for signing up! You are now logged in."
      redirect_to "/"
    else
      render :action => 'new'
    end
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
niftier-generators-0.1.2 lib/generators/niftier/authentication/templates/users_controller.rb
niftier-generators-0.1.1 lib/generators/niftier/authentication/templates/users_controller.rb
niftier-generators-0.1.0 lib/generators/niftier/authentication/templates/users_controller.rb
corntrace-nifty-generators-0.4.1 lib/generators/nifty/authentication/templates/users_controller.rb
corntrace-nifty-generators-0.4.0 lib/generators/nifty/authentication/templates/users_controller.rb
nifty-generators-0.4.0 lib/generators/nifty/authentication/templates/users_controller.rb