Giter Site home page Giter Site logo

connecticus / spree_snippets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stefansenk/spree_snippets

1.0 2.0 0.0 293 KB

Spree extension for administrable embedded content.

License: BSD 3-Clause "New" or "Revised" License

Ruby 83.63% HTML 13.16% JavaScript 1.59% CSS 1.62%

spree_snippets's Introduction

SpreeSnippets

Build Status

Admin configurable chunks of content that can be rendered in any view via the SnippetsHelper#render_text_snippet method.

Synopsis

Within a view:

<%= render_text_snippet('slug-name') %>

... or ...

<%= render_text_snippet(@snippet_object) %>

... or ...

<% snippet_id = 26 %>
<%= render_text_snippet(snippet_id) %>

Snippets Admin

  1. Login to the Administration Console
  2. Click on the Snippets link in the sidebar
  3. Click "New Snippet" to add a snippet

Settings


To enable exceptions on missing snippets, set:

Spree::Config.snippets_raise_on_missing = true

Installation

  1. Add this extension to your Gemfile with this line:
gem 'spree_snippets', github: 'stefansenk/spree_snippets'
  1. Install the gem using Bundler:
bundle install
  1. Copy & run migrations
bundle exec rails g spree_snippets:install
  1. Restart your server

If your server was running, restart it so that it can find the assets properly.

Testing

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle
bundle exec rake

When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:

require 'spree_snippets/factories'

Contributing

If you'd like to contribute, please take a look at the instructions for installing dependencies and crafting a good pull request.

Copyright (c) 2019 [name of extension creator], released under the New BSD License

spree_snippets's People

Contributors

cmaujean avatar stefansenk avatar divineforest avatar akirill0v avatar kpitn avatar garpit avatar day avatar bob-frost avatar eliotsykes avatar connecticus avatar alexshuhin avatar kshlyk avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.