| | 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 | |
|---|