View and Edit Source for a Gem

Been a while since I touched RoR (good to be back!). I have installed Spree Commerce. I have created the source files for the views so I can change the look, but I cannot see where the Controllers/Models source files are so I can modify these. I think this is a simple task, but I cannot work it out! Appreciate some support. Thanks.

  1. you want to run bundle show <gem> which will tell you the exact place where the gem code is

  2. You want to use a real IDE— like Rubymine— that will automatically give you CLICK-INTO functionality. In Rubymine, you can command-click on functions and jump right into the Gem code immediately. Upgrading yourself to a real IDE is a HUGE DEAL and creates a radical transformation that will empower you to code like you’ve never known coding before.

  3. I would strongly recommend against building your own e-commerce at this time. Just go on Shopify and build-out custom services and/or custom auxiliary apps to customize your Shopify store. Shopify has 3000 engineers— you can’t compete with them on your own.

1 Like

Thanks Jason. Found the code, I can now start to understand the services. I agree with all 3 points you make and thanks for resolving my issue.

With bundle open <gem_name> you can open the source code of the gem directly in your editor, you only have to export the ENV first:

export BUNDLER_EDITOR="/usr/local/bin/code"
(replace with path to your editor)

That said, the Spree Commerce gem has quite a good documentation, which explains how to customize templates, business logic & co: