Generating ROR application through sql server

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

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

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

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

Thank You Very Much .. I am new to the rails I Came to Know about the new things today..