diff --git a/app/assets/stylesheets/pamela.css.scss b/app/assets/stylesheets/macs.css.scss similarity index 100% rename from app/assets/stylesheets/pamela.css.scss rename to app/assets/stylesheets/macs.css.scss diff --git a/app/controllers/pamela_controller.rb b/app/controllers/macs_controller.rb similarity index 94% rename from app/controllers/pamela_controller.rb rename to app/controllers/macs_controller.rb index f47115e..14188e0 100644 --- a/app/controllers/pamela_controller.rb +++ b/app/controllers/macs_controller.rb @@ -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" } diff --git a/app/views/pamela/_form.html.erb b/app/views/macs/_form.html.erb similarity index 100% rename from app/views/pamela/_form.html.erb rename to app/views/macs/_form.html.erb diff --git a/app/views/macs/edit.html.erb b/app/views/macs/edit.html.erb new file mode 100644 index 0000000..2765d61 --- /dev/null +++ b/app/views/macs/edit.html.erb @@ -0,0 +1,6 @@ +
+ User: + <%= @mac.user.name unless @mac.user.blank? %> +
+ ++ Mac: + <%= @mac.mac %> +
+ +<%= link_to 'Edit', edit_mac_path(@mac) %> | +<%= link_to 'Back', macs_path %> diff --git a/app/views/pamela/edit.html.erb b/app/views/pamela/edit.html.erb deleted file mode 100644 index bad1ee6..0000000 --- a/app/views/pamela/edit.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -