Skip to content

There should be generators #1347

Closed
jescalan opened this Issue Apr 3, 2012 · 4 comments

4 participants

@jescalan
jescalan commented Apr 3, 2012

I think spree is awesome, but I'm trying to make a store that's very highly customized, and using Deface is ridiculous for this purpose. I need to almost fully revise the views for every page, and add a number of new pages - I'm using spree really to handle the back end.

I'm now spending tons of time copying every view and controller files over from this github repo into my app in order to actually be able to see what's going on and customize things - having generators for this should definitely be considered. For example, in Devise, you can run rails g devise:views and it will drop those files in your app so you can edit them. I think for spree, a generator should be made for models, views, and controllers. This way users could easily customize the app as they want.

I understand the point about spree upgrades being easier if you use Deface etc. but when it comes down to it, this is so highly customized that it would be silly to worry about spree upgrades. If it works, it works, and if there's a serious security patch needed or something, I can find where it is in the source and manual patch it. As you guys noted in your docs, sometimes manual overrides are needed, and if they are it shouldn't be like pulling hairs...

@ethier
ethier commented Apr 4, 2012

Why not use Deface with partials? For instance, replace the entire body element with what you want. At least you could use the :original spec in deface to help track down those issues if and when you do want to upgrade.

That being said, the generators are not a bad idea.

Have you looked at the spree_essentials extensions? There is a CMS one that might help with some of the static pages. I haven't looked at it yet myself, but I was hoping it might handle some of the static pages well. It doesn't support 1.1.0 yet though.

@jescalan
jescalan commented Apr 4, 2012

Really, I just want to edit the views, I don't want to have to jump in blind and try overriding things with a separate library (that I then have to learn how to use). It would absolutely take longer to do a complete and total overhaul with deface than to just override the views (which is what I have been doing, and it's worked well).

I haven't, although this does sound like it's worth checking out. I have just beeing working the static pages through a separate controller as regular rails pages so far and it's worked fine, although it keeps them separate from spree. I'll have to check that out though, thanks for the tip!

@radar
Spree Commerce member
radar commented Apr 5, 2012

Hi!

I think spree is awesome, but I'm trying to make a store that's very highly customized, and using Deface is ridiculous for this purpose.

Could you elaborate on what exactly you're trying to customize? Give us an example to work with here!

I need to almost fully revise the views for every page

Revise in what way? Please give us examples of how you're modifying Spree so that we can learn what you're trying to do with it.

and add a number of new pages

This process is generally handled pretty well with extensions like spree_essential_cms. I would hope one day that we could integrate better with Refinery to allow that CMS to be chosen.

I'm now spending tons of time copying every view

See above.

and controller files over from this github repo into my app

Again, we need examples of what you're trying to accomplish. Perhaps that this is the best way for you ultra customize your Spree store... we don't know from this far away.

in order to actually be able to see what's going on

If you cloned a local copy of Spree and had that open in another text editor you could see what was going on inside. Are there any parts that were especially difficult to figure out?

and customize things - having generators for this should definitely be considered. For example, in Devise, you can run rails g devise:views and it will drop those files in your app so you can edit them. I think for spree, a generator should be made for models, views, and controllers. This way users could easily customize the app as they want.

This part I strongly disagree with. The whole reason for making Spree an engine in the first place was so that we don't need to have a huge ball of both application and Spree code sitting in app. By having it as an engine, we can provide upgrades to you and all you need to do is change the Gemfile to point to that latest version of Spree.

Having a generator that simply anybody can use will inevitably lead to the wrong sorts of people using it, imo, causing a greater workload for us in attempting to debug any problem that they come up with. Is it inside the gem or did they copy the code to their application with a command then edit it? Initially, we won't know.

If you explain how you're trying to customize Spree with some examples then perhaps we can make that process a lot easier for people such as yourself.

Thanks!

@schof
Spree Commerce member
schof commented Apr 5, 2012

Sounds like an interesting discussion. Closing this out since its a feature request and we can use the mailing list to discuss those. No problem suggesting a feature but we need to prioritize open bugs.

@schof schof closed this Apr 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.