Domanda

I have a rails app with various models and I want to built an advance search form which should be something like this -

Search For --- Model1 Model2 Model3 Search By -- In case of Model1 selected Search Criteria will show a list of fields M1.F1 M1.F2 M1.F3 In case of Model2 selected Search Criteria will show a list of fields M2.F1 M2.F2 M2.F3

And also a text box for keywords and a Search Button.

I want to know do I need to create a model for Search also or just a controller and view will be fine. Also can this be achieved with only rails or do I need to use Ajax for this.

Thanks

È stato utile?

Soluzione

You don't need another model. You need a controller to "host" the search action.

It can be achieved both with rails/Ajax, depends on what you want.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top