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
> 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
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}"
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
>
> 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/.
--~--~-~--~~~--
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 %>
>
>
>
> 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
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
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
9 matches
Mail list logo