# Generating ROR application through sql server

**URL:** <https://www.ruby-forum.com/t/generating-ror-application-through-sql-server/146787>\
**Category:** Rails\
**Created:** [August 25, 2008, 1:53pm UTC](https://www.ruby-forum.com/t/generating-ror-application-through-sql-server/146787 "2008-08-25T13:53:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hema\_mca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hema\_mca](https://www.ruby-forum.com/u/hema_mca)\
**Post date:** [August 25, 2008, 1:53pm UTC](https://www.ruby-forum.com/t/generating-ror-application-through-sql-server/146787/1 "2008-08-25T13:53:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hema\_mca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hema\_mca](https://www.ruby-forum.com/u/hema_mca)\
**Post date:** [August 25, 2008, 2:01pm UTC](https://www.ruby-forum.com/t/generating-ror-application-through-sql-server/146787/2 "2008-08-25T14:01:38Z")

</div>

On Mon, Aug 25, 2008 at 4:46 AM, hema gonaboina  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> 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

---

<div class="post-metadata">

**Author:** ![hema\_mca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hema\_mca](https://www.ruby-forum.com/u/hema_mca)\
**Post date:** [August 25, 2008, 2:57pm UTC](https://www.ruby-forum.com/t/generating-ror-application-through-sql-server/146787/3 "2008-08-25T14:57:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hema\_mca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hema\_mca](https://www.ruby-forum.com/u/hema_mca)\
**Post date:** [September 25, 2008, 7:27am UTC](https://www.ruby-forum.com/t/generating-ror-application-through-sql-server/146787/4 "2008-09-25T07:27:13Z")

</div>

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