Coder Social home page Coder Social logo

Comments (13)

joemsak avatar joemsak commented on July 19, 2024

This should be line 15... can you confirm?

<% if (tags = post.tags).any? %>

from refinerycms-blog.

mirosr avatar mirosr commented on July 19, 2024

Yes it is:

   <% if (tags = post.tags).any? %>
      <aside class='tagged'>
        <%= t('tagged', :scope => 'blog.posts.show') %>
        <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %>
      </aside>
    <% end %>

from refinerycms-blog.

joemsak avatar joemsak commented on July 19, 2024

I'll be honest I am pretty stumped by this. Anyone else?

from refinerycms-blog.

joemsak avatar joemsak commented on July 19, 2024

Oh wait, you said in bulgarian... I wonder if we need to transliterate? Can you fork and see if transliterating helps?

tagged_posts_path(tag.id, transliterate(tag.name).parameterize)

from refinerycms-blog.

mirosr avatar mirosr commented on July 19, 2024

OK, I've tried with transliterate, but with no success.

ActionController::RoutingError in Blog/posts#index

Showing refinerycms-blog-1.6.2/app/views/blog/shared/_post.html.erb where line #18 raised:
No route matches {:controller=>"blog/posts", :action=>"tagged", :tag_id=>1, :tag_name=>""}
Extracted source (around line #18):

15:         <% if (tags = post.tags).any? %>
16:           <aside class='tagged'>
17:             <%= t('tagged', :scope => 'blog.posts.show') %>
18:             <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.id, ActiveSupport::Inflector.transliterate(tag.name).parameterize) }.to_sentence %>
19:           </aside>
20:         <% end %>
21:       </section>

I didn't see how transliterate will help?! Because it transforms sting in Cyrillic to series of '?'. And the when parameterize is called the result is an empty string.

from refinerycms-blog.

joemsak avatar joemsak commented on July 19, 2024

Can you try this in your Gemfile

gem 'refinerycms-blog', :git => '[email protected]:resolve/refinerycms-blog.git'

$ bundle update

and tell me if it's okay with Bulgarian tag names now? I made the parameter :tag_name optional in routes.rb

from refinerycms-blog.

mirosr avatar mirosr commented on July 19, 2024

Yes, now it's OK. Tag name is indeed optional (/blog/tagged/1?tag_name=). The posts are listed. Tags are shown in

. I can even filter posts by selected tag.

from refinerycms-blog.

joemsak avatar joemsak commented on July 19, 2024

Would you consider this issue resolved?

from refinerycms-blog.

joemsak avatar joemsak commented on July 19, 2024

kinda sucks about that ?tag_name= part

from refinerycms-blog.

mirosr avatar mirosr commented on July 19, 2024

I don't like these "?tag_name=" neither. I'm not an expert in Refinery but why the tag_name should be passed if the tag_id has already been passed to the controller?

from refinerycms-blog.

joemsak avatar joemsak commented on July 19, 2024

Just for prettiness in the URL

I don't know off hand how to make empty params stay out of the URL but I'm
sure there is a way

I don't like these "?tag_name=" neither. I'm not an expert in Refinery but

why the tag_name should be passed if the tag_id has already been passed to
the controller?

Reply to this email directly or view it on GitHub:
https://github.com/resolve/refinerycms-blog/issues/85#issuecomment-1475474

from refinerycms-blog.

mirosr avatar mirosr commented on July 19, 2024

Just for prettiness in the URL

I thought so. :)

I have a suggestion. The show action of categories is invoked with url /blog/categories/category_name. In my case the category_name is in Cyrillic and the posts in that category are listed. So if it's working for categories is it possible the same approach to be used for the tags too?

from refinerycms-blog.

joemsak avatar joemsak commented on July 19, 2024

I'm closing this and opening a new issue around the params

from refinerycms-blog.

Related Issues (20)

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.