comfy / comfy-blog Goto Github PK
View Code? Open in Web Editor NEWBlog Engine for ComfortableMexicanSofa (Rails 5.2+)
License: MIT License
Blog Engine for ComfortableMexicanSofa (Rails 5.2+)
License: MIT License
Currently the readme file notes that you can override the mount point in the config to serve blog posts up from a different location "/" -> "/blog". The read me states that this is the config item to alter:
config.public_route_prefix = 'blog'
But to be more accommodating to those of us who need everything spelled out, It appears that the config declaration should be:
ComfyBlog.config.public_route_prefix = 'blog'
To be able to customize the presentation of a single blog post by changing the view template.
Blog posts' #show
action is using inline rendering which displays the content but there's no access to the additional fields - e.g. title
, published_at
, etc, unless they are added a second time in the template itself.
The line responsible for this is
If this is changed to simply
render layout: app_layout
And a simple view template is added in app/views/comfy/blog/posts/show.html.erb
it will allow full customization when viewing a single blog post.
Rails version:
5.2.0
CMS version:
2.0.15
Ruby version:
2.5.1p57
A Post
has an :excerpt
attribute which I saw added in #7 but not clear on functionality, can someone further explain? It seems its used for the admin panel to get an idea of the article but I think unnecessary?
I installed the latest gem for comfy-blog, and as I'm trying to access the 'Blogs' link in the admin page, I immediately get this undefined error. It seems that the latest gem is using comfy_paginate
, but it's not defined anywhere? How do I get around this?
I needed to add email subscription to comments. Is there easy functionality or else can I include below gem ?
https://github.com/lml/commontator
I will try to install above gem and see if that will have any conflicts.
Note: For general questions and feature requests please leave a message
on Gitter: https://gitter.im/comfy/comfortable-mexican-sofa
Running rails test
or bundle exec rails test
to run tests.
A sprockets error is generated:
/Users/someuser/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/railtie.rb:105:in `block in <class:Railtie>': Expected to find a manifest file in `app/assets/config/manifest.js` (Sprockets::Railtie::ManifestNeededError)
But did not, please create this file and use it to link any assets that need
to be rendered by your app:
Example:
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
and restart your server
cd
into itgem install bundler
bundle install
bundle exec rails test
Rails version: 5.2.3
CMS version: n/a
Ruby version: 2.5.1p57
Admin Blog Posts tab should open form after template has been created
Blog Posts returns Rails error
NameError in Comfy::Admin::Blog::Posts#new
I should note that when a layout is not defined a form renders but I can't edit content (makes sense)
Create a new Rails project
Install comfortable_mexican_sofa as per instructions
Install comfy_blog as per instructions
Start server and head to admin panel
Create a site
Create new layout with default Application layout
Click on Blog Posts in admin panel
Rails version: 5.2.0.rc2
CMS version: 2.0.13
comfy-blog version: 2.0.5
Ruby version: 2.5.1
OS: macOS High Sierra 10.13.4
Hi
Tryign to using comfy_blog in my test CMS setup and ran into this issue on installation both on CMS v 1.8 and CMS 2.0 beta:
/usr/local/lib/ruby/gems/2.0.0/gems/comfy_blog-0.1.8/lib/comfy_blog/engine.rb:10:in block (2 levels) in <class:Engine>': undefined method
admin_route_prefix'
Trying to set
config.admin_route_prefix = 'cms-admin'
Just breaks up further up the stack.
Any suggestion? Is comfy-blog not compatible with latest version of CMS 1.8 & 2.0?
Hey guys-
Just investigating this + CMS for blog support in my app, and assume there is some gem incompatibility since my app is at 3.1.3...has anyone see this issue?
config.public_route_prefix = 'blog'
Going to "/blog" results in:
NoMethodError in Blog::PostsController#index
undefined method `paginate' for []:ActiveRecord::Relation
I suspected this was coming from the fact that I haven't created any posts yet, but the CMS path (cms-admin/blog/posts) results in the same error.
https://github.com/comfy/comfy-blog/blob/master/app/controllers/comfy/blog/posts_controller.rb#L50 is giving a ComfortableMexicanSofa::MissingPage: Cannot find CMS Page at /404
for me.
404 for the CMS works fine, but not for the blog.
Should this perhaps be rescue_from ActiveRecord::RecordNotFound, :with => :page_not_found
like in Comfy?
When trying to add a new post I get the error "Missing partial comfy/admin/cms/files/_index"
This line is requesting the partial be rendered: https://github.com/comfy/comfy-blog/blob/master/app/views/comfy/admin/blog/posts/_form.html.haml#L2
The file was deleted by this commit:
comfy/comfortable-mexican-sofa@a411a25#diff-11
We'd like to create our own customized templates for rendering the blog index & show pages. I didn't see anywhere to configure which templates are rendered (except for the layout template).
Has anyone done this before? Is it possible?
When updating an existing blog post, I'm expecting the blog post's form to submit, its content to save, and to redirect back to the same form.
Instead:
NoMethodError at /admin/sites/1/blog-posts/1
undefined method `update_attributes!' for #<Comfy::Blog::Post:0x00007fd0e59769c8>
Did you mean? update_attribute
I jumped into ComfyBlog's source ... and hit the cause pretty fast.
ComfyBlog calls Comfy::Admin::Blog::PostsController#update, and on line 38, you can see it calls @post.update_attributes!
, not @post.update!
.
This hasn't been a problem until Rails 6.1: before, #update_attributes!
was deprecated in favour of #update!
, but still present and usable. But now we've hit 6.1 and it's been removed completely. Naturally ComfyBlog is b0rking.
Though, whilst error-trawling, I also jumped into ComfyBlog's current master
- and I see you've already made the fix. That's all great. I could easily just change my Gemfile to point to this repo's master
instead of tag 2.0.7
, but thought it'd also be useful to let you know at least one of your users is headbutting this.
Rails version: 6.1.0
CMS version: 2.0.19
Ruby version: 2.0.7
gem 'comfortable_mexican_sofa', '~> 1.12', '>= 1.12.8'
gem 'comfy_blog', '1.12.3'
routes;
comfy_route :blog_admin, :path => '/adminblog'
comfy_route :blog, :path => '/blog'
comfy_route :cms_admin, :path => '/cms'
comfy_route :cms, :path => '/pages', :sitemap => false
When navigated to http://0.0.0.0:3000/adminblog
but cms working fine.
Can some tell me how to make this blog work with cms?
I'm getting this error when I try to run tests after installing comfy-blog. I created a new project with an identical Gemfile (without the code) and was able to run the automatically generated tests without a problem.
I can see how it could potentially be an issue looking at the code -- there are two CommentsController classes both inheriting from a different Blog class. I'm currently stumped though.
Would appreciate any debugging tips.
/home/awt/.rvm/gems/ruby-1.9.3-p125/gems/comfy_blog-0.1.7/app/controllers/admin/blog/base_controller.rb:1: warning: toplevel constant Blog referenced by Admin::Blog
/home/awt/.rvm/gems/ruby-1.9.3-p125/gems/comfy_blog-0.1.7/app/controllers/admin/blog/comments_controller.rb:1: warning: toplevel constant Blog referenced by Admin::Blog
/home/awt/.rvm/gems/ruby-1.9.3-p125/gems/comfy_blog-0.1.7/app/controllers/admin/blog/comments_controller.rb:1: warning: toplevel constant Blog referenced by Admin::Blog
/home/awt/.rvm/gems/ruby-1.9.3-p125/gems/comfy_blog-0.1.7/app/controllers/admin/blog/posts_controller.rb:1: warning: toplevel constant Blog referenced by Admin::Blog
/home/awt/.rvm/gems/ruby-1.9.3-p125/gems/comfy_blog-0.1.7/app/controllers/admin/blog/posts_controller.rb:1: warning: toplevel constant Blog referenced by Admin::Blog
/home/awt/.rvm/gems/ruby-1.9.3-p125/gems/comfy_blog-0.1.7/app/controllers/admin/blog/tags_controller.rb:1: warning: toplevel constant Blog referenced by Admin::Blog
/home/awt/.rvm/gems/ruby-1.9.3-p125/gems/comfy_blog-0.1.7/app/controllers/admin/blog/tags_controller.rb:1: warning: toplevel constant Blog referenced by Admin::Blog
/home/awt/.rvm/gems/ruby-1.9.3-p125/gems/comfy_blog-0.1.7/app/controllers/blog/comments_controller.rb:1:in `<top (required)>': superclass mismatch for class CommentsController (TypeError)
from /home/awt/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /home/awt/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
Hey, not sure if there's a way to do this or not -- can I point another domain to a comfy blog? For example, if my Rails app is on foo.com , can I point bar.com to one of the blogs created with this gem? Or do I have to create a CMS site for bar.com and put the blog at bar.com/blog ?
Thanks!
Index should return @blog_posts
sorted according to their published date
@blog_posts
are returned unsorted. This can result in a blog post appearing on multiple pages and others not appearing at all.
Rails version:
5.2.0
CMS version:
2.0.15
Ruby version:
2.5.1p57
I18n support got added to the blog. Unfortunately most of the translations default to English. If you have time please translate what you can (files are pretty small: https://github.com/comfy/comfy-blog/tree/master/config/locales)
I'm trying sofa-blog with comfortable_mexican_sofa 1.3.8 but get this error ( yes, is a mix mongoid/active-record application but comfortable_mexican_sofa works fine over his own sqlite3 DB ):
lsoave@ubuntu:~/rails/github/gitwatcher$ rails g blog MONGODB admin['$cmd'].find({:ismaster=>1}) MONGODB admin['$cmd'].find({:ismaster=>1}) /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:239:in `require': no such file to load -- rails/generators/mongoid (LoadError) from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:239:in `block in require' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:225:in `block in load_dependency' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:593:in `new_constants_in' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:225:in `load_dependency' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:239:in `require' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/sofa_blog-0.0.1/lib/generators/blog_generator.rb:30:in `next_migration_number' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.10.rc1/lib/rails/generators/migration.rb:49:in `migration_template' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/sofa_blog-0.0.1/lib/generators/blog_generator.rb:14:in `generate_migration' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/thor-0.14.6/lib/thor/task.rb:22:in `run' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/thor-0.14.6/lib/thor/base.rb:389:in `start' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.10.rc1/lib/rails/generators.rb:163:in `invoke' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.10.rc1/lib/rails/commands/generate.rb:10:in `' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:239:in `require' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:239:in `block in require' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:225:in `block in load_dependency' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:593:in `new_constants_in' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:225:in `load_dependency' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/activesupport-3.0.10.rc1/lib/active_support/dependencies.rb:239:in `require' from /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.10.rc1/lib/rails/commands.rb:17:in `' from script/rails:6:in `require' from script/rails:6:in `' lsoave@ubuntu:~/rails/github/gitwatcher$
note that I recently update to 1.3.8 and running
rails generate cmsworks fine without any DB conflict ...
I've looked over the docs and code and I haven't found a way to embed blog posts into a CMS page. Is it possible? I'm looking for something functionally equivalent to:
<% Comfy::Blog::Blog.first.posts.where(is_published: true).limit(5).each do |p| %>
<article>
<h1><%= p.title %></h1>
<div><%= p.content %></h1>
</article>
<% end %>
Or Is there any way of creating code-driven snippets?
I am using mexicon sofa(1.11.0) in rails 4 and trying to save the nested attributes but it is not saving.
The problem is:
gallery.rb
class Gallery < ActiveRecord::Base
has_attached_file :top_image, :styles => {:thumb => "200x200>" }
has_many :gallery_images, :dependent => :destroy
accepts_nested_attributes_for :gallery_images, :reject_if => lambda { |a| a[:content].blank? }, :allow_destroy => true
end
galery_image.rb
class GalleryImage < ActiveRecord::Base
has_attached_file :image, :styles => {:thumb => "200x200>" }
belongs_to :gallery
end
_form.html.haml
= form.text_field :title
= form.text_field :description
= form.file_field :top_image
= form.fields_for :gallery_images do |builder|
= render "gallery_image_fields", :form => builder
%p= link_to_add_fields "Add Image", form, :gallery_images
.form-actions
= form.submit :class => 'btn btn-primary'
_gallery_image_fields.html.haml
= form.file_field :image
= form.hidden_field :_destroy
= link_to_remove_fields "Remove Image", form
gallery_controller.rb
def gallery_params
params.fetch(:gallery, {}).permit(:title, :description, :top_image, gallery_images_attributes: [:id, :image, :_destroy])
end
Parametrs in the server logs
Parameters: {"utf8"=>"✓", "authenticity_token"=>"d7Zb8wVKVU6omi9Aicvr4WIgz+TcN7Cl40w9wneBhas=", "gallery"=>{"title"=>"gfhgf", "description"=>"hfghfghgf", "gallery_images_attributes"=>{"1390804105999"=>{"image"=>#<ActionDispatch::Http::UploadedFile:0xcaa7d94 @tempfile=#<Tempfile:/tmp/RackMultipart20140127-3901-tz2cb9>, @original_filename="abc.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"gallery[gallery_images_attributes][1390804105999][image]\"; filename=\"abc.jpg\"\r\nContent-Type: image/jpeg\r\n">, "_destroy"=>"false"}}}, "commit"=>"Create Gallery"}
Everything is running fine even it is sending the image attribute but it is not saving. Can anyone tell me where is the problem?
Hello
Not really an issue , just refactoring some code in my fork. I was wondering , why are using separate form builder here rather than the one from CMS? I understand you didint want to intertwine parts too closely, but I don't see this engine being used outside of comfy. Is there any other reason?
https://github.com/comfy/comfy-blog/blob/master/lib/comfy_blog/form_builder.rb
Thanks
When I click on "delete" at the list of comments for a blog post, I get a NoMethodError
I think this is easily fixed by adding ':remote => true' in the view.
In app/views/admin/blog/comments/_comment.html.erb line 8 is:
<%= link_to 'Delete', admin_blog_comment_path(comment), :method => 'delete', :confirm => 'Are you sure?' %>
but instead should be:
<%= link_to 'Delete', admin_blog_comment_path(comment), :method => 'delete', :confirm => 'Are you sure?', :remote => true %>
This fixes the issue for me
The values of new comments are posted in the blog_comment
key of the params
hash but the controller fetches and permits the values of comment
.
# comfy-blog / app / controllers / blog / comments_controller.rb
# Line 30
def comment_params
params.fetch(:comment, {}).permit(:author, :email, :content)
end ^
|___ Should be :blog_comment
The url constructed for blog post pagination contains a duplicate blog name leading to an incorrect url.
For example the following is generated...
http://comfy-demo.herokuapp.com/blog/blogado/blogado?page=2
I think it should be (without the extra '/blogado')
Is there way to export blog into fixtures, just like the CMS?
I get this error creating a new Blog post even if the operation get back a "Blog post created" message and I see "Have A Try" new post into "Blog post cms-admin tab" :
Started GET "/cms-admin/blog_posts/2-have-a-try/edit" for 127.0.0.1 at 2011-08-16 22:47:57 +0200 Processing by CmsAdmin::BlogPostsController#edit as HTML Parameters: {"id"=>"2-have-a-try"} Cms::Site Load (0.3ms) SELECT "cms_sites".* FROM "cms_sites" WHERE "cms_sites"."id" IS NULL LIMIT 1 Cms::Site Load (0.3ms) SELECT "cms_sites".* FROM "cms_sites" LIMIT 1 BlogPost Load (0.4ms) SELECT "blog_posts".* FROM "blog_posts" WHERE "blog_posts"."id" = 2 LIMIT 1 BlogTag Load (0.4ms) SELECT "blog_tags".* FROM "blog_tags" Cms::Upload Load (0.4ms) SELECT "cms_uploads".* FROM "cms_uploads" ORDER BY file_file_name Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/comfortable_mexican_sofa-1.3.8/app/views/cms_admin/uploads/_index.html.erb (17.0ms) BlogTag Load (0.4ms) SELECT "blog_tags".* FROM "blog_tags" INNER JOIN "blog_taggings" ON "blog_tags".id = "blog_taggings".blog_tag_id WHERE (("blog_taggings".blog_post_id = 2)) Rendered vendor/gems/sofa_blog-0.0.1/app/views/cms_admin/blog_posts/_form.html.erb (89.3ms) Rendered vendor/gems/sofa_blog-0.0.1/app/views/sofa_blog/_head.html.erb (1.2ms) Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/comfortable_mexican_sofa-1.3.8/app/views/layouts/cms_admin/_head.html.erb (15.6ms) Rendered vendor/gems/sofa_blog-0.0.1/app/views/sofa_blog/_nav.html.erb (1.4ms) Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/comfortable_mexican_sofa-1.3.8/app/views/layouts/cms_admin/_left.html.erb (11.6ms) Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/comfortable_mexican_sofa-1.3.8/app/views/layouts/cms_admin/_right.html.erb (0.8ms) Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/comfortable_mexican_sofa-1.3.8/app/views/layouts/cms_admin/_center.html.erb (1.3ms) Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/comfortable_mexican_sofa-1.3.8/app/views/layouts/cms_admin/_body.html.erb (41.2ms) Rendered vendor/gems/sofa_blog-0.0.1/app/views/cms_admin/blog_posts/edit.html.erb within layouts/cms_admin (190.7ms) Completed 200 OK in 395ms (Views: 216.3ms | ActiveRecord: 2.2ms) Started GET "/javascripts/comfortable_mexican_sofa/wymeditor/skins/default/skin.css" for 127.0.0.1 at 2011-08-16 22:47:59 +0200 Processing by CmsContentController#render_html as HTML Parameters: {"cms_path"=>"javascripts/comfortable_mexican_sofa/wymeditor/skins/default/skin.css"} 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 57ms NoMethodError (undefined method `gsub!' for nil:NilClass): Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.10.rc1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (3.1ms) Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.10.rc1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (8.8ms) Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.10.rc1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (21.4ms)
... after that is not clear to me where 'the path to post' is, outside cms-admin. Where can I find the new post ? If I go to http://localhost:3001/2-have-a-try/ I still get back the same error :
Started GET "/2-have-a-try/" for 127.0.0.1 at 2011-08-16 23:00:14 +0200 Processing by CmsContentController#render_html as HTML Parameters: {"cms_path"=>"2-have-a-try"} 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 56ms NoMethodError (undefined method `gsub!' for nil:NilClass): Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.10.rc1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.9ms) Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.10.rc1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (7.9ms) Rendered /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/actionpack-3.0.10.rc1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (20.1ms)
gem 'sofa_blog'
to Gemfile:bundle install
rails g blog
returns the error: Could not find generator blog.
I've dug through the sofa_blog source, but can't find where its generator is defined. CMS has its generator in lib/generators.
Can the README please link to a working demo, thanks.
Can blogs also be imported/exported to/from fixtures?
An AbstractController::DoubleRenderError occurred in posts#serve:
Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like "redirect_to(...) and return".
I think this is attributed to https://github.com/comfy/comfy-blog/blob/master/app/controllers/comfy/blog/posts_controller.rb#L16 since there is a show && render(show)
when if the post isn't found https://github.com/comfy/comfy-blog/blob/master/app/controllers/comfy/blog/posts_controller.rb#L49-L51 rescue block fires.
When I run rails generate comfy:blog
or rails generate comfy:gallery
I get this:
/home/austin/.rvm/gems/ruby-2.2.2/gems/comfy_gallery-0.1.3/lib/comfy_gallery/engine.rb:11:in `block (2 levels) in <class:Engine>': undefined method `admin_route_prefix' for #<ComfortableMexicanSofa::Configuration:0x00000004fe2690> (NoMethodError)
from /home/austin/.rvm/gems/ruby-2.2.2/gems/comfy_gallery-0.1.3/lib/comfy_gallery.rb:14:in `configure'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/comfy_gallery-0.1.3/lib/comfy_gallery/engine.rb:10:in `block in <class:Engine>'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from /home/austin/cms/config/environment.rb:5:in `<top (required)>'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/spring-1.3.5/lib/spring/application.rb:92:in `preload'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/spring-1.3.5/lib/spring/application.rb:143:in `serve'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/spring-1.3.5/lib/spring/application.rb:131:in `block in run'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/spring-1.3.5/lib/spring/application.rb:125:in `loop'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/spring-1.3.5/lib/spring/application.rb:125:in `run'
from /home/austin/.rvm/gems/ruby-2.2.2/gems/spring-1.3.5/lib/spring/application/boot.rb:18:in `<top (required)>'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/austin/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
It seems like comfy_paginate is needed in the blog/posts_controller. I see that kiminary and will_paginate conflict is causing this. This has been resolved in other places, but this controller was passed over
CMS tags are not being rendered correctly. We uploaded an image through the image uploader and use the {{ cms:file:file_name.ext:image }}
helper, but it wasn't being rendered as so, we had to use a hard link for the image to come up.
Will try to work on this later. Just opening the issue for now.
the index view (/blog) has a page title and that we can't access directly? what is the best practice for editing this page where all blogs are listed?
I don't see how to add the tag or categories to posts.
Thank you.
I just created my first test app with CMS and Comfy-Blog, and I found that I wasn't able to create new comments.
It looks like the issue is in the generated comments _form partial and the comments controller using different namespaces. The form sends the comment parameters as :blog_comment => {}
, but the controller expects the parameter to be :comment => {}
.
So, either the CommentsController needs to be changed to accept the :blog_comment
hash, or the form should be changed to send the hash as :comment
.
I'm inclined to think that the latter would be preferable for the sake of backward compatibility, but I wanted to ask which you'd prefer before I submitted a PR.
Thanks,
-Matt
On rails 5, when the value is empty string, it will generate /
. If it's nil, it will generate nothing.
> app.comfy_blog_post_path('', '', :slug)
=> //blog//slug
> app.comfy_blog_post_path(nil, nil, :slug)
=> /blog/slug
On rails 4, it's different. Either empty string and nil will generate the same result.
> app.comfy_blog_post_path('', '', :slug)
=> /blog/slug
> app.comfy_blog_post_path(nil, nil, :slug)
=> /blog/slug
I'm using Comfy CMS and Comfy Blog, both at latest (1.12.4, 1.12.2) and it looks like the blogs non-admin posts_controller could use the 'comfy_paginate' helper, but because comfy_paginate is defined in Comfy CMS's Admin Base Controller, the paginate helper wouldn't be available to the non-admin blog base controller.
Now I do understand that this wrapper is barely a week old, so I was wondering if this is a good addition, or is there a reason the wrapper is solely limited to admin controllers? I'm more than happy to help with anything needed.
I only create one blog. And access the URL like this: http://localhost:3000/mxc/blog/market
There is a exception like this:
ComfortableMexicanSofa::MissingPage in Comfy::Blog::PostsController#serve
Cannot find CMS Page at /404
Rails.root: /Users/bing/Codes/comfortable-mexican-sofa-with-blog
Application Trace | Framework Trace | Full Trace
Request
Parameters:
{"cms_path"=>"",
"slug"=>"market"}
I get this error
NoMethodError in Cms_admin/pages#index Showing /home/lsoave/.rvm/gems/ruby-1.9.2-p136/gems/sofa_blog-0.0.1/app/views/sofa_blog/_head.html.erb where line #1 raised: undefined method `enable_caching' for # Extracted source (around line #1): 1: <%= stylesheet_link_tag :blog, :cache => ('_blog' if ComfortableMexicanSofa.config.enable_caching) %>
with this stack :
lsoave@ubuntu:~/rails/github/gitwatcher$ grep sofa Gemfile.lock comfortable_mexican_sofa (1.3.8) sofa_blog (0.0.1) comfortable_mexican_sofa (>= 1.0.46) comfortable_mexican_sofa (>= 1.0.46) comfortable_mexican_sofa (= 1.3.8) sofa_blog lsoave@ubuntu:~/rails/github/gitwatcher$
Hi,
when trying to add a new blog posts, the following exceptions is thrown:
undefined method `simple_field' for #ComfortableMexicanSofa::FormBuilder:0x00000003aba8f8
in /app/views/admin/blog/posts/_form.html.erb where line #27
:
<%= form.simple_field nil, nil, :class => 'submit_element' do %>
I tried adding simple_form
to the Gemfile and changing the initializer to config.form_builder = 'SimpleForm::FormBuilder'
but with no effect.
Am I missing something or is comfy-blog just outdated? :)
I have to use the old 1.12 version because the new one requires Comfy >=2.0.0 which requires Rails >= 5.2, which I don't have time to upgrade to. I'm on Rails 5.0.2
I assumed the old version 1.12 of comfy blog would work with Comfy 1.12, but it doesn't
When creating a new blog I should not get dumped into an error page
ArgumentError in Comfy::Admin::Blog::Blogs#new
gems/comfy_blog-1.12.3/app/views/comfy/admin/blog/blogs/_form.html.haml where line #5 raised
wrong number of arguments (given 0, expected 1)
# List of available application layouts
def self.app_layouts_for_select(view_paths)
view_paths.map(&:to_s).select { |path| path.start_with?(Rails.root.to_s) }.flat_map do |full_path|
Dir.glob("#{full_path}/layouts/**/*.html.*").collect do |filename|
filename.gsub!("#{full_path}/layouts/", '')
Rails version:
5.0.2
CMS version:
1.12
Ruby version:
2.4.0
1.12.3 is from January 2015 and is missing the i18n additions by @paa001.
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.