This commit is contained in:
MatsMyncke 2014-11-06 16:25:27 +01:00
parent 46b74305bf
commit 44185e8552
10 changed files with 37 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 Users 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 UsersController < ApplicationController
def new
end
def show
@user = User.find(params[:id])
end
end

View file

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

View file

@ -1,2 +1,3 @@
class User < ActiveRecord::Base
validates :name, presence: true, length: { maximum: 50 }
end

View file

@ -0,0 +1,2 @@
<h1>Users#new</h1>
<p>Find me in app/views/users/new.html.erb</p>

View file

@ -0,0 +1 @@
<%= @user.name %>, <%= @user.marks %>

View file

@ -1,5 +1,7 @@
Rails.application.routes.draw do
get 'users/new'
get 'static_pages/order'
root 'static_pages#home'
@ -7,6 +9,8 @@ Rails.application.routes.draw do
get 'overview' => 'static_pages#overview'
get 'static_pages/overview'
resources :users
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".

View file

@ -0,0 +1,9 @@
require 'test_helper'
class UsersControllerTest < ActionController::TestCase
test "should get new" do
get :new
assert_response :success
end
end

View file

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