Hi! I am working on Linux..(UBUNTU) I connected to the sql server(remote machine) through FreeTDS and i generated the ROR application for example in my database i have the table Elections... i done as # rails my_app the database.yml file is development: adapter: sqlserver mode: odbc database: mysqlapp_development dsn: MyDsn host: 192.168.3.77 username: sa # script/generate scaffold election it is creating all the model and controller fields but it is not getting the data.. the views created for the my_app is in the format of the edit.html.erb new.html.erb and so on.. not in the .rhtml format If there are two pages for me one is to show the aprticular record information another is to show the list of records.. even i made two actions one as ''display'' and another as ''list'' in my controller,it is saying no action responded for the ''display'' and as well as for ''list'' if i changed the name as ''show'' then only the action responding.. but how can i make two actions with same name.. so if I renamed ''list'' as ''show'' when i clicked on the link it is listing the values.. when i clicked on the ''display'' it is not working similarly if i changed the ''display'' as ''show'' it is working where list not.. if both remained unchanged no one is working the link i created as link_to(''Display'',:controller => ''elections'',:action => ''display'') link_to(''List the elections'',:controller => ''elections'',:action => ''list'') the link calling either the action named as ''edit'',''new'',''index'',''show'' and ''delete''(the actions generated by the scaffold) for the other names not invoking.. What is the error? I can''t understand why it is behaving like that... I tried to do manually without scaffold command.. then not even one action performing... Please help me where I am going wrong --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mon, Aug 25, 2008 at 4:46 AM, hema gonaboina <hema.solivar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Hi! > I am working on Linux..(UBUNTU) > I connected to the sql server(remote machine) through FreeTDS and i > generated the ROR application for example in my database i have the table > Elections... > i done as > # rails my_app > the database.yml file is > development: > adapter: sqlserver > mode: odbc > database: mysqlapp_development > dsn: MyDsn > host: 192.168.3.77 > username: sa > > # script/generate scaffold election >What fields are defined on the election model? Usually, I would do something like this when I use scaffold: script/generate scaffold person first_name:string last_name:string Next, I''ll perform the following: rake db:migrate Now, you should be able to interact with your Rails application. Good luck, -Conrad> > it is creating all the model and controller fields but it is not getting > the data.. > the views created for the my_app is in the format of the edit.html.erb > new.html.erb and so on.. not in the .rhtml format > If there are two pages for me one is to show the aprticular record > information another is to show the list of records.. even i made two actions > one as ''display'' and another as ''list'' in my controller,it is saying no > action responded for the ''display'' and as well as for ''list'' > if i changed the name as ''show'' then only the action responding.. but how > can i make two actions with same name.. so if I renamed ''list'' as ''show'' > when i clicked on the link it is listing the values.. when i clicked on the > ''display'' it is not working > similarly if i changed the ''display'' as ''show'' it is working where list > not.. if both remained unchanged no one is working > the link i created as link_to(''Display'',:controller => ''elections'',:action > => ''display'') > link_to(''List the elections'',:controller => ''elections'',:action => ''list'') > the link calling either the action named as ''edit'',''new'',''index'',''show'' and > ''delete''(the actions generated by the scaffold) > for the other names not invoking.. > What is the error? > I can''t understand why it is behaving like that... > I tried to do manually without scaffold command.. then not even one action > performing... Please help me where I am going wrong > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > # script/generate scaffold election > it is creating all the model and controller fields but it is not > getting > the data..If you''re going to generate via the scaffolding and expect it to show anything, you''ll need to tell it the fields, typically: script/generate scaffold election field:type field:type field:type ... If you''re attaching to an existing table in the database, you''ll need to add the desired fields to the views yourself (and should probably remove the create_table and drop_table from your migration)> the views created for the my_app is in the format of the edit.html.erb > new.html.erb and so on.. not in the .rhtml formatThe generated code is for a version of Rails later than you expect... the new format for view files is action.html.erb (Rails 1.x.x used the rhtml extension if I remember my old Rails correctly)> If there are two pages for me one is to show the aprticular record > information another is to show the list of records.. even i made two > actions > one as ''display'' and another as ''list'' in my controller,it is saying no > action responded for the ''display'' and as well as for ''list'' > if i changed the name as ''show'' then only the action responding.. but > howlist of records == index show 1 record == show When you added the ''display'' action to the controller, and the display.html.erb, did you add the route for it to routes.rb? And why is your ''display'' different from the standard ''show''? -- 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 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 -~----------~----~----~----~------~----~------~--~---
Thank You Very Much .. I am new to the rails I Came to Know about the new things today.. On Aug 25, 5:57 pm, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > # script/generate scaffold election > > it is creating all the model and controller fields but it is not > > getting > > the data.. > > If you''re going to generate via the scaffolding and expect it to show > anything, you''ll need to tell it the fields, typically: > script/generate scaffold election field:type field:type field:type ... > > If you''re attaching to an existing table in the database, you''ll need to > add the desired fields to the views yourself (and should probably remove > the create_table and drop_table from your migration) > > > the views created for the my_app is in the format of the edit.html.erb > > new.html.erb and so on.. not in the .rhtml format > > The generated code is for a version of Rails later than you expect... > the new format for view files is action.html.erb (Rails 1.x.x used the > rhtml extension if I remember my old Rails correctly) > > > If there are two pages for me one is to show the particular record > > information another is to show the list of records.. even i made two > > actions > > one as ''display'' and another as ''list'' in my controller,it is saying no > > action responded for the ''display'' and as well as for ''list'' > > if i changed the name as ''show'' then only the action responding.. but > > how > > list of records == index > show 1 record == show > > When you added the ''display'' action to the controller, and the > display.html.erb, did you add the route for it to routes.rb? And why is > your ''display'' different from the standard ''show''? > > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---