I''m having some trouble figuring out how to break a project into various controllers. Here''s my situation. Say I''m building a small web store that sells software. Each piece of software will belong to a given Vendor. Ok, so there are my two models ''Software'' and ''Vendor''. I''d like to be able to do basic CRUD on both a Vendor and and or a Product. However, I want the Vendor to be a sort of Gateway to the Product. So let''s say I create the basic CRUD actions for the Vendor. If I''m viewing a Vendor''s info--name, address, url, etc-- that''s where I would also see options like: ''List Products'', ''Create Product''. So the real question is should I use one controller or two controllers? If I used one controller I would have actions like: /admin/vendor/add /admin/vendor/list /admin/vendor/view /admin/vendor/add_product /admin/vendor/list_products /admin/vendor/view_product If I used two controllers: /admin/vendor/add /admin/vendor/list /admin/vendor/view /admin/product/add /admin/product/list /admin/product/view Thanks, Steven -- Posted via http://www.ruby-forum.com/.
This is probably very subjective, but I build a controller for each ''gateway'' as you put it. For example, I would build a vendor controller that allowed the vendor to do everything that was needed for its interface. I usually name my actions things like "vendor_add", "vendor_edit", "product_add", "product_destroy", etc just to make it more clear when reviewing later. I suppose the next step would be an interface for customers, which you might just call ''store'' or something like that. Hope this makes sense, Michael On 11/21/05, Steven <runner-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> <runner-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> <runner-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:> > I''m having some trouble figuring out how to break a project into various > controllers. Here''s my situation. Say I''m building a small web store > that sells software. Each piece of software will belong to a given > Vendor. > > Ok, so there are my two models ''Software'' and ''Vendor''. I''d like to be > able to do basic CRUD on both a Vendor and and or a Product. However, I > want the Vendor to be a sort of Gateway to the Product. So let''s say I > create the basic CRUD actions for the Vendor. If I''m viewing a Vendor''s > info--name, address, url, etc-- that''s where I would also see options > like: ''List Products'', ''Create Product''. > > So the real question is should I use one controller or two controllers? > > If I used one controller I would have actions like: > /admin/vendor/add > /admin/vendor/list > /admin/vendor/view > /admin/vendor/add_product > /admin/vendor/list_products > /admin/vendor/view_product > > If I used two controllers: > /admin/vendor/add > /admin/vendor/list > /admin/vendor/view > /admin/product/add > /admin/product/list > /admin/product/view > > Thanks, > Steven > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
i do something like this, using the 2 controller method, within /vendor/view, do: link_to "view products for this vendor", :controller => "product", :action => :list, :criteria => "vendor", :id => @vendor.id <http://vendor.id> link_to "add new products for this vendor", :controller => "product", :action => :new, :criteria => "vendor", :id => @vendor.id <http://vendor.id> in routes.rb, add (above the default route): map.connect "/product/list/:criteria/:id", :controller => "product", :action => "list", :criteria => nil, :id => nil, :requirements => { :id => /\d+/ } map.connect "/product/list/:criteria/:id", :controller => "product", :action => "add", :criteria => nil, :id => nil, :requirements => { :id => /\d+/ } then in product controller: class ProductController < ApplicationController def list case @params[:criteria] when "vendor" # list products for a specific vendor @products = Product.find_by_vendor_id(@params[:id]) else # otherwise just list all products @products = Product.find_all end end def new case @params[:criteria] when "vendor" # new product for a specific vendor (preset the vendor id so it is selected in the view form) @product = Product.new(:vendor_id => @params[:id]) else @product = Product.new end end end in the new.rhtml view, do: <%= start_form_tag :action => :create %> .<%= text_field("product", "name") %> <%= select("product", "vendor_id", Vendor.find(:all).collect { |v| [v.name<http://v.name>, v.id <http://v.id>] }, { :include_blank => true }) %> <%= submit_tag "save product" %> <% end_form_tag %> this should automatically select the vendor in the select options hope this helps Chris On 11/21/05, Steven <runner-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> <runner-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> < runner-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:> > > I''m having some trouble figuring out how to break a project into various > controllers. Here''s my situation. Say I''m building a small web store > that sells software. Each piece of software will belong to a given > Vendor. > > Ok, so there are my two models ''Software'' and ''Vendor''. I''d like to be > able to do basic CRUD on both a Vendor and and or a Product. However, I > want the Vendor to be a sort of Gateway to the Product. So let''s say I > create the basic CRUD actions for the Vendor. If I''m viewing a Vendor''s > info--name, address, url, etc-- that''s where I would also see options > like: ''List Products'', ''Create Product''. > > So the real question is should I use one controller or two controllers? > > If I used one controller I would have actions like: > /admin/vendor/add > /admin/vendor/list > /admin/vendor/view > /admin/vendor/add_product > /admin/vendor/list_products > /admin/vendor/view_product > > If I used two controllers: > /admin/vendor/add > /admin/vendor/list > /admin/vendor/view > /admin/product/add > /admin/product/list > /admin/product/view > > Thanks, > Steven > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Mike, Chris Thanks for the feedback. I think I may go with the two controller method since this is how I''ve done things in the past with the PHP framework I was using. -Steven -- Posted via http://www.ruby-forum.com/.
@Chris....or anyone else who has an opinion Thanks again for you detailed example. Just getting around to figuring out how the whole Map.connect thing works and I''m a bit blown away at it''s power. The more I use rails the more I like it :) Anyway, in your previous post you mentioned how one option is to pass the id of the vendor into the product controller. Then you could do product actions specific to the vendor with a url like: product/list/vendor/5 product/new/vendor/5 product/edit/66/vendor/5 ok so my questions is about passing the vendor id around. I guess I''m just lazy and wondering why not just set a session parameter and the forget about passing the vendor id around while in the product controller. What if in product/list I did something like: def list if params[:criteria] == ''vendor'' && !params[:vendor_id].nil? session[:vendor] ||= Vendor.find(params[:vendor_id] # get list of products for this vendor else # get list of all products end end Then in the rest of my product controller''s actions I could just check to see if session[:vendor] is set, and act accordingly. In vendor/list I could just blow the session var away ''session[:vendor] = nil'' Anyway, I''ve done this type of thing in the past with php and it''s worked fairly well. Just wondering if perhaps doing this may come back to bite me and or if it violates any rails best practices. -Steven -- Posted via http://www.ruby-forum.com/.
if you notice, the only time the vendor info is getting passed via the URL is when I am requesting information. so for list and new actions, i would use: /product/list/vendor/X # list products for vendor X /product/new/vendor/X # show new product for and pre-select vendor X in the ''new'' form where X is the vendor id i wouldn''t use it for the edit action, since the vendor would already exist for that product, so a simple /product/edit/X (where X is the product ID) would suffice. for create and update actions, the vendor ID would be submitted in the form so you really aren''t passing around the vendor ID except for those 2 situations. it''s just my way of doing it. i''m sure there are just as many other valid ways to accomplish the same thing. to me, it''s intiuitive and easy to follow. Chris On 11/27/05, Steven Hansen <runner-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:> > @Chris....or anyone else who has an opinion > > Thanks again for you detailed example. Just getting around to figuring > out how the whole Map.connect thing works and I''m a bit blown away at > it''s power. > The more I use rails the more I like it :) > > Anyway, in your previous post you mentioned how one option is to pass > the id of the vendor into the product controller. Then you could do > product actions specific to the vendor with a url like: > > product/list/vendor/5 > product/new/vendor/5 > product/edit/66/vendor/5 > > ok so my questions is about passing the vendor id around. I guess I''m > just lazy and wondering why not just set a session parameter and the > forget about passing the vendor id around while in the product > controller. What if in product/list I did something like: > > def list > if params[:criteria] == ''vendor'' && !params[:vendor_id].nil? > session[:vendor] ||= Vendor.find(params[:vendor_id] > # get list of products for this vendor > else > # get list of all products > end > end > > Then in the rest of my product controller''s actions I could just check > to see if session[:vendor] is set, and act accordingly. In vendor/list > I could just blow the session var away ''session[:vendor] = nil'' > > Anyway, I''ve done this type of thing in the past with php and it''s > worked fairly well. Just wondering if perhaps doing this may come back > to bite me and or if it violates any rails best practices. > > -Steven > > > > > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi. I''m hoping someone can help me with this. (*Please*) Some background. My application is to help people complete a course (sort of). The course consists of different Programs that have many Categories that have many Tasks Up to there Im mostly ok. All the things listed above are set values except the tasks. For each category there is a list of Tasks. This list may have 12 tasks, with the posibility of the user making task 13 up themselves. They choose 8 to complete. So most of the tasks are hard coded for the program and category. Now to the question.... How do I allow a user to make up task 13? Where do I keep the information for the tasks selected, and also one record per task that collected some information about it for that user? I''m not even sure how to design the database with this one... I would love any help anyone could give me. Cheers Dan _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
can you post the db schema and models that you have so far? On 11/28/05, Liquid <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi. I''m hoping someone can help me with this. (*Please*) > > Some background. My application is to help people complete a course (sort > of). > > The course consists of different > > Programs that have many > Categories that have many > Tasks > > Up to there Im mostly ok. All the things listed above are set values > except the tasks. > > For each category there is a list of Tasks. This list may have 12 tasks, > with the posibility of the user making task 13 up themselves. They choose 8 > to complete. > > So most of the tasks are hard coded for the program and category. > > Now to the question.... > > How do I allow a user to make up task 13? > > Where do I keep the information for the tasks selected, and also one > record per task that collected some information about it for that user? > > I''m not even sure how to design the database with this one... > > I would love any help anyone could give me. > > Cheers > Dan > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I''m sorry I can''t... I''m not sure even where to start. The programs, categories, and most of the tasks are entered into the db by the admin. Users don''t have to worry about them, just be able to select them and have them assigned to them with some other information. They do have to be able to enter task 13 that is associated with them and a cateogy. I''m not even sure what method I would put onto the user to find their tasks. Maybe something like @user.program(''SomeProgram'').category(''someCategory'').tasks.each do something Just to try a different angle. I have a set list of items (sort of) that are assigned to many people to complete. Each list has a number of items to complete. ie. any 6 to complete. The user can then select which items from that list that they want to complete. Each person can have their own individual attributes assiged to each item( ie comments, dates etc). Each list belongs to a category, and may have one user defined item in it along with the set items depending on the program and category the list is in. This is all part of a program. Different programs can have categories that are named the same as categories in other programs, but has it''s own list items. I am totally lost on how to implement this. On 11/29/05, Peter Michaux <petermichaux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > can you post the db schema and models that you have so far? > > > > On 11/28/05, Liquid <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi. I''m hoping someone can help me with this. (*Please*) > > > > Some background. My application is to help people complete a course > > (sort of). > > > > The course consists of different > > > > Programs that have many > > Categories that have many > > Tasks > > > > Up to there Im mostly ok. All the things listed above are set values > > except the tasks. > > > > For each category there is a list of Tasks. This list may have 12 > > tasks, with the posibility of the user making task 13 up themselves. They > > choose 8 to complete. > > > > So most of the tasks are hard coded for the program and category. > > > > Now to the question.... > > > > How do I allow a user to make up task 13? > > > > Where do I keep the information for the tasks selected, and also one > > record per task that collected some information about it for that user? > > > > I''m not even sure how to design the database with this one... > > > > I would love any help anyone could give me. > > > > Cheers > > Dan > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
How about implementing it without the 13th task and then see where the 13th task will fit into the schema? Peter _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
OK... if you can''t post a sample schema, how about a concrete example of a user, in a program with multiple categories and tasks? Doesn''t need to be fancy, or even real data, just a sample of what the existing system looks like. Is this data being managed at the moment? Are there any clues in the current system for how a given set of data lives, or is associated? Particularly to a user. It also might be a better idea to tackle this problem bottom-up, rather than top-down. Figure out how you need to represent the tasks and then put categories on top of that, and then put programs on top of that... -Brian Liquid wrote:> I''m sorry I can''t... I''m not sure even where to start. > > The programs, categories, and most of the tasks are entered into the db > by the admin. Users don''t have to worry about them, just be able to > select them and have them assigned to them with some other information. > > They do have to be able to enter task 13 that is associated with them > and a cateogy. > > I''m not even sure what method I would put onto the user to find their > tasks. Maybe something like > > @user.program(''SomeProgram'').category(''someCategory'').tasks.each do > something > > Just to try a different angle. > > I have a set list of items (sort of) that are assigned to many people to > complete. Each list has a number of items to complete. ie. any 6 to > complete. The user can then select which items from that list that they > want to complete. Each person can have their own individual attributes > assiged to each item( ie comments, dates etc). Each list belongs to a > category, and may have one user defined item in it along with the set > items depending on the program and category the list is in. This is all > part of a program. Different programs can have categories that are > named the same as categories in other programs, but has it''s own list > items. > > I am totally lost on how to implement this.
I''ll try to give an example... This is trying to go from a manual system that is not managed very well at all at the moment. A user may be enrolled in Programming 101 (Program Level) The user is then required to select (categories are not optional) OO (Category) (Select 2) (The task list) 1. Identify What obejects are and write a bit about them 2. Complete a class definition 3. Think of 5 ways to use an object in a sentence. 4. Make up your own task to show you know what''s going on Rails (Category)(Select 4) (the task list) 1. Identify the rules for table and field pluralisation in rails 2. Write a simple todo app 3. Identify what a plugin is 4. Use a plugin in a sample app 5. Use a file upload in a sample app 6. Use a generator 7. Make up your own task to show you know what''s going on Web Servers (Category) (Select 3) 1. What does a web server do? 2. Install your own web server and enable rails on it 3. Identify 10 security issues that you should prevent on your server. Each of these tasks will then have a todo list associated with them for that user. I don''t really have a probelm with that part. Just the above... How do I have a set list of things for ppl to do, and then store their responses? (as well as the "make up your own tasks") Thanx for helping... On 11/29/05, Brian V. Hughes <brianvh-ilmOVS5JQ6Xj7r8U7pfrKh2eb7JE58TQ@public.gmane.org> wrote:> > > OK... if you can''t post a sample schema, how about a concrete example of a > user, > in a program with multiple categories and tasks? Doesn''t need to be fancy, > or > even real data, just a sample of what the existing system looks like. > > Is this data being managed at the moment? Are there any clues in the > current > system for how a given set of data lives, or is associated? Particularly > to a user. > > It also might be a better idea to tackle this problem bottom-up, rather > than > top-down. Figure out how you need to represent the tasks and then put > categories > on top of that, and then put programs on top of that... > > -Brian > > Liquid wrote: > > I''m sorry I can''t... I''m not sure even where to start. > > > > The programs, categories, and most of the tasks are entered into the db > > by the admin. Users don''t have to worry about them, just be able to > > select them and have them assigned to them with some other information. > > > > They do have to be able to enter task 13 that is associated with them > > and a cateogy. > > > > I''m not even sure what method I would put onto the user to find their > > tasks. Maybe something like > > > > @user.program(''SomeProgram'').category(''someCategory'').tasks.each do > > something > > > > Just to try a different angle. > > > > I have a set list of items (sort of) that are assigned to many people to > > complete. Each list has a number of items to complete. ie. any 6 to > > complete. The user can then select which items from that list that they > > want to complete. Each person can have their own individual attributes > > assiged to each item( ie comments, dates etc). Each list belongs to a > > category, and may have one user defined item in it along with the set > > items depending on the program and category the list is in. This is all > > part of a program. Different programs can have categories that are > > named the same as categories in other programs, but has it''s own list > > items. > > > > I am totally lost on how to implement this. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
It looks like what is important is linking students to tasks with has_and_belongs_to_many CREATE TABLE students_tasks ... It looks like you will have models for Program, Category, Task, and Student. In the Program model, you could have a class method that receives a student and checks that the student has satisfied the requirements of each Category and therefore the program. if each category returns true then this method returns true In the Category model, a class method that receives a student and checks that the student has satified all the requirements of the Category. In the Student model, have an instance method in that calls Program''s class method I mentioned above. Maybe that is good or maybe it is just drivel I typed. But I hope it helps. Peter On 11/28/05, Liquid <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''ll try to give an example... This is trying to go from a manual system > that is not managed very well at all at the moment. > > A user may be enrolled in > > Programming 101 (Program Level) > > The user is then required to select (categories are not optional) > > OO (Category) (Select 2) > (The task list) > 1. Identify What obejects are and write a bit about them > 2. Complete a class definition > 3. Think of 5 ways to use an object in a sentence. > 4. Make up your own task to show you know what''s going on > > Rails (Category)(Select 4) > (the task list) > 1. Identify the rules for table and field pluralisation in rails > 2. Write a simple todo app > 3. Identify what a plugin is > 4. Use a plugin in a sample app > 5. Use a file upload in a sample app > 6. Use a generator > 7. Make up your own task to show you know what''s going on > > Web Servers (Category) (Select 3) > 1. What does a web server do? > 2. Install your own web server and enable rails on it > 3. Identify 10 security issues that you should prevent on your server. > > Each of these tasks will then have a todo list associated with them for > that user. I don''t really have a probelm with that part. Just the above... > > > How do I have a set list of things for ppl to do, and then store their > responses? (as well as the "make up your own tasks") > > Thanx for helping... > > > > > > > > On 11/29/05, Brian V. Hughes <brianvh-ilmOVS5JQ6Xj7r8U7pfrKh2eb7JE58TQ@public.gmane.org> wrote: > > > > > > OK... if you can''t post a sample schema, how about a concrete example of > > a user, > > in a program with multiple categories and tasks? Doesn''t need to be > > fancy, or > > even real data, just a sample of what the existing system looks like. > > > > Is this data being managed at the moment? Are there any clues in the > > current > > system for how a given set of data lives, or is associated? Particularly > > to a user. > > > > It also might be a better idea to tackle this problem bottom-up, rather > > than > > top-down. Figure out how you need to represent the tasks and then put > > categories > > on top of that, and then put programs on top of that... > > > > -Brian > > > > Liquid wrote: > > > I''m sorry I can''t... I''m not sure even where to start. > > > > > > The programs, categories, and most of the tasks are entered into the > > db > > > by the admin. Users don''t have to worry about them, just be able to > > > select them and have them assigned to them with some other > > information. > > > > > > They do have to be able to enter task 13 that is associated with them > > > and a cateogy. > > > > > > I''m not even sure what method I would put onto the user to find their > > > tasks. Maybe something like > > > > > > @user.program(''SomeProgram'').category(''someCategory'').tasks.each do > > > something > > > > > > Just to try a different angle. > > > > > > I have a set list of items (sort of) that are assigned to many people > > to > > > complete. Each list has a number of items to complete. ie. any 6 to > > > complete. The user can then select which items from that list that > > they > > > want to complete. Each person can have their own individual > > attributes > > > assiged to each item( ie comments, dates etc). Each list belongs to a > > > category, and may have one user defined item in it along with the set > > > items depending on the program and category the list is in. This is > > all > > > part of a program. Different programs can have categories that are > > > named the same as categories in other programs, but has it''s own list > > > items. > > > > > > I am totally lost on how to implement this. > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Thanx Peter, That sounds like it should work.. Just one more question though. Where do I store the answers to the tasks though. The tasks need an entry in the db to say what they are (lets me print out the questions). Then each student needs to log in and provide an answer to each task/question. Where does that go? Cheers On 11/29/05, Peter Michaux <petermichaux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > It looks like what is important is linking students to tasks with > has_and_belongs_to_many > > CREATE TABLE students_tasks ... > > It looks like you will have models for Program, Category, Task, and > Student. > > In the Program model, you could have a class method that receives a > student and checks that the student has satisfied the requirements of each > Category and therefore the program. if each category returns true then this > method returns true > > In the Category model, a class method that receives a student and checks > that the student has satified all the requirements of the Category. > > In the Student model, have an instance method in that calls Program''s > class method I mentioned above. > > Maybe that is good or maybe it is just drivel I typed. But I hope it > helps. > > Peter > > > > On 11/28/05, Liquid <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I''ll try to give an example... This is trying to go from a manual > > system that is not managed very well at all at the moment. > > > > A user may be enrolled in > > > > Programming 101 (Program Level) > > > > The user is then required to select (categories are not optional) > > > > OO (Category) (Select 2) > > (The task list) > > 1. Identify What obejects are and write a bit about them > > 2. Complete a class definition > > 3. Think of 5 ways to use an object in a sentence. > > 4. Make up your own task to show you know what''s going on > > > > Rails (Category)(Select 4) > > (the task list) > > 1. Identify the rules for table and field pluralisation in rails > > 2. Write a simple todo app > > 3. Identify what a plugin is > > 4. Use a plugin in a sample app > > 5. Use a file upload in a sample app > > 6. Use a generator > > 7. Make up your own task to show you know what''s going on > > > > Web Servers (Category) (Select 3) > > 1. What does a web server do? > > 2. Install your own web server and enable rails on it > > 3. Identify 10 security issues that you should prevent on your server. > > > > Each of these tasks will then have a todo list associated with them for > > that user. I don''t really have a probelm with that part. Just the above... > > > > > > How do I have a set list of things for ppl to do, and then store their > > responses? (as well as the "make up your own tasks") > > > > Thanx for helping... > > > > > > > > > > > > > > > > On 11/29/05, Brian V. Hughes <brianvh-ilmOVS5JQ6Xj7r8U7pfrKh2eb7JE58TQ@public.gmane.org> wrote: > > > > > > > > > OK... if you can''t post a sample schema, how about a concrete example > > > of a user, > > > in a program with multiple categories and tasks? Doesn''t need to be > > > fancy, or > > > even real data, just a sample of what the existing system looks like. > > > > > > Is this data being managed at the moment? Are there any clues in the > > > current > > > system for how a given set of data lives, or is associated? > > > Particularly to a user. > > > > > > It also might be a better idea to tackle this problem bottom-up, > > > rather than > > > top-down. Figure out how you need to represent the tasks and then put > > > categories > > > on top of that, and then put programs on top of that... > > > > > > -Brian > > > > > > Liquid wrote: > > > > I''m sorry I can''t... I''m not sure even where to start. > > > > > > > > The programs, categories, and most of the tasks are entered into the > > > db > > > > by the admin. Users don''t have to worry about them, just be able to > > > > select them and have them assigned to them with some other > > > information. > > > > > > > > They do have to be able to enter task 13 that is associated with > > > them > > > > and a cateogy. > > > > > > > > I''m not even sure what method I would put onto the user to find > > > their > > > > tasks. Maybe something like > > > > > > > > @user.program(''SomeProgram'').category(''someCategory'').tasks.each do > > > > something > > > > > > > > Just to try a different angle. > > > > > > > > I have a set list of items (sort of) that are assigned to many > > > people to > > > > complete. Each list has a number of items to complete. ie. any 6 > > > to > > > > complete. The user can then select which items from that list that > > > they > > > > want to complete. Each person can have their own individual > > > attributes > > > > assiged to each item( ie comments, dates etc). Each list belongs to > > > a > > > > category, and may have one user defined item in it along with the > > > set > > > > items depending on the program and category the list is in. This is > > > all > > > > part of a program. Different programs can have categories that are > > > > named the same as categories in other programs, but has it''s own > > > list > > > > items. > > > > > > > > I am totally lost on how to implement this. > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 11/29/05, Liquid <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Thanx Peter, > > That sounds like it should work.. > > Just one more question though. > > Where do I store the answers to the tasks though. The tasks need an entry > in the db to say what they are (lets me print out the questions). Then each > student needs to log in and provide an answer to each task/question. Where > does that go?What is an answer to a task? Is a task a question or something that must be completed? I think if it is a question then the answer goes in the students_tasks table as an extra feild. That way the answer for a particular student and a particular task is identifiable. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Thanx everyone for your help.. I think I should be able to get it to work. Cheers On 11/30/05, Peter Michaux <petermichaux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On 11/29/05, Liquid <has.sox-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Thanx Peter, > > > > That sounds like it should work.. > > > > Just one more question though. > > > > Where do I store the answers to the tasks though. The tasks need an > > entry in the db to say what they are (lets me print out the questions). > > Then each student needs to log in and provide an answer to each > > task/question. Where does that go? > > > > What is an answer to a task? Is a task a question or something that must > be completed? I think if it is a question then the answer goes in the > students_tasks table as an extra feild. That way the answer for a particular > student and a particular task is identifiable. > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails