DebuggingThePluginPortalDemo
Debugging Rails Demo (5 Minutes)
Description
This demo shows the features of the Rails debugger in NetBeans.
Product Versions Supported
NetBeans 6.0 M10
Points to Hit
- You can't do this shit with TextMate bro'
Demo Prep
- This demo is a follow-on to the Agile Development Of The Plugin Portal demo, so complete that demo first.
- Select Tools > Options > Misc > Ruby and select the Fast Debugger (ruby-debug-ide). NetBeans automatically download the gem for you.
Gotchas
- The IDE sometimes throws a NPE trying to set a breakpoint. If this happens, delete your userdir and try again.
- Be careful with Step Into, because the Step Out rarely returns me from where I came. When this happens, I just continue (Ctrl+F5) and repeat the cycle.
Demo
- Show the options and how the Fast Debugger should be enabled. Explain that using the Classic built-in debugger is unbearable. Work on the Fast Debugger is in progress for JRuby, but it's not there yet.
- Set a breakpoint at line 1 of show.rhtml (yes, we can even degug RHTML files).
- Stop the server if it is running and Debug the project.
- Switch to the browser and click the show link.
- Switch to NetBeans and view the local variables under 'self'. It's a great way to see all that is provided for you by the framework: @flash @params, @request, @response, @session, @url to name just a few.
- Look at the @params to see the action, id and controller called.
- Step into Plugin.content_columns method. This is a cool ActiveRecord feature that aims to return an array of columns that only contain content, i.e., no ids.
- Step Out back into the Show.rhtml.
- Continue pressing Step Into until you are in column.human_name. This is another cool ActiveRecord feature that attempts to return the human readable name of a database column name.
- Step Out.
- Hover your mouse over the column.name to see its value as a tool tip.
- Press Continue until the Show page appears.
Next Steps
Demo Cleanup
These are the necessary steps to take in order to successfully run the demo again on the same machine.
- None

