[Rails] development speed boosters

2009-03-09 Thread Roger Muthton
anyone know of any good development speed booster plugins or gems? the larger my app becomes, the slower development time becomes.. getting painfully slow.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are s

[Rails] Re: variable variable names... are you confused??

2009-03-06 Thread Roger Muthton
> Just declare a parameter in your helper method à la: > > def render_blocks(my_variable) > my_variable.collect > end > > You then call it in your view and pass the variable that is valid for > that view. > > <%= render_blocks(@free) %> grand. cheers -- Posted via http://www.ruby-forum.co

[Rails] variable variable names... are you confused??

2009-03-06 Thread Roger Muthton
Hi Guys, I got a helper method that I want to use more than once. The only thing that will change will be the variable that is used to collect the data. For example; def render_blocks position = 0 @variable.collect { |question, answer| position += 1 "#{position}. #{question}"

[Rails] check if controller action??

2009-02-18 Thread Roger Muthton
Hi Chaps, How can I check if the page is using a controllers action. for example i got a helper method that needs to know if a certain controller action is run on the page or not so as to display different content for it. Thought it was just code = "xyz" if Controllername.action? Cheers, Rog

[Rails] Re: partials and comments and other fun things!

2009-01-09 Thread Roger Muthton
> > Can you try this in your console? > > m = Message.find(:first) > c = m.comments.new > > That should automatically set c.message_id to m.id to make the > association. > > Franz yep that works spot on. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~--

[Rails] Re: partials and comments and other fun things!

2009-01-09 Thread Roger Muthton
Franz Strebel wrote: > On Thu, Jan 8, 2009 at 6:59 PM, Roger Muthton > wrote: >> <% for message in @messages %> >> <%= render :partial => @comment = Comment.new, :locals => { :button_name >> => 'Post'}%> >> <% end %> > >

[Rails] Re: partials and comments and other fun things!

2009-01-08 Thread Roger Muthton
> > It is better practice to have a CommentsController to operate on your > comments instead > of using the Messages controller. I highly suggest that you then use > this tutorial as your > starting point to move forward: > > http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-fi

[Rails] Re: partials and comments and other fun things!

2009-01-08 Thread Roger Muthton
Franz Strebel wrote: > On Thu, Jan 8, 2009 at 3:26 PM, Roger Muthton > wrote: >> >> Hey folks, first timer here so be gentle. I have a messages page which >> uses a partial to display comments for each message for an article and a >> little box under each message

[Rails] partials and comments and other fun things!

2009-01-08 Thread Roger Muthton
Hey folks, first timer here so be gentle. I have a messages page which uses a partial to display comments for each message for an article and a little box under each message so people can comment on that message. located at http://localhost:3000/articles/6/messages . partial code <%= rend