This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 144446 - Add Code Templates for Rails 2.0 +
Summary: Add Code Templates for Rails 2.0 +
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@ruby
Depends on:
Reported: 2008-08-19 19:50 UTC by Chris Kutler
Modified: 2011-01-28 20:12 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Chris Kutler 2008-08-19 19:50:22 UTC
Some of the code templates are not helpful for Rails 2+ projects, which uses named routes by default.

For example, 

ft expands to <%= form_tag :action => "${1 default="update"}" %>

But the Rails 2 api for form_tag is 

form_tag(url_for_options, options, *parameters_for_url, &block)
options are:
:multipart - If set to true, the enctype is set to "multipart/form-data".
:method - The method to use when submitting the form, usually either "get" or "post". If "put", "delete", or another
verb is used, a hidden input with name _method is added to simulate the verb over post.
A list of parameters to feed to the URL the form will be posted to.

There are several link_to expansions that specify :controller and :action, but none for the 7 REST named routes, such as 

<%= link_to 'Show', @post %> |
<%= link_to 'Back', posts_path %>
<%= link_to 'New post', new_post_path %>
<%= link_to 'Edit', edit_post_path(@post) %>