hi,
have a JOB-model, which belongs_to a variety of other models, eg:
Industry, Category etc...
i have:
######################
controller:
def browse
@jobs = Job.all
@jobind = JobIndustry.all
@jobcat = JobCategory.all
@joblevelexp = LevelOfExperience.all
@joblevelcareer = LevelOfCareer.all
@jobleveledu = LevelOfEdu.all
@jobyearsexp = YearsOfExperience.all
@joblocation = JobLocation.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @jobs }
end
end
######################
view:
literates through all the variables from the controller, and displays
them each a html-div including a COUNT of the JOBS.
######################
question:
i want to transform the html-output into a link, so that if i click eg
onto the INDUSTRY: "Telephone" or whatever, i want the whole result to
be filtered. not sure how to do that...
an live example is monster.com, when u got o browse jobs.
//this is just a learning platform
thx tom
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
am i better of with that ?(from the api): Post.find(:all, :include => [ :author, :comments ], :conditions => [''comments.approved = ?'', true]) can i add as many conditions as i want to the individual associations? thx On Tue, Feb 16, 2010 at 3:29 PM, tom <tomabroad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi, > > have a JOB-model, which belongs_to a variety of other models, eg: > Industry, Category etc... > i have: > ###################### > controller: > > def browse > @jobs = Job.all > > @jobind = JobIndustry.all > @jobcat = JobCategory.all > @joblevelexp = LevelOfExperience.all > @joblevelcareer = LevelOfCareer.all > @jobleveledu = LevelOfEdu.all > @jobyearsexp = YearsOfExperience.all > @joblocation = JobLocation.all > > > > respond_to do |format| > format.html # index.html.erb > format.xml { render :xml => @jobs } > end > end > ###################### > view: > literates through all the variables from the controller, and displays > them each a html-div including a COUNT of the JOBS. > > ###################### > question: > > i want to transform the html-output into a link, so that if i click eg > onto the INDUSTRY: "Telephone" or whatever, i want the whole result to > be filtered. not sure how to do that... > > an live example is monster.com, when u got o browse jobs. > > //this is just a learning platform > > thx tom >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Check out the searchlogic gem, it will make your life way easier on this. Jarin Udom Robot Mode LLC On Feb 16, 12:29 pm, tom <tomabr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi, > > have a JOB-model, which belongs_to a variety of other models, eg: > Industry, Category etc... > i have: > ###################### > controller: > > def browse > @jobs = Job.all > > @jobind = JobIndustry.all > @jobcat = JobCategory.all > @joblevelexp = LevelOfExperience.all > @joblevelcareer = LevelOfCareer.all > @jobleveledu = LevelOfEdu.all > @jobyearsexp = YearsOfExperience.all > @joblocation = JobLocation.all > > respond_to do |format| > format.html # index.html.erb > format.xml { render :xml => @jobs } > end > end > ###################### > view: > literates through all the variables from the controller, and displays > them each a html-div including a COUNT of the JOBS. > > ###################### > question: > > i want to transform the html-output into a link, so that if i click eg > onto the INDUSTRY: "Telephone" or whatever, i want the whole result to > be filtered. not sure how to do that... > > an live example is monster.com, when u got o browse jobs. > > //this is just a learning platform > > thx tom-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.