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 144732 - Run file from controller or view doesn't work with named routes (Rails 2+)
Summary: Run file from controller or view doesn't work with named routes (Rails 2+)
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Rails (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-21 16:28 UTC by Chris Kutler
Modified: 2011-01-28 20:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Kutler 2008-08-21 16:28:17 UTC
When you press Shift+F6 from within a controller or view file the IDE attempts to run the action in which you placed the
cursor. If you are using RESTful routes or the route requires data, the browser displays an error message such as
Couldn’t find Recipe with ID=show. When this happens, you must rewrite the URL. For example, you would change
http://localhost:3000/recipies/show to http://localhost:3000/recipies/1.

AR wrote:
There are all sorts of "smarts" the IDE could try to use to improve
the situation, but I'm not sure if it is worth the effort. The routes
can be introspected to see what (if any) dynamic content they require,
as per the "routes" rake task.

Perhaps the IDE could use simple name association and if the action
name matches one of the default RESTful names assume the URL format of
that Rest Action and inject a default index value or prompt for the
record, or just load the index action if some sort of dynamic content
is required in the URL.

Tor wrote:
It looks like the algorithm which computes an automatic URL for the browser from the controller will need to be
enhanced; the old algorithm predicted what the default routes setup would do. It sounds like we need to make it a bit
smarter now.
Comment 1 Erno Mononen 2009-05-21 13:44:48 UTC
Still valid.