Jaroslav Horák

Joined

34,400 Experience
341 Lessons Completed
0 Questions Solved

Activity

Hi, sadly no. I have to use a gem https://github.com/comfy/active_link_to

Hi Chris,
if I post Tweet with publish_at at 8am and reschedule it to 9am wouldn't have the first job Tweet instance with 8am?
Shouldn't I send to job only an id and find actual Tweet inside the job with latest publish_at to check?

Posted in Rails for Beginners Part 31: Tweet Partial Discussion

Hi Chris,
in video at 4:00 in tweet model. You use self.publish_at in after_initialize but only tweet_id? in published?
Why is one with self and other is not with self?

Twitter is lame =(
"Your application has been reviewed. Thank you for your interest. Unfortunately, we’re unable to to approve your application."

It's there an easy way to mark current page in navigation?

You can add 'defer' attribute on the script tag.

Hi,
I have two models User and Event.
User should belong to one group and User could attend Event based on selected group.
Event could be open for one or many groups.

My first solution was to create a Group model with has_one User and has_and_belongs_to_many for Event.
But client would not change those groups.
So is there a better way to do it without extra model and DB?

I think about something with enums but don't know how to do it with multiple groups on Event.
Or maybe there is some other solution?
Any tips? =)

Posted in Caching with Etags Discussion

Can I use this with associations in views?
I have post with author and use fresh_when on post. If I change author will it render on post view old author or new one?

Posted in How do I use Devise in normal AND API mode

Hi guys,
I want to use Devise for creating users with mobile app via REST API but I also want use it in classic fashion.
So in API I want to return JSON and appropriate HTTP codes. Also I want to issue JWT token for authentication for mobile app.
On web I want normal devise functionality.
How I should structure controllers, router and other stuff? I cant find any good resources about this.
Thank you guys.

Hi, It is a good idea to send a bunch of SMS messages after create action?
It will be better to put it in background job wouldn't?
Like with batch emails.

This is gold! Great video.
I have two questions.
Is there a way, for better SEO, to move filter params to URL?
Instead of /televisions?brand=Brick to /televisions/brand/brick ?
And second question, how to handle multiple values for attribute?
For example, if I have a color attribute for a television and the tv comes in three colors options 'Black', 'White' and 'Silver'.
Should I make three different televisions or save it as array? Or make another table or use something like hstore?
What is the best approach and how to use this filter with it?

Posted in Interface Segregation Principle Discussion

I like how this serie changing my point of view. 

Posted in Vue.js Components in Rails Views Discussion

Nice video. What about Vue state managment in Rails. When one Vue component mess with state of another Vue component?

Posted in Vue.js Trello Clone in Rails - Part 7 Discussion

Great course! I want to see something about routing with Vue. In original Trello application when you click on card the url change.
Would be awesome if you cover the Rails 5.2 features, mainly Active Storage and https://github.com/stimulus...

Posted in Vue.js Trello Clone in Rails - Part 5 Discussion

I will try flexbox instead. It is 2018 =)
Maybe something like this https://codepen.io/jaahoo/p...

Posted in How do I do multiparameter filter

Hi,
I have some sort of e-shop. I have Category model and Product model. Product has some parameters like color, material, price etc.
My question is what approach to use to filter by these parameters and categories.
Best way to include url too to be SEO friendly. Example:
www.example.com/category/subcategory/color/material?priceFrom=100&priceTo=1000
Is there some gem? Or what do you use?

Posted in Manage Assets With Rails Assets Discussion

Hi I am trying Rails Assets but I approach to a problem. I included Bourbon but when I tried use any mixin Rails told me that mixin is undefined. What to do?

Posted in File Uploads with Refile Discussion

It is Refile good for uploading video files? I need upload video files (not host them on youtube, vimeo, etc.) and maybe do some post production (format convert/generate, add watermark...).

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.