new users controller

This commit is contained in:
nilsding 2014-11-02 17:57:37 +01:00
parent cc4bf8d277
commit c211b29395
8 changed files with 54 additions and 0 deletions

View File

@ -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/

View File

@ -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/

View File

@ -0,0 +1,8 @@
class UserController < ApplicationController
def show
@user = User.find_by_screen_name(params[:username])
end
def edit
end
end

View File

@ -0,0 +1,2 @@
module UserHelper
end

View File

@ -0,0 +1,2 @@
<h1>User#edit</h1>
<p>Find me in app/views/user/edit.html.erb</p>

View File

@ -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'

View File

@ -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

View File

@ -0,0 +1,4 @@
require 'test_helper'
class UserHelperTest < ActionView::TestCase
end