Project

General

Profile

« Previous | Next » 

Revision b6e0cb16

Added by Ohad Levy over 13 years ago

fixes #454 - Foreman render 500 instead of 404

  • Fixes the not found method
  • generalize the find_by_obj_name method so we DRY abit more

View differences:

app/controllers/environments_controller.rb
class EnvironmentsController < ApplicationController
include Foreman::Controller::Environments
before_filter :find_environment, :only => %w{show edit update destroy}
before_filter :find_by_name, :only => %w{show edit update destroy}
def index
respond_to do |format|
......
redirect_to environments_url
end
private
def find_environment
@environment = Environment.find_by_name(params[:id])
end
end

Also available in: Unified diff