Renaming pamela to macs
This commit is contained in:
@@ -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" }
|
||||
6
app/views/macs/edit.html.erb
Normal file
6
app/views/macs/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing Mac</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @mac %> |
|
||||
<%= link_to 'Back', macs_path %>
|
||||
5
app/views/macs/new.html.erb
Normal file
5
app/views/macs/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Mac</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', macs_path %>
|
||||
12
app/views/macs/show.html.erb
Normal file
12
app/views/macs/show.html.erb
Normal 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 %>
|
||||
@@ -1,6 +0,0 @@
|
||||
<h1>Editing User Certification</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @user_certification %> |
|
||||
<%= link_to 'Back', user_certifications_path %>
|
||||
@@ -1,5 +0,0 @@
|
||||
<h1>New User Certification</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', user_certifications_path %>
|
||||
Reference in New Issue
Block a user