Renaming pamela to macs

This commit is contained in:
Will Bradley 2013-01-31 20:48:27 -07:00
parent a7e999614c
commit 048ce52111
11 changed files with 32 additions and 22 deletions

View File

@ -1,4 +1,4 @@
class PamelaController < ApplicationController
class MacsController < ApplicationController
#require "active_record"
require "optparse"
@ -41,10 +41,13 @@ end
# POST /user
def create
@mac = Mac.new(params[:mac])
@mac.user_id = params[:user_id]
Rails.logger.info @macs.inspect
respond_to do |format|
if @mac.save
format.html { redirect_to "/pamela", :notice => 'Mac was successfully created.' }
format.html { redirect_to macs_path, :notice => 'Mac was successfully created.' }
format.json { render :json => @mac, :status => :created, :location => @mac }
else
format.html { render :action => "new" }
@ -61,7 +64,8 @@ end
respond_to do |format|
if @mac.update_attributes(params[:mac])
format.html { redirect_to "/pamela", :notice => 'User certification was successfully updated.' }
Rails.logger.info @mac.inspect
format.html { redirect_to macs_path, :notice => 'User certification was successfully updated.' }
format.json { head :no_content }
else
format.html { render :action => "edit" }

View File

@ -0,0 +1,6 @@
<h1>Editing Mac</h1>
<%= render 'form' %>
<%= link_to 'Show', @mac %> |
<%= link_to 'Back', macs_path %>

View File

@ -0,0 +1,5 @@
<h1>New Mac</h1>
<%= render 'form' %>
<%= link_to 'Back', macs_path %>

View File

@ -0,0 +1,12 @@
<p>
<b>User:</b>
<%= @mac.user.name unless @mac.user.blank? %>
</p>
<p>
<b>Mac:</b>
<%= @mac.mac %>
</p>
<%= link_to 'Edit', edit_mac_path(@mac) %> |
<%= link_to 'Back', macs_path %>

View File

@ -1,6 +0,0 @@
<h1>Editing User Certification</h1>
<%= render 'form' %>
<%= link_to 'Show', @user_certification %> |
<%= link_to 'Back', user_certifications_path %>

View File

@ -1,5 +0,0 @@
<h1>New User Certification</h1>
<%= render 'form' %>
<%= link_to 'Back', user_certifications_path %>

View File

@ -27,14 +27,8 @@ Dooraccess::Application.routes.draw do
match 'door_logs/download' => 'door_logs#download', :as => :download
match 'door_logs/auto_download' => 'door_logs#auto_download', :as => :auto_download
match 'pamela/scan' => 'pamela#scan'
match 'pamela' => 'pamela#index', :as => :macs
match 'pamela/:id' => 'pamela#show', :as => :mac
match 'pamela/:id/edit' => 'pamela#edit', :as => :edit_mac
put 'pamela/:id' => 'pamela#update' #PUT
match 'pamela/new' => 'pamela#new', :as => :new_mac
post 'pamela' => 'pamela#create' #POST
match 'macs/scan' => 'macs#scan'
resources :macs
root :to => "home#index"