On an application I’ve been working during my spare time, I had the need to ask my loyal friends and guinea pigs to give me some feedback, in order to help me fill in the gaps between what I think they want to do and what they really want to do in this application.
A quick, cheap and really useful solution I came up with was adding a feedback form right there, on every page the application renders. This can certainly be improved by people more knowledgeable in Rails than myself, as for now it doesn’t even use AJAX to post the data back (shame, shock and horror!)
After running scaffold_resource Comment body:text uri:string created_by:integer created_at:timestamp, you should be pretty much set to go. Now, on your application.rhtml, you can do something like:
<%= render :partial => "comment", :collection =>
Comment.find_all_by_uri(request.request_uri) %> <% form_for :comment, Comment.new, :url => comments_path do |f| %> <%= f.hidden_field :uri, :value => request.request_uri %> How would you improve this page? <%= f.text_area :body, :rows => 5 %> <%= submit_tag 'Add comment' %> <% end %>
The _comment.rhtml partial is something like this:
<%= comment.body %>
Created by <%= if comment.created_by.nil?
'unknown'
else
link_to(comment.created_by.name,
profile_url(comment.created_by.profile))
end %>
<%= time_ago_in_words comment.created_at %> ago
[<%= link_to 'Destroy', comment_path(comment.id), :method => :delete %>]
Customize the Comment controller slightly, and that’s it — instant feedback forms everywhere! ![]()

Douglas Ausech | 08-Feb-07 at 10:31 pm | Permalink
Your idea is cool, but I’d simply put a link in the bottom and when the user clicks, the textarea is shown.
BTW you are just coding in RoR in your spare time? Are there serious projects being developed by TW using Rails?
Carlos Villela | 15-Feb-07 at 12:14 pm | Permalink
Hiding the stuff behind a link can certainly be done – we didn’t want to do it just now because there’s still a LOT to discuss, and I wanted the feedback to be as fluid as possible, even if it takes a lot of screen space.
About Rails at ThoughtWorks, yes, we’re going lots of it (see other blogs at http://blogs.thoughtworls.com). It just so happens I’m not currently assigned to a Rails projec