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.. Regards, Harish -- Posted via http://www.ruby-forum.com/.
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 help. good luck... -- Posted via http://www.ruby-forum.com/.
Hi, 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. Regards, Harish -- Posted via http://www.ruby-forum.com/.
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 api.rubyonrails.org 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.
On 7/4/06, Naga Harish Kanegolla <harish4groups@gmail.com>
wrote:> Hi,
>
> 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.
>
> Regards,
> Harish
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Jonathan Viney wrote:> <%= select_tag ''projects_month'', option_tags %> > <%= observe_field ''projects_month'', :url => { :controller => > ''projects'', :action => ''update_list'' }, :with => ''month'' %> >> -Jonathan.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 change. can u please explain in detail how to do that?? Regards, Harish -- Posted via http://www.ruby-forum.com/.