new users controller
This commit is contained in:
parent
cc4bf8d277
commit
c211b29395
|
@ -0,0 +1,3 @@
|
|||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
|
@ -0,0 +1,3 @@
|
|||
// Place all the styles related to the user controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
@ -0,0 +1,8 @@
|
|||
class UserController < ApplicationController
|
||||
def show
|
||||
@user = User.find_by_screen_name(params[:username])
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
end
|
|
@ -0,0 +1,2 @@
|
|||
module UserHelper
|
||||
end
|
|
@ -0,0 +1,2 @@
|
|||
<h1>User#edit</h1>
|
||||
<p>Find me in app/views/user/edit.html.erb</p>
|
|
@ -0,0 +1,18 @@
|
|||
.container.user-page
|
||||
.col-md-3.col-xs-12.col-sm-3
|
||||
.panel.panel-default
|
||||
.panel-body
|
||||
.row
|
||||
.col-md-12.col-xs-12.col-sm-9
|
||||
%img.img-rounded.img-profile
|
||||
%h1
|
||||
= @user.screen_name
|
||||
%ul.list-group
|
||||
%li.list-group-item
|
||||
Followers
|
||||
%span.badge#follower-count= @user.follower_count
|
||||
%li.list-group-item
|
||||
Followings
|
||||
%span.badge#friend-count= @user.friend_count
|
||||
.col-md-9.col-xs-12.col-sm-9
|
||||
= render 'shared/questionbox'
|
|
@ -0,0 +1,14 @@
|
|||
require 'test_helper'
|
||||
|
||||
class UserControllerTest < ActionController::TestCase
|
||||
test "should get show" do
|
||||
get :show
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
end
|
|
@ -0,0 +1,4 @@
|
|||
require 'test_helper'
|
||||
|
||||
class UserHelperTest < ActionView::TestCase
|
||||
end
|
Loading…
Reference in New Issue