On Fri, Jun 22, 2007 at 01:11:10AM -0000, mfaine wrote:> I''m looking at various technologies in an effort to build a very
> flexible but also very simple application.
>
> A requirement for the application is to take the database table name
> (or in this case a view) as a parameter. The database will be Oracle
> 10.2. The application will simply list (and paginate) records in a
> view that is composed from two tables. The tables contain information
> about files on the file system of the application server. (filename,
> path, title, subject, etc)
[...]> As an example I''d like it to work something like this, the URL to
a
> retrieve a given listing would be:
>
> http://servername.domain/List/microgravity
> or
> http://servername.domain/List/ssme
>
> The last bit of the path would be the database to use. From my very
> limited knowledge of Rails this would not be practical in Rails. What
> do you think?
It''s quite doable, and not too difficult. You can choose to do it with
or
without ActiveRecord. With AR, you''ll need to dynamically create
classes.
That isn''t all that difficult, but it can become a memory leak if you
aren''t careful. Without AR, you''ll just connect to the DB
directly and
perform queries against it, displaying the result sets. It doesn''t
sound
like you''ll be treating the rows as models, so this may be appropriate.
For the routing, you just need ''/List/:tablename'' to map to a
particular
controller and action and use params[:tablename] in the action
implementation.
> Thanks,
> -Mark
--Greg
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---