Greetings!
I am working on a small RoR project and decided to split the front-end
and the admin portion into two separate RoR projects. The project is a
typical e-commerce website and as such has a folder to keep the images
and thumbnail of the products. I am currently keeping this folder under
public/product_images. This works fine with the front-end part, but is
not accessible by admin project. I have two questions:
- Is there a easy way to share a folder between two or more RoR
projects
- How this affects deployment
Your help will be greatly appreciated.
Thanks
On 2/28/08, Winter M. [email protected] wrote:
I am working on a small RoR project and decided to split the front-end
and the admin portion into two separate RoR projects.
Why, you enjoy pain or something? That’s breaking DRY to the second
power.
–
Greg D.
http://destiney.com/
Greg D. wrote:
Why, you enjoy pain or something? That’s breaking DRY to the second
power.
I have my reasons, the major one being I want to have 2 domains or a
domain/subdomain, one regular and one SSL protected:
http://www.mystore.com and https://admin.mystore.com
@Winter M.
As already pointed out you can accomplish this in one project.
Check into the new namespacing options for routes.rb
(yourdomain.com is available for purchase - Sedo.com and www.yourdomain.com/product) as
one alternative. Another would be to use Rails’ ability to deliver
the subdomain names to your controller and take the appropriate
action.
If you still must use two projects, you’d probably make the admin
app’s public/product_images a symlink to the one for the main app.
On Feb 28, 3:35 pm, Winter M. [email protected]
On 28 Feb 2008, at 21:13, Winter M. wrote:
Greg D. wrote:
Why, you enjoy pain or something? That’s breaking DRY to the second
power.
I have my reasons, the major one being I want to have 2 domains or a
domain/subdomain, one regular and one SSL protected:
http://www.mystore.com and https://admin.mystore.com
You don’t need 2 apps to do that.
Fred
Greetings -
On 29-Feb-08, at 11:50 AM, AndyV wrote:
If you still must use two projects, you’d probably make the admin
typical e-commerce website and as such has a folder to keep the
Your help will be greatly appreciated.
I too am in favor of separate apps for the following reasons:
- different UI (V)
- different interactions ©
- same business logic (M)
so how to do #3?
create a plugin, and put your models into it. Then include it in both
your app and the admin project.
The added benefits are 2 fold - a reduction in the possibility of bugs
(that can have grave consequences if your reg users gain some admin
access), plus clearer separation for load and performance tuning. The
database (unless you mirror) will be still be a common resource, but
your mongrel/nginx/ etc can be tuned for end users. Additionally your
deploys can be more liberal(frequent) with your admin users.
Jodi
On Fri, Feb 29, 2008 at 8:57 AM, Jodi S. [email protected] wrote:
As already pointed out you can accomplish this in one project.
wrote:
public/product_images. This works fine with the front-end part, but
I too am in favor of separate apps for the following reasons:
The added benefits are 2 fold - a reduction in the possibility of bugs
(that can have grave consequences if your reg users gain some admin
access), plus clearer separation for load and performance tuning. The
database (unless you mirror) will be still be a common resource, but
your mongrel/nginx/ etc can be tuned for end users. Additionally your
deploys can be more liberal(frequent) with your admin users.
Jodi
We use symlinks for app/models, app/layouts, with some shared helper,
lib, javascript, and stylesheet paths too. It works fine. We just
have to remember to do all db migrations on the admin app.
It’s a mixed bag of pros/cons, really.
–
Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com