keram / refinerycms-snippets Goto Github PK
View Code? Open in Web Editor NEWHtml snippets shared across pages
Home Page: https://rubygems.org/gems/refinerycms-snippets
Html snippets shared across pages
Home Page: https://rubygems.org/gems/refinerycms-snippets
I tried using snippets in my refinerycms 2.1 and got the following error:
/Users/anita/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in
require': no such file to load -- refinerycms-base (LoadError)
from /Users/anita/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in block in require' from /Users/anita/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in
load_dependency'
from /Users/anita/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in require' from /Users/anita/.rvm/gems/ruby-1.9.2-p290/gems/refinerycms-snippets-0.5/lib/refinerycms-snippets.rb:1:in
<top (required)>'`
Is there something simple I can do to move past this?
/home/keram/gems/gems/actionpack-3.1.1/lib/action_dispatch/middleware/stack.rb:119:in assert_index': No such middleware to insert after: ActionDispatch::Static (RuntimeError) from /home/keram/gems/gems/actionpack-3.1.1/lib/action_dispatch/middleware/stack.rb:91:in
insert_after'
from /home/keram/web-data/project/vendor/refinerycms-snippets/lib/refinerycms-snippets.rb:21
from /home/keram/gems/gems/railties-3.1.1/lib/rails/initializable.rb:30:in instance_exec' from /home/keram/gems/gems/railties-3.1.1/lib/rails/initializable.rb:30:in
run'
from /home/keram/gems/gems/railties-3.1.1/lib/rails/initializable.rb:55:in run_initializers' from /home/keram/gems/gems/railties-3.1.1/lib/rails/initializable.rb:54:in
each'
from /home/keram/gems/gems/railties-3.1.1/lib/rails/initializable.rb:54:in run_initializers' from /home/keram/gems/gems/railties-3.1.1/lib/rails/application.rb:96:in
initialize!'
from /home/keram/gems/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in send' from /home/keram/gems/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in
method_missing'
from /home/keram/web-data/project/config/environment.rb:5
from /home/keram/gems/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in require' from /home/keram/gems/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in
require'
from /home/keram/gems/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in load_dependency' from /home/keram/gems/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in
new_constants_in'
from /home/keram/gems/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in load_dependency' from /home/keram/gems/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in
require'
from /home/keram/web-data/project/config.ru:4
from /home/keram/gems/gems/rack-1.3.5/lib/rack/builder.rb:51:in instance_eval' from /home/keram/gems/gems/rack-1.3.5/lib/rack/builder.rb:51:in
initialize'
from /home/keram/web-data/project/config.ru:1:in `new'
from /home/keram/web-data/project/config.ru:1
Thanks for making this add-on to address what I see as the biggest missing feature in Refinery!!!
Everything worked fine except it breaks when three are already snippets in the database and you try and add a new page. This is because the snippets_field partial tries to use @page.id before the page has been saved to the database. My quick fix was to override the admin/pages/tabs/snippets partial like so:
<div class="wym_skin_refinery page_part" id="page_snippet_picker">
<% if @page.new_record? %>
<h2>Please save this page before you can add any snippets</h2>
<% else %>
<%= render :partial => '/admin/pages/tabs/snippets_content', :locals => {:f => f} %>
<% end %>
</div>
Works for now, but I'm guessing you'll want to do something more user friendly. Perhaps with Rails nested_attributes or the like.
peter
Snippets tab is displayed under page always, even if user is not allowed to handle with them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.