class UsersController

Public Instance Methods

show() click to toggle source

GET /user/:name GET /user/:name.json

# File app/controllers/users_controller.rb, line 6
def show
  tags = @user.tags.order('date desc').limit(100)
  @tags = tags.inject(Hash.new(0)) { |hash, a|
    hash[a.word] += a.count; hash
  }.sort {|(a,av),(b,bv)| bv <=> av}
end
show_date() click to toggle source

GET /user/:name/:year/:month/:day

# File app/controllers/users_controller.rb, line 19
def show_date
  @date    = date_param_parse
  @tag_log = @user.tag_logs.find_by_date(@date)
end
update() click to toggle source

PATCH/PUT /users/:name

# File app/controllers/users_controller.rb, line 25
def update
  @user.update(user_params) if myid == @user.id
  redirect_to user_path(@user.name)
end