comfy / comfortable-mexican-sofa Goto Github PK
View Code? Open in Web Editor NEWComfortableMexicanSofa is a powerful Ruby on Rails 5.2+ CMS (Content Management System) Engine
License: MIT License
ComfortableMexicanSofa is a powerful Ruby on Rails 5.2+ CMS (Content Management System) Engine
License: MIT License
Apart from a typo in the README (PATH should read SEED_PATH below):
rake comfortable_mexican_sofa:import:all FROM=your-site.local TO=your-site.com PATH=/path/to/fixtures
There was some sort of exception deep in the snippet validation, which gets thrown (deceptively) as "Failed to load from"; see trace below.
What I did was simply to re-use a plain seeding rake task (with no validations) that we use to seed our own apps, and everything works nicely. I can package the cms_seed.rake task as a git diff, name spaced for "comfortable_mexican_sofa", if you are interested.
Trace below:
$ rake comfortable_mexican_sofa:import:all FROM=localhost TO=localhost SEED_PATH=/Users/ramie/heatwave_rails3/db/cms_seeds --trace
(in /Users/ramie/heatwave_rails3)
DEPRECATION WARNING: Rake tasks in /Users/ramie/heatwave_rails3/vendor/plugins/prawnto/tasks/prawnto_tasks.rake are deprecated. Use lib/tasks instead. (called from /Users/ramie/heatwave_rails3/Rakefile:7)
** Invoke comfortable_mexican_sofa:import:all (first_time)
** Invoke comfortable_mexican_sofa:import:layouts (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke comfortable_mexican_sofa:import:check_for_requirements (first_time)
** Invoke environment
** Execute comfortable_mexican_sofa:import:check_for_requirements
Starting import into Default Site (localhost) from '/Users/ramie/heatwave_rails3/db/cms_seeds/localhost'
** Execute comfortable_mexican_sofa:import:layouts
Importing Layouts
-----------------
Saving layout: Homepage (homepage)
rake aborted!
Failed to load from
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/app/models/cms_snippet.rb:37:in `load_from_file'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/app/models/cms_snippet.rb:44:in `load_for_slug!'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/app/models/cms_snippet.rb:55:in `load_for_slug'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/app/models/cms_snippet.rb:26:in `initialize_or_find'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/comfortable_mexican_sofa/cms_tag.rb:30:in `initialize_tag'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/comfortable_mexican_sofa/cms_tag.rb:79:in `initialize_tag'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activemodel-3.0.3/lib/active_model/attribute_methods.rb:106:in `find'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/comfortable_mexican_sofa/cms_tag.rb:79:in `each'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/comfortable_mexican_sofa/cms_tag.rb:79:in `find'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/comfortable_mexican_sofa/cms_tag.rb:79:in `initialize_tag'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/comfortable_mexican_sofa/cms_tag.rb:90:in `process_content'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/comfortable_mexican_sofa/cms_tag.rb:88:in `collect'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/comfortable_mexican_sofa/cms_tag.rb:88:in `process_content'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/app/models/cms_layout.rb:107:in `check_content_tag_presence'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:459:in `_run_validate_callbacks'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activemodel-3.0.3/lib/active_model/validations.rb:212:in `run_validations!'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activemodel-3.0.3/lib/active_model/validations/callbacks.rb:67:in `run_validations!'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:413:in `_run_validation_callbacks'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activemodel-3.0.3/lib/active_model/validations/callbacks.rb:67:in `run_validations!'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activemodel-3.0.3/lib/active_model/validations.rb:179:in `valid?'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/validations.rb:55:in `valid?'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/validations.rb:75:in `perform_validations'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/validations.rb:49:in `save!'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/transactions.rb:242:in `save!'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/transactions.rb:289:in `with_transaction_returning_status'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/transactions.rb:204:in `transaction'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/transactions.rb:287:in `with_transaction_returning_status'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/transactions.rb:242:in `save!'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/tasks/comfortable_mexican_sofa.rake:62
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/comfortable_mexican_sofa-1.0.37/lib/tasks/comfortable_mexican_sofa.rake:42
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/Users/ramie/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/Users/ramie/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/gems/rake-0.8.7/bin/rake:31
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/bin/rake:19:in `load'
/Users/ramie/.rvm/gems/ruby-1.8.7-p174@rails_3/bin/rake:19
Ramie-Blatts-MacBook-Pro:heatwave_rails3 ramie$
Hi
I am new to sofa, but am loving it, as it just gets out of my way, unlike most cms. Great job.
But a quick question, has anyone got any thoughts on building navigators.
I would like to add a navigator that is generated via the top level root pages.
I am just not sure how to do this elegantly.
Many thanks
As uploads is a nested resource of sites en the javascript directs to /admin_path_prefix/upload.
I've a Rails (3.0.9) app with omniauth (0.2.6) in place, after integrating cms I get in my browser :
NoMethodError in CmsContentController#render_html undefined method `gsub!' for nil:NilClass
while in rails log seems to mismatch the authentication routing :
Started GET "/auth/github" for 127.0.0.1 at 2011-07-25 21:04:46 +0200 Processing by CmsContentController#render_html as HTML Parameters: {"cms_path"=>"auth/github"} SQL (0.3ms) SELECT COUNT(*) FROM "cms_sites" Cms::Site Load (0.3ms) SELECT "cms_sites".* FROM "cms_sites" LIMIT 1 Completed 500 Internal Server Error in 156ms NoMethodError (undefined method `gsub!' for nil:NilClass):
... at first time integration,
seems it was fine, but after loggin out/in with omniauth application ( github authenticated ) this error appeared.
The cms-admin authentication works fine instead.
My Gemfile.lock is here: http://pastie.org/2270005
Any help will be greatly appreciated.
Luca G. Soave
Because module ComfortableMexicanSofa::ControllerMethods aliases the render method but doesn't handle when render's argument isn't a Hash it breaks the render pattern:
render :update do |page|
....
end
While the rails app should use rjs templates, etc, such is life when working with a large legacy codebases.
A simple fix is to test for options being a Hash, otherwise render_without_cms, etc.
I have been a fan of CMS and have been using it. Some upgrades according to my experience, which i think will help every future users are listed below:
Logout link is missing in admin page when using httpAuth
override_host option, or sharing of resources among different sites (pages,snippets...) will definitely be a plus-point
The app i have been working on has sub-domains. So if i access the admin area "subdomain.hostname.com/cms-admin" (i have been using httpAuth) with enable_multiple_sites=true, the hostname gets automatically changed to "subdomain.domain" preventing me from accessing my public pages in "hostname.com/public-pages". I now have to go to "subdomain.hostname.com/public-pages" to view my public pages. Disabling multiple sites asks to create new sites based on subdomain...creating public pages for every subdomain is not possible...
Currently there's page caching for css/js assets served from the layouts. It totally doesn't work when running multiple sites.
Rails 3.1 kills off page caching in favor of Rack based solution. Perhaps, as default, we can implement some sort of frag caching so we don't have to hit database/rendering processes needlessly.
In the DB, whitespace for my layout looks just as I put it in. When I edit it, a bunch of extra spaces are present in the textarea contents. Is anyone else seeing this?
When updating a layout with child layouts, it should force reload for pages for those child layouts. Currently doesn't appear to work right. Will fix.
When you delete a child layout used by a page, trying to view the page causes a rendering error as shown.
A layout is selected when you go to edit the page but will not be set until you hit "Update Page."
I've started a fixtures manager over at https://github.com/pinnacol/comfortable-mexican-sofa/commits/fixtures-manager, and I'd love to know what you think of the implementation.
The only other functionality I'm thinking about adding before I consider it complete is a zip upload/download mechanism. The only initial sticking point I have with this idea is related to needing to add an additional dependencies (i.e. rubyzip, zippy).
Feedback is most welcome, thanks!
derp
Seems that in Rails 3.1 ActionView::MissingTemplate.new is different. Neen to take a look.
I'm running on a Windows box (I know) and have uncovered a problem that is stumping me. When trying to serve a page with a rich_text_field, I get this:
Started GET "/assets/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.cms.js" for 127.0.0.1 at 2011-07-27 12:39:14 -0400
Compiled C:/Ruby192/lib/ruby/gems/1.9.1/gems/comfortable_mexican_sofa-1.3.5/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.cms.js (0ms) (pid 7824)
Error compiling asset comfortable_mexican_sofa/wymeditor/jquery.wymeditor.cms.js:
Errno::ENOENT: No such file or directory - C:/dev/pal/tmp/cache/assets/sprockets%2FC%3A%2FRuby192%2Flib%2Fruby%2Fgems%2F1.9.1%2Fgems%2Fcomfortable_mexican_sofa-1.3.5%2Fapp%2Fassets%2Fjavascripts%2Fcomfortable_mexican_sofa%2Fwymeditor%2Fjquery.wymeditor.cms.js%3Asource20110727-7824-1tcm1sb.lock
Served asset /comfortable_mexican_sofa/wymeditor/jquery.wymeditor.cms.js - 500 Internal Server Error
Maybe this has to do with the fact that Windows has some length restrictions on various parts of files?
The stylesheets do get served. I had to move my project directory up to the root to cause that to happen, which has led to think about the lengths of paths.
For the sake of clarity and transparency, consider moving the routes defined into a method which is mixed into the router, and then use the generator to add that line. This is what devise does, and it seems like a best practice (allows for much more flexibility).
I am more than willing to write the patch, having done this for a couple of my own plugins, provided there is interest.
Need to set it to a blank string at least. Otherwise preview will crash if something uses @cms_page.full_path to generate navs, for example.
There are textareas for CSS and JS on the layout creator screen but there's no docs on how to get that content into my pages. Could you document this feature?
I thought I'd just give a heads up that the new rails asset pipeline isn't working when using sofa. I guess it's because of the 404 catching that sofa does. Would be nice if they worked together.
Love the sofa! We need to implement a page caching scheme with our sofa based cms; i.e. like Rails page caching. I see that you did a basic Rails page caching for the CSS and JS, but what about caching for pages? Any plans for that? We are hesitant to fork a very active repo.
Looking over the new fixtures implementation. It seems like there isn't way to generate the seeds from the database.
I would think the sync functions in fixtures.rb should write out any files that don't exist. Or at the very least a new method should replace the rake tasks which have been removed? Any plans for this?
I'm doing a multiple-host config whereby I edit sites in one host and push the release out to a live server. Fixtures are ideal for that, but I need to generate them on demand. I might go ahead and implement this and request a pull.
What i've done:
Problem: If i click on the "Pages" tab i get this error:
ActionView::Template::Error (undefined method `root?' for #<CmsPage:0x00000105b3de80>):
2: cms_page ||= index_branch
3: has_children = cms_page.children.present?
4: has_siblings = cms_page.siblings.present?
5: branch_open = (session[:cms_page_tree] || []).member?(cms_page.id.to_s) || cms_page.root?
6: %>
7:
8: <li id='<%= dom_id(cms_page) %>'>
Stack Trace:
activemodel (3.0.3) lib/active_model/attribute_methods.rb:364:in `method_missing'
activerecord (3.0.3) lib/active_record/attribute_methods.rb:46:in `method_missing'
comfortable_mexican_sofa (1.0.44) app/views/cms_admin/pages/_index_branch.html.erb:5:in `___sers_max__rvm_gems_ruby_______p__gems_comfortable_mexican_sofa________app_views_cms_admin_pages__index_branch_html_erb___915934741430702657_2195221680_2363355429645081891'
actionpack (3.0.3) lib/action_view/template.rb:135:in `block in render'
activesupport (3.0.3) lib/active_support/notifications.rb:54:in `instrument'
actionpack (3.0.3) lib/action_view/template.rb:127:in `render'
actionpack (3.0.3) lib/action_view/render/partials.rb:300:in `block in collection_with_template'
actionpack (3.0.3) lib/action_view/render/partials.rb:297:in `each'
actionpack (3.0.3) lib/action_view/render/partials.rb:297:in `collection_with_template'
actionpack (3.0.3) lib/action_view/render/partials.rb:280:in `render_collection'
actionpack (3.0.3) lib/action_view/render/partials.rb:255:in `block in render'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.3) lib/action_view/render/partials.rb:253:in `render'
actionpack (3.0.3) lib/action_view/render/partials.rb:378:in `_render_partial'
actionpack (3.0.3) lib/action_view/render/rendering.rb:22:in `render'
comfortable_mexican_sofa (1.0.44) app/views/cms_admin/pages/index.html.erb:5:in `___sers_max__rvm_gems_ruby_______p__gems_comfortable_mexican_sofa________app_views_cms_admin_pages_index_html_erb___3527240696741638148_2195293560__1889993042086201444'
actionpack (3.0.3) lib/action_view/template.rb:135:in `block in render'
activesupport (3.0.3) lib/active_support/notifications.rb:54:in `instrument'
actionpack (3.0.3) lib/action_view/template.rb:127:in `render'
actionpack (3.0.3) lib/action_view/render/rendering.rb:59:in `block in _render_template'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.3) lib/action_view/render/rendering.rb:56:in `_render_template'
actionpack (3.0.3) lib/action_view/render/rendering.rb:26:in `render'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:114:in `_render_template'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:108:in `render_to_body'
actionpack (3.0.3) lib/action_controller/metal/renderers.rb:47:in `render_to_body'
actionpack (3.0.3) lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:101:in `render_to_string'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:92:in `render'
actionpack (3.0.3) lib/action_controller/metal/rendering.rb:17:in `render'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/Users/max/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
activerecord (3.0.3) lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:39:in `render'
comfortable_mexican_sofa (1.0.44) lib/comfortable_mexican_sofa/controller_methods.rb:38:in `render_with_cms'
actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:151:in `process_action'
actionpack (3.0.3) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.3) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.0.3) lib/active_support/callbacks.rb:445:in `_run__1332837706389961179__process_action__2871308120200266924__callbacks'
activesupport (3.0.3) lib/active_support/callbacks.rb:409:in `_run_process_action_callbacks'
activesupport (3.0.3) lib/active_support/callbacks.rb:93:in `run_callbacks'
actionpack (3.0.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.3) lib/action_controller/metal/rescue.rb:17:in `process_action'
newrelic_rpm (2.13.4) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `block in process_action'
newrelic_rpm (2.13.4) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:252:in `block in perform_action_with_newrelic_trace'
newrelic_rpm (2.13.4) lib/new_relic/agent/method_tracer.rb:141:in `trace_execution_scoped'
newrelic_rpm (2.13.4) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:247:in `perform_action_with_newrelic_trace'
newrelic_rpm (2.13.4) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
actionpack (3.0.3) lib/abstract_controller/base.rb:120:in `process'
actionpack (3.0.3) lib/abstract_controller/rendering.rb:40:in `process'
actionpack (3.0.3) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.3) lib/action_controller/metal.rb:178:in `block in action'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:103:in `optimized_each'
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:492:in `call'
newrelic_rpm (2.13.4) lib/new_relic/rack/developer_mode.rb:20:in `call'
warden (1.0.3) lib/warden/manager.rb:35:in `block in call'
warden (1.0.3) lib/warden/manager.rb:34:in `catch'
warden (1.0.3) lib/warden/manager.rb:34:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/cookies.rb:295:in `call'
activerecord (3.0.3) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.3) lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in `call'
railties (3.0.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.3) lib/rails/application.rb:168:in `call'
railties (3.0.3) lib/rails/application.rb:77:in `method_missing'
railties (3.0.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/Users/max/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/max/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/max/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
I have been using HttpAuth of CMS, but after log-in, i did not find any log-out link.
So, i tried to implement authlogic (which i have been using in the main app) to handle login/logout of CMS. Accordingly i copied the module given in readme :
module CmsAuth
def authenticate
unless current_user && current_user.admin?
redirect_to new_user_session_path
end
end
end
to "/config/initializers/comfortable_mexican_sofa.rb", and edited config.authentication = 'CmsAuth'. But unfortunately on going to url "localhost:3000/cms-admin" I got an error message " undefined local variable or method `current_user' " (this was obvious because we cant access session variable in initializers).
So, alternatively, i kept the module in "ApplicationController", and got an error message "uninitialized constant CmsAuth".
I could not figure out where to keep the module? Keeping in initializer, "current_user" is not accessible, whereas keeping in application controller the module itself gets uninitialized
Please help me integrate authlogic to handle session of CMS......
Just to note, I've started a branch for UI and controller messages translation since I need it for Spanish clients, It's weird to see a Mexican sofa that doesn't speak Spanish.
A first string extraction can be found in https://github.com/calas/comfortable-mexican-sofa/tree/feature/i18n
Contributions, suggestions and blames are welcome on that branch
I'll make a pull request once I'm done.
Ideas I have:
cms_t(:app_layout)
that handles scopes, fallbacks and default values.When I try to upload a file in the cms-admin area for a page via the upload button on the right it does fail...
Looking at the post request in firebug I see that the following url is used:
http://localhost:3000/cms-admin/uploads
Looking at the defined routes via rake routes I see the following route defined:
cms_admin_site_uploads POST /cms-admin/sites/:site_id/uploads(.:format) {:action=>"create", :controller=>"cms_admin/uploads"}
For me it seems like the upload plugin (plupload.Uploader) is using the wrong path...
Did I forgot to configure something?
Default output is a single line html. I tweaked it a bit so tags are split with new-lines. Maybe it's possible to inject CodeMirror there and force auto-indent somehow.
How do I set it?
Right now it's nil, and I had to go to the DB for my page to show up.
Layout slug seems irrelevant -- although it does get generated properly.
In the past there was a discussion about adding a revisions feature to pages. It would be nice to discuss this in detail to figure out the exact functionality. I'm willing to create some wireframes/sketches this weekend to start figuring out what is needed. Having recently finished reading "The RSpec Book", I'm eager to get the opportunity to use TDD/BDD.
Since the current codebase utilizes the Rails built-in testing framework, I'll use those libraries for consistency and for the sake of not adding unneeded dependencies.
I had been using V.1.0.46 and i was able to access all models of CMS ( eg. CmsPage, CmsSite and other all ), but on updating to V.1.1.1 i could not access those models. I get the error message "NameError: uninitialized constant CmsPage"
I found that in new version the prefix cms_ in some columns were dropped-out. So I had created a migration file to accomodate to that change. But from console I have not been able to access the models......
I'm trying to follow the quick start steps to add comfortable mexican sofa to my existing app.
I've added it to the Gemfile, generated the CMS code and run the migrations.
When I browse to http://127.0.0.1/cms-admin I get a form to create a new site.
I enter in the new site details and get a routing error:
Routing Error
No route matches "/cms_admin/sites/create"
This is using CMS 1.3.2 on rails 3.0.7 and ruby 1.9.2
Happily watching new features coming in. Any chance of a simple roadmap and explanation of new features? I've thrown away some work as you've beat me to the punch. Would be helpful to stay in sync with your fork. Not sure whether I might be able to use mirrors or not yet...
I tried to use http://mydomain.org/myapp/cms-admin but c-m-s is not aware of the /myapp prefix
CmsAdminController has no idea wtf is going on. Need to figure out how to work around it. Tried to force loading of content serving controller via #process('action_name') but somehow request
method returns nil on the second run.
Oleg, Sir, what do you think of the idea of allowing erb to be used directly inside layouts, pages, snippets, etc.
I think this would be a great addition to allow simple things like sticking the year in the footer of a layout.
If this is already something that can be done I'm not seeing it. Let me know what you think.
Disclaimer: This is more of a support request than an issue as such...
It would be nice if I could get a list of child pages from within page content or a layout. To help explain it might look like this in Erb:
<% current_page.children.each do | page | %>
<%= link_to page.title, page_path(page) %>
<% end %>
I had "config.enable_caching = true" (which is the default configuration) and things were working well in development mode.
But in production mode when I tried to create new page, the files "en.js" and "editor_template.js" could not get loaded and rich_text editor did not appear. As a result no HTML code could be added and every thing written in text_area apeared as plain text.
Finally i disabled the caching and things started working.
Was this a bug or i missed some configuration settings? Please help me out...
When referencing a snippet from application.html.erb:
<%= cms_snippet_content :page_header %>
With a snippet of:
{{cms:helper:link_to:Home:root_path}}
The helper text is rendered as plain text. If the same snippet is included via a cms layout, it renders correctly.
Comfortable Mexican Sofa is an incredible concept that is implemented very well. That said, I feel the name could use a little tweaking. I get rather embarrassed when I use the name with clients that are asking for CMS capabilities, and I find myself having to explain that it's not a name that I came up with. Any chance of adjusting the branding so the project doesn't come across as offensive? I fear that my clients will dismiss it based on the name, without ever considering the merits.
Note: I did not create this issue in order to stir up a flame war. I am honestly concerned about the effect the name is going to have on my ability to use this project.
Seems a bit cleaner plus gives a class that should be easy to override.
Before that CW needs to be patched up to have CarrierWave::ImageMagick processor. Should be able to talk to imagemagick directly (just like Paperclip)
Would there be any interest in sofa ignoring the app_layout if the request is an AJAX request? I'm interested in this particular behavior due to me wanting to display CMS content inside a lightbox.
override_host is gone so now I have to resort to a hack:
if Rails.env.development?
module CmsSiteExtensions
def find_by_hostname(*args)
first
end
def find_by_hostname!(*args)
first or raise 'Cms::Site not found'
end
end
Cms::Site.__send__ :extend, CmsSiteExtensions
end
Is there a better alternative?
After integrating comfortable-mexican-sofa in an existing working rails project with Jammit's Javascript Templates did not work anymore.
The firebug error message was "JST is not defined". After removing comfortable-mexican-sofa it worked again.
This only happens in the development environment.
I guess it might have something to do with the routing of comfortable-mexican-sofa and jammit... but right now I do not know what it might be exactly.
Does anybody know what the problem might be?
Used versions:
Hi,
Do you have a way of including keyword and description tags in your application.html.erb and have it show the fields within the CMS page creation/edit pages?
I'm using my application.html.erb as the main template and the <%= raw(yield) %> is set for what is basically my main content area. I'm using the following code in my header to pull from the content from these fields however these tags alone do not create the necessary fields that would allow me to give each page unique values.
<meta name="description" contents="<%= cms_page_content(:Description) %>" />
<meta name="keywords" contents="<%= cms_page_content(:Keywords) %>" />
Thanks for you help, your work on this CMS is much appreciated!
hi guys!
works with mongoid or it's only activerecord compatible?
Thanks!
Is it possible to share snippets or pages across multiple sites...............
I wanted some snippets which could be fetched in my app through method cms_snippet_content( name ), ir-respective of cms-site.
The read-only file system borks when it tries to create the _cms.css
Turning off caching in rails for the app makes the problem go away, but it might be nice to have it as a configuration option for the CMS.
I noticed while looking at the view template that javascript isn't cached in the same way, not sure if this is an oversight or intentional.
The path includes /public. Some wymeditor files don't get loaded.
This is a problem when you end up with both align_left
and align_right
. Gotta take a gander at whatever manages class assignment.
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.