Please help me

Hi all,

I’m getting the list of my projects in the page. But i want to get
the list according the month, i.e., if i select july in the drop down
then i should get the
list of projects done in the month of july…

Please reply…


you should be more specific if you want someone to help you out…
what variables do you have? what methods? do you have a belongs_to
:something relashinship?

if you don’t give any background to the problem, it will be very hard to
good luck…


I’m having problem like this:

wen a user logsin he’ll be able to create a project. after creation the
project he can see the list of projects, so he is having the relation
ship like belongs_to:user in project.rb and has_many:projects in user.rb

now i want the list like if i select a month i should get the projects
in the selected month.


You’ll need a dropdown box with a list of the months. When a month is
selected you can cause a full page reload showing the list of projects
for that month, or use Ajax to just update the list of projects. I’d
go the Ajax route. Something like…

<%= select_tag ‘projects_month’, option_tags %>
<%= observe_field ‘projects_month’, :url => { :controller =>
‘projects’, :action => ‘update_list’ }, :with => ‘month’ %>

Check out for how to use select_tag and
observe_field, that code is probably wrong as it’s just off the top of
my head. You can use RJS in the update_list action to refresh the list
of projects.


Jonathan V. wrote:

<%= select_tag ‘projects_month’, option_tags %>
<%= observe_field ‘projects_month’, :url => { :controller =>
‘projects’, :action => ‘update_list’ }, :with => ‘month’ %>


Hi tried the above one for the dropdown months. If i select the month
“july” or ay other month, then i’m getting the same list with out

can u please explain in detail how to do that??


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs