asciinema.org/app/controllers/users_controller.rb

20 lines
453 B
Ruby
Raw Normal View History

2012-03-04 22:07:45 +00:00
class UsersController < ApplicationController
PER_PAGE = 20
def show
@user = User.find_by_nickname(params[:nickname])
@asciicasts =
@user.asciicasts.order("created_at DESC").page(params[:page]).per(PER_PAGE)
end
2012-03-05 23:25:21 +00:00
def create
@user = User.new(params[:user])
if @user.save
self.current_user = @user
redirect_to root_url, :notice => "Signed in!"
else
render 'users/new', :status => 422
end
end
2012-03-04 22:07:45 +00:00
end