Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link form the model #3

Open
luizpicolo opened this issue Sep 28, 2016 · 2 comments
Open

Link form the model #3

luizpicolo opened this issue Sep 28, 2016 · 2 comments

Comments

@luizpicolo
Copy link
Owner

luizpicolo commented Sep 28, 2016

The link to the news should be modified as the user's needs. Today the link is fixed by the name of 'noticias', but it could be anything, 'Blog', "Texts". We should have a way so that the route could follow the name defined in the model. Example:

If model is Blog

element += '<a href="/blog/' + ui.item.content_builder_category.slug + '/' + ui.item.slug + '" class="cb-relational__link" target="blank"></a>';

if model is Text

element += '<a href="/texts/' + ui.item.content_builder_category.slug + '/' + ui.item.slug + '" class="cb-relational__link" target="blank"></a>';

of course, all dynamically without changing the name manually
https://github.com/luizpicolo/rails_admin_content_builder/blob/master/app/assets/javascripts/rails_admin/content_builder.js.erb#L468

@luizpicolo luizpicolo changed the title Test Again Link form the model Sep 28, 2016
@DearGrenadier
Copy link

I'll try, if you don't mind

@luizpicolo
Copy link
Owner Author

Hey my friend @dimanazarchuk, go ahead 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants