[towards greater knowledge Justin George **20070423024747] { adddir ./app/views/job adddir ./app/views/user adddir ./app/views/welcome hunk ./.boring 37 - +(^|/)ruby_sess\. hunk ./app/controllers/application.rb 7 + include AuthenticatedSystem addfile ./app/controllers/job_controller.rb hunk ./app/controllers/job_controller.rb 1 +class JobController < ApplicationController + before_filter :login_required + + def create + job = Job.new + job.user = current_user.id + job.save! + redirect_to :action => :edit, :id => job.id + end + + def update + job = Job.find(params[:job][:id]) + job.update_attributes!(params[:job]) + redirect_to :action => :show, :id => job.id + end + + def delete + Job.destroy(params[:id]) + flash[:notice] = "Job #{params[:id]} deleted " + redirect_to :action => :list + end + + def show + job = Job.find(params[:id]) + end + + def list + jobs = Job.find(:all) + end + +end addfile ./app/controllers/user_controller.rb hunk ./app/controllers/user_controller.rb 1 +class UserController < ApplicationController +end addfile ./app/controllers/welcome_controller.rb hunk ./app/controllers/welcome_controller.rb 1 +class WelcomeController < ApplicationController + def index + redirect_to :action => :list + end + + def list + @jobs = Job.find(:all) + end +end hunk ./app/helpers/application_helper.rb 3 + def vote_button item + " :vote, :action => item.class.to_s, :id => item.id) + '">' + end addfile ./app/helpers/job_helper.rb hunk ./app/helpers/job_helper.rb 1 +module JobHelper +end addfile ./app/helpers/user_helper.rb hunk ./app/helpers/user_helper.rb 1 +module UserHelper +end addfile ./app/helpers/welcome_helper.rb hunk ./app/helpers/welcome_helper.rb 1 +module WelcomeHelper +end addfile ./app/views/job/update.rhtml addfile ./app/views/layouts/application.rhtml hunk ./app/views/layouts/application.rhtml 1 - + + + +Jobsite + + +<%=yield %> + + addfile ./app/views/welcome/list.rhtml hunk ./app/views/welcome/list.rhtml 1 - +
+ <% @jobs.each do |job| %> +
<%= vote_button job %><%= job.title %>
+
+ <%= job.body %>
+ Created By: <%= job.user_id %> +
+ <% end -%> +
hunk ./config/routes.rb 14 - map.connect '', :controller => "jobs" + map.connect '', :controller => "welcome" addfile ./test/functional/job_controller_test.rb hunk ./test/functional/job_controller_test.rb 1 +require File.dirname(__FILE__) + '/../test_helper' +require 'job_controller' + +# Re-raise errors caught by the controller. +class JobController; def rescue_action(e) raise e end; end + +class JobControllerTest < Test::Unit::TestCase + def setup + @controller = JobController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + end + + # Replace this with your real tests. + def test_truth + assert true + end +end addfile ./test/functional/user_controller_test.rb hunk ./test/functional/user_controller_test.rb 1 +require File.dirname(__FILE__) + '/../test_helper' +require 'user_controller' + +# Re-raise errors caught by the controller. +class UserController; def rescue_action(e) raise e end; end + +class UserControllerTest < Test::Unit::TestCase + def setup + @controller = UserController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + end + + # Replace this with your real tests. + def test_truth + assert true + end +end addfile ./test/functional/welcome_controller_test.rb hunk ./test/functional/welcome_controller_test.rb 1 +require File.dirname(__FILE__) + '/../test_helper' +require 'welcome_controller' + +# Re-raise errors caught by the controller. +class WelcomeController; def rescue_action(e) raise e end; end + +class WelcomeControllerTest < Test::Unit::TestCase + def setup + @controller = WelcomeController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + end + + # Replace this with your real tests. + def test_truth + assert true + end +end binary ./tmp/sessions/ruby_sess.16fe1ea8cb6e49b5 oldhex *04087b062209686173687b06220a666c61736849433a27416374696f6e436f6e74726f6c6c6572 *3a3a466c6173683a3a466c617368486173687b00063a0a40757365647b00 newhex * rmfile ./tmp/sessions/ruby_sess.16fe1ea8cb6e49b5 binary ./tmp/sessions/ruby_sess.fe583bfcce46bb15 oldhex *04087b062209686173687b06220a666c61736849433a27416374696f6e436f6e74726f6c6c6572 *3a3a466c6173683a3a466c617368486173687b00063a0a40757365647b00 newhex * rmfile ./tmp/sessions/ruby_sess.fe583bfcce46bb15 }