mirror of
https://github.com/fspc/BikeShed-1.git
synced 2025-04-04 05:33:22 -04:00
Add users resources and paginate users index
This commit is contained in:
parent
939ea5b9db
commit
d5b312fa54
@ -12,6 +12,8 @@ class User < ActiveRecord::Base
|
|||||||
validates :first_name, :presence => true
|
validates :first_name, :presence => true
|
||||||
validates :last_name, :presence => true
|
validates :last_name, :presence => true
|
||||||
|
|
||||||
|
self.per_page = 15
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
"#{first_name} #{last_name}"
|
"#{first_name} #{last_name}"
|
||||||
end
|
end
|
||||||
|
@ -24,4 +24,5 @@
|
|||||||
= link_to t('.edit', :default => t("helpers.links.edit")), edit_user_path(user), :class => 'btn btn-mini'
|
= link_to t('.edit', :default => t("helpers.links.edit")), edit_user_path(user), :class => 'btn btn-mini'
|
||||||
= link_to t('.destroy', :default => t("helpers.links.destroy")), user_path(user), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
|
= link_to t('.destroy', :default => t("helpers.links.destroy")), user_path(user), :method => :delete, :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')), :class => 'btn btn-mini btn-danger'
|
||||||
|
|
||||||
|
= will_paginate users
|
||||||
= link_to t('.new', :default => t("helpers.links.new")), new_user_path, :class => 'btn btn-primary'
|
= link_to t('.new', :default => t("helpers.links.new")), new_user_path, :class => 'btn btn-primary'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
Velocipede::Application.routes.draw do
|
Velocipede::Application.routes.draw do
|
||||||
|
|
||||||
devise_for :users
|
devise_for :users
|
||||||
|
resources :users
|
||||||
# The priority is based upon order of creation:
|
# The priority is based upon order of creation:
|
||||||
# first created -> highest priority.
|
# first created -> highest priority.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user