# Dynamic select list @www.stonemind.net

**URL:** <https://www.ruby-forum.com/t/dynamic-select-list-www-stonemind-net/133954>\
**Category:** Rails\
**Created:** [April 5, 2008, 3:29pm UTC](https://www.ruby-forum.com/t/dynamic-select-list-www-stonemind-net/133954 "2008-04-05T15:29:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![drorchung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@drorchung](https://www.ruby-forum.com/u/drorchung)\
**Post date:** [April 5, 2008, 3:29pm UTC](https://www.ruby-forum.com/t/dynamic-select-list-www-stonemind-net/133954/1 "2008-04-05T15:29:54Z")

</div>

Hi,  
Has anyone read the web page by â€œAdding Dynamic Select Lists to  
Resource Scaffolding in Railsâ€ at

> **[Stonemind Consulting - Software Development](https://stonemind.net)**
>
> Although my primary language for many years has been Java (I was an early adopter of the Struts framework, for example), I have years of experience in PHP, Python and Perl as well.

by Adam Smith. The logic is easy to follow. The codes are easy too.

I followed the tutorial. I worked thru it twice. I might have  
misplaced one or two lines of the codes. I got errors and errors. They  
want us to buy the book. Any advice?  
regards,

---

<div class="post-metadata">

**Author:** ![drorchung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@drorchung](https://www.ruby-forum.com/u/drorchung)\
**Post date:** [April 5, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/dynamic-select-list-www-stonemind-net/133954/2 "2008-04-05T15:37:31Z")

</div>

On Apr 5, 2:29 pm, Dror C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,  
> Has anyone read the web page by “Adding Dynamic Select Lists to  
> Resource Scaffolding in Rails” athttp://www.stonemind.net/blog/2007/09/26/adding-dynamic-select-lists-…  
> by Adam Smith. The logic is easy to follow. The codes are easy too.
> 
> I followed the tutorial. I worked thru it twice. I might have  
> misplaced one or two lines of the codes. I got errors and errors. They  
> want us to buy the book. Any advice?  
> regards,

Hard to say without knowing errors you have got (and where etc…)

Fred

---

<div class="post-metadata">

**Author:** ![drorchung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@drorchung](https://www.ruby-forum.com/u/drorchung)\
**Post date:** [April 5, 2008, 4:09pm UTC](https://www.ruby-forum.com/t/dynamic-select-list-www-stonemind-net/133954/3 "2008-04-05T16:09:03Z")

</div>

Thank you Fred,

I copied all the errors below. I am a non-programmer. I don’t know  
what is wrong with line 13 in categories/new.html.erb. The tutorial  
states that such line is to be inserted into the file in replacing the  
existing parent form field. The originalfile is shown immediately below:

```
<h1>Editing category</h1>

<%= error_messages_for :category %>

<% form_for(@category) do |f| %>
  <p>
   <b>Name</b><br />
    <%= f.text_field :name %>
  </p>

  <p>
    <b>Parent</b><br />
    <%= f.text_field :parent_id %>
  </p>

  <p>
    <%= f.submit "Update" %>
  </p>
<% end %>

<%= link_to 'Show', @category %> |

```

\<%= link\_to ‘Back’, categories\_path %\>  
regards,

Errors:  
Processing CategoriesController#new (for 127.0.0.1 at 2008-04-05  
21:54:56) [GET]  
Session ID:  
BAh7BzoMY3NyZl9pZCIlMTgzNGViZDcyNmI3ZmIwMTU5MDk2YWMxYTUwZjVk%0AOTAiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D–6e8e3ef6b8a0cd94d01e2bfe86ffe0c7a7688f01  
Parameters: {“action”=\>“new”, “controller”=\>“categories”}  
Category Columns (0.002429) SHOW FIELDS FROM `categories`  
Category Load (0.000357) SELECT \* FROM `categories` ORDER BY  
parent\_id, name  
Rendering template within layouts/categories  
Rendering categories/new

ActionView::TemplateError (Couldn’t find template file for  
categories/\_select\_category in ["/var/www/test/app/views"]) on line #13  
of categories/new.html.erb:  
10:  
11:

12: **Parent**  
  
13: \<%= render(:partial =\> “select\_category”) %\>  
14:

  
15:  
16: 

```
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:312:in 

```

`render_file' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:331:in`render’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_view/partials.rb:117:in  
`render_partial' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:26:in`benchmark’  
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in`realtime’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/benchmarking.rb:26:in  
`benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/partials.rb:116:in`render\_partial’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_view/base.rb:352:in  
`render' app/views/categories/new.html.erb:13:in`\_run\_erb\_47app47views47categories47new46html46erb’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_view/helpers/form\_helper.rb:248:in  
`fields_for' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/helpers/form_helper.rb:184:in`form\_for’  
app/views/categories/new.html.erb:5:in  
`_run_erb_47app47views47categories47new46html46erb' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:637:in`send’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_view/base.rb:637:in  
`compile_and_render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_view/base.rb:365:in`render\_template’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_view/base.rb:316:in  
`render_file' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1100:in`render\_for\_file’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:858:in  
`render_with_no_layout' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:872:in`render\_with\_no\_layout’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/layout.rb:262:in  
`render_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in`render’  
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:51:in`render’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:131:in  
`send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:131:in`custom’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:156:in  
`call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:156:in`respond’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:150:in  
`each' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/mime_responds.rb:150:in`respond’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/mime\_responds.rb:107:in  
`respond_to' app/controllers/categories_controller.rb:30:in`new’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:1158:in  
`send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in`perform\_action\_without\_filters’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/filters.rb:697:in  
`call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in`perform\_action\_without\_benchmark’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/benchmarking.rb:68:in  
`perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:in`measure’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/benchmarking.rb:68:in  
`perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in`perform\_action\_without\_caching’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/caching.rb:678:in  
`perform_action' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in`cache’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/query\_cache.rb:8:in  
`cache' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in`perform\_action’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:524:in  
`send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in`process\_without\_filters’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/filters.rb:685:in  
`process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in`process’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/base.rb:388:in  
`process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in`handle\_request’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:115:in  
`dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in`dispatch\_cgi’  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:9:in  
`dispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:in`process’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in  
`synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in`process’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in  
`process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in`each’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in  
`process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in`run’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in  
`initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in`new’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in  
`run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in`initialize’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in  
`new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in`run’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in  
`run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in`each’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in  
`run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in`run’  
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in  
`run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281 /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in`load’  
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:489:in  
`load' /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in`new\_constants\_in’  
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:489:in  
`load' /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’  
/usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in`require’  
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in`require’  
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39  
/usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
script/server:3

Rendering  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/templates/rescues/layout.erb  
(internal\_server\_error)

---

<div class="post-metadata">

**Author:** ![drorchung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@drorchung](https://www.ruby-forum.com/u/drorchung)\
**Post date:** [April 5, 2008, 4:59pm UTC](https://www.ruby-forum.com/t/dynamic-select-list-www-stonemind-net/133954/4 "2008-04-05T16:59:25Z")

</div>

Thank you very very much.

\_select\_category.html.erb was not there because there was a  
\_select\_categories.rhtml.

Ror has been changing all the time.

regards,

---

<div class="post-metadata">

**Author:** ![drorchung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@drorchung](https://www.ruby-forum.com/u/drorchung)\
**Post date:** [April 5, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/dynamic-select-list-www-stonemind-net/133954/5 "2008-04-05T16:17:24Z")

</div>

On Apr 5, 3:09 pm, Dror C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 14:
> 
>   
> 15:  
> 16:

Rails is telling you what the problem is. You’ve told it ‘render me  
the contents of the file \_select\_category.html.erb’ and it’s telling  
you ’ I couldn’t find that file)

Fred

---

<div class="post-metadata">

**Author:** ![drorchung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@drorchung](https://www.ruby-forum.com/u/drorchung)\
**Post date:** [April 5, 2008, 5:07pm UTC](https://www.ruby-forum.com/t/dynamic-select-list-www-stonemind-net/133954/6 "2008-04-05T17:07:58Z")

</div>

On Apr 5, 3:59 pm, Dror C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Thank you very very much.
> 
> \_select\_category.html.erb was not there because there was a  
> \_select\_categories.rhtml.
> 
> Ror has been changing all the time.

.rhtml still works, the problem was of course category vs categories.

Fred
