dies ist der subjects_controllerNameerror: undefined lokale Variable oder Methode `params' für Haupt: Object aus (IRB): 7
class SubjectsController < ApplicationController
layout false
def index
@subjects = Subject.order("position ASC")
end
def show
@subject = Subject.find(params[:id])
end
def new
end
def edit
end
def delet
end
end
und dies ist der 'show.html.erb'
<%= link_to("<< Back to List", {:class => 'index'}) :class => 'back- link)'%>
<div class ="subjects show">
<h2>Show Subject</h2>
<table sammary="Subject detail view">
<tr>
<th>Name</th>
<td><%= @subject.name %></td>
</tr>
<tr>
<th>Position</th>
<td><%= @subject.position %> </th>
</tr>
<tr>
<th>Visible</th>
<td><%= @subject.visible ? 'true': 'flse' %> </th>
</tr>
<tr>
<th>Created</th>
<td><%= @subject.created_at %> </th>
</tr>
<tr>
<th>Updated</th>
<td><%= @subject.updated_at %> </th>
</tr>
</table>
</div>
so, wenn ich auf dem Browser auf etwas klicken bekomme ich nicht alles und wenn ich diese Konsole auf Schienen tat
Subject.find(params[:id])
ich dieses messag erhalten e
Nameerror: undefined lokale Variable oder Methode `params' für Haupt: Objekt aus (rb): 7
weil irb/console nicht weiß, was params ist. – uday