I contain oracle as my database
having table "oratest11",contails 2 fields as
(id_field(Number),data(varchar2(20)) a sequence as "oratest11_seq" which
is incrementing the value of id_field
My model is as follows:-
class Oratest11 < ActiveRecord::Base
set_table_name 'oratest11'
set_primary_key 'id_field'
end
My Controler is as follows:-
class Oratest11sController < ApplicationController
def index
@oratest11s=Oratest11.find(:all)
end
def show
@oratest11=Oratest11.find(params[:id])
end
Index view:-
<table>
<% for ora in @oratest11s %>
<tr>
<td><%=h ora.data %>
</td>
<td><%=h ora.id_field %>
</td>
<td><%= link_to 'show',:action=>'show',:id=>ora %></td>
</tr>
<% end %>
</table>
Show View:-
<table border="1">
<tr>
<td><%= @oratest11.data %>
</td>
<td><%= @oratest11.id_field %>
</td>
</tr>
</table>
When i click on the show hiperlink error comes:-
Template is missing
Missing template oratest11s/show.erb in view path app/views
But when i used
default:-
http://localhost:3000/oratest11s/show/1.0
Instade Used:-
http://localhost:3000/oratest11s/show/1
it works fine...
so what could i used and how to directly go, after clicking the "view"
hiperlink:-
http://localhost:3000/oratest11s/show/1
when, i change datatype of id_field as Number to Integer it works
fine...
but, i dont want to change the datatype of id_field sence it contains
lots of records.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---