UPDATE:
this works like i want....
<td width="230"><div align="left"><%=
pitcher.flname %> (<%pitcher.team %>) <%= link_to
''Edit'', :controller =>
''pitchers'', :action => ''edit'', :id =>
pitcher.id %></div></td>
I''m 37 and I can read at a 2nd grade level.. :)
-Chris
On Apr 5, 2:06 pm, "nubyonrails37"
<nubyonra...-ikRmi1Kq4fw11+ino8+LCQ@public.gmane.org>
wrote:> Code below displays pitchers attached to a given scoreboard -- but i
> want to be able to edit the pitchers using this page to click
''edit''
> from. Is there a way i can have the pitcher''s name be a
hyperlink,
> and i need the pitcher.id to tell the app which pitcher to edit.
>
> When i run the below as is... my ''Edit'' link looks
likehttp://localhost:3000/pitchers/edit/666... but there''s no pitcher
with
> an id of 666 -- which is the game id -- and it returns the error
> ''Couldn''t find Pitcher with ID=666''
>
> the code in question is this:
> <%= link_to ''Edit'', :controller =>
''pitchers'', :action => ''edit'', :id
> => @pitcher %>
>
> Any help is appreciated.
>
> -Chris
>
> <% for column in Scoreboard.content_columns %>
> <p>
> <b><%= column.human_name %>:</b> <%=h
@scoreboard.send(column.name)
> %>
> </p>
> <% end %>
>
> <%= link_to ''Edit'', :action =>
''edit'', :id => @scoreboard %> |
> <%= link_to ''Back'', :action =>
''list'' %>
> <hr/>
> <h3>Pitchers</h3>
> <% for pitcher in @scoreboard.pitchers %>
> <table width="70%" border="0">
> <tr>
> <td width="230"><div
align="left"><%= pitcher.flname %> (<%> pitcher.team
%>) <%= link_to ''Edit'', :controller =>
> ''pitchers'', :action => ''edit'', :id
=> @pitcher %></div></td>
> <td><div
align="left"><strong>IP</strong>: <%= pitcher.innp
%></
> div></td>
> <td><div
align="center"><strong>R</strong>: <%= pitcher.runs
%></
> div></td>
> <td><div
align="center"><strong>H</strong>: <%= pitcher.hits
%></
> div></td>
> <td><div
align="center"><strong>E</strong>: <%= pitcher.eruns
%></
> div></td>
> <td><div
align="center"><strong>W</strong>: <%=
pitcher.bballs %></
> div></td>
> <td><div
align="center"><strong>K</strong>: <%= pitcher.Ks
%></
> div></td>
> <td><div
align="center"><strong>HR</strong>: <%= pitcher.HRs
%></
> div></td>
> <td><div
align="center"><strong>ERA</strong>: <%= pitcher.ERA
%></
> div></td>
> </tr>
> </table>
> <hr />
> <% end %>
>
> <%= form_tag :action => "pitcher", :id => @scoreboard
%>
> <%= text_field "pitcher", "flname"
%><br/>
> <%= submit_tag "Add Pitcher!"%>
> </form>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---