Git Product home page Git Product logo

comfy-blog's People

Contributors

6temes avatar bgilham avatar bitdeli-chef avatar dinatih avatar forever-sumit avatar gbh avatar gr8bit avatar jackbot avatar jackneto avatar jarilammi avatar kirichkov avatar man0s avatar marekurzon avatar ozkar99 avatar paa001 avatar weiyizheng avatar zjuric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

comfy-blog's Issues

Update of readme required? or am I misunderstanding the config

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'

Inline rendering of blog posts prevents customization of the view for Posts#show

Expected behavior

To be able to customize the presentation of a single blog post by changing the view template.

Actual behavior

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

render inline: @cms_post.content_cache,

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.

System configuration

Rails version:
5.2.0

CMS version:
2.0.15

Ruby version:
2.5.1p57

Why Post excerpt?

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?

`rails test` results in sprockets error

Note: For general questions and feature requests please leave a message
on Gitter: https://gitter.im/comfy/comfortable-mexican-sofa

Expected behavior

Running rails test or bundle exec rails test to run tests.

Actual behavior

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

Steps to reproduce

  1. Clone the repository and cd into it
  2. Run gem install bundler
  3. Run bundle install
  4. Run bundle exec rails test

System configuration

Rails version: 5.2.3

CMS version: n/a

Ruby version: 2.5.1p57

NameError in Blog Posts form tab

Expected behavior

Admin Blog Posts tab should open form after template has been created

Actual behavior

Blog Posts returns Rails error
NameError in Comfy::Admin::Blog::Posts#new
screen shot 2018-04-10 at 2 13 30 pm

I should note that when a layout is not defined a form renders but I can't edit content (makes sense)
screen shot 2018-04-10 at 2 18 22 pm

Steps to reproduce

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

System configuration

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

admin_route_prefix undefined

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 methodadmin_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?

undefined method `paginate' for []:ActiveRecord::Relation

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.

Configurable templates

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?

ComfyBlog on Rails 6.1 calls @post.update_attributes!, not @post.update!

Expected behavior

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.

Actual behavior

Instead:

NoMethodError at /admin/sites/1/blog-posts/1
undefined method `update_attributes!' for #<Comfy::Blog::Post:0x00007fd0e59769c8>
Did you mean?  update_attribute

Steps to reproduce

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.

System configuration

Rails version: 6.1.0
CMS version: 2.0.19
Ruby version: 2.0.7

Comfy-Blog routes are not identited

 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

blog_routes_not_identified

but cms working fine.
Can some tell me how to make this blog work with cms?

Superclass mismatch

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'

Point domain to blog?

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!

Blog posts are returned unsorted from PostsController#index

Expected behavior

Index should return @blog_posts sorted according to their published date

Actual behavior

@blog_posts are returned unsorted. This can result in a blog post appearing on multiple pages and others not appearing at all.

System configuration

Rails version:
5.2.0

CMS version:
2.0.15

Ruby version:
2.5.1p57

Need help with translations

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)

  • Català
  • Česky
  • Dansk
  • Deutsch
  • Español
  • Suomi
  • Français
  • Ελληνικά
  • Italiano
  • 日本語
  • Norsk
  • Nederlands
  • Polski
  • Português Brasileiro
  • Русский
  • Slovensky
  • Svenska
  • Türkçe
  • Українська
  • 简体中文
  • 正體中文

no such file to load

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 cms
works fine without any DB conflict ...

Q: Embed blog in comfy page?

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?

Nested attribute not saving in rails 4.

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?

Deleting comments on blog posts causes NoMethodError

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

Can't create comments in Rails 4.

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

Fixtures

Is there way to export blog into fixtures, just like the CMS?

undefined method `gsub!' for nil:NilClass

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)

Could not find generator blog

  • Added gem 'sofa_blog' to Gemfile:
  • Ran bundle install
  • Now running 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.

  • Rails: 3.1.1
  • Ruby: 1.9.2p290

Fixtures

Can blogs also be imported/exported to/from fixtures?

DoubleRenderError when post does not exist

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.

Error: undefined method `admin_route_prefix'

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>'

CMS tags not working

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.

Add i18n

Will try to work on this later. Just opening the issue for now.

editing index view (/blog)

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?

Can't Create New Comments

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

site & blog path should be nil by default

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

New comfy_paginate wrapper

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.

undefined method `enable_caching'

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$

undefined method `simple_field'

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? :)

Error in the old 1.12 version

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

Expected behavior

When creating a new blog I should not get dumped into an error page

Actual behavior

  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/", '')

Steps to reproduce

  1. Install Comfy blog 1.12 in a working Comfy 1.12 system
  2. Generate and run migrations
  3. Go to the admin page and click on 'Blogs' in the left menu
  4. Click the 'New Blog' button.
    You get dumped into the error page

System configuration

Rails version:
5.0.2
CMS version:
1.12
Ruby version:
2.4.0

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.