Changeset 200

Show
Ignore:
Timestamp:
08/01/08 11:56:21 (4 months ago)
Author:
pwh
Message:
  • Bridge Management: Code to allow bridge parameters to be viewed.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/controllers/bridge_management_controller.rb

    r193 r200  
    127127  end 
    128128 
     129 
     130  # Show information about this bridge 
     131   
     132  def show_bridge 
     133 
     134 
     135    # Check that we've been given a valid bridge ID 
     136   
     137    if !params[:bridge_id] 
     138      flash[:notice] = "No bridge was specified." 
     139      redirect_to :back and return 
     140    end 
     141 
     142 
     143    # Retrieve the bridge 
     144 
     145    begin 
     146      @bridge = Bridge.find(params[:bridge_id]) 
     147    rescue ActiveRecord::RecordNotFound 
     148      flash[:notice] = "The bridge specified was not found, or you are not allowed to view its information." 
     149      redirect_to :back and return 
     150    end 
     151   
     152  end 
     153 
    129154end 
  • nethorus/app/views/bridge_management/_all_bridges.html.erb

    r191 r200  
    1111  </td> 
    1212  <td> 
    13    <%=h bridge.dot1d_base_bridge_address %> 
     13   <%= link_to bridge.dot1d_base_bridge_address, :controller => 'bridge_management', :action => 'show_bridge', :bridge_id => bridge.id %> 
    1414  </td> 
    1515  <td>