Ruby on Rails Friday, May 28, 2010

I have the following code:

----

<h3>Today's Activity</h3>
<hr>

<div id="order">
<% @orders.reverse.each do |order| %>
<%= link_to_remote( "#{order.id} &nbsp &nbsp &nbsp #{order.name}" ,
:url => {:controller => 'orders', :action => 'show', :id => order.id },
:update => "order_div", :method => 'get' ) %>

<% end %>
</div>

----

This code works great. Does exactly what I need. I'm displaying the
order id and customer name on the order. I have the newest one on top by
using the reverse method.

What I need to be able to do is where it has "Today's" in the h3 tag, I
want to created a dropdown that people can select: Today, Yesterday, One
Week, 2 Weeks, One Month, All, etc.

I don't know what kind of logic I'll need to make sure that the only
orders showing are those connected to one of those actions in the
dropdown list. Only that I'll need to call the create date field in the
db.

I've gone through a few ruby on rails books and a ruby book. This is the
my first personal project that I've worked on, so I'm not sure how to
complete this. Any help would be appreciated.
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment