Drilon Buzuku

Joined

620 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in How do I install bootstrap-v4 via yarn?

Hey Guys,

I tried to install bootstrap4 via yarn. And I tried it like this:

  1. yarn add bootstrap@4.0.0-alpha.6
  2. rails webpacker:compile
  3. add the line: import 'bootstrap/dist/css/bootstrap' (also tried bootstrap@4.0.0-alpha.6 instead of simply writing bootstrap) in javascript/pack/application.js
  4. add the line: *= require bootstrap/dist/css/bootstrap to application.css
  5. add the line: <%= javascript_pack_tag 'application' %> to layouts/application.html.erb

But it didn't work out. How do I install bootstrap via yarn? Is it recommended to install bootstrap via yarn? Or is it a better practice to install bootstrap through the bootstrap gem?

Cheers,

Drilon

Hey Guys,

do I have to publish the source code of a commercial app if I use a GPL licensed gem like prawn?

Cheers,

Drilon

Hey Guys,

I'm interested in knowing, why some developers choose ams over jbuilder and some prefer jbuilder over ams, to build Rails based API's.

Cheers,

Drilon

Hello,

I need a week model which contains all weekdays and every weekday has multiple opening and closing times.
For example, a barber shop is open on every monday from 9 a.m. to 11 a.m. and 1 p.m. to 7 p.m.. Should i create a week model which has weekday fields, like this [1] and then serialize them as a hash?
[1]
def change
create_table :week do |t|
t.text:monday
t.text :tuesday
t.text :wednesday
.....
t.text:sunday
end
Pseudocode:
last_week = Week.last
last_week.monday = {:start_time => "9 a.m.", :end_time => "11 a.m."}
last_week.friday = {:start_time => "6 a.m.", :end_time => "11 p.m."}

How would you approach this?

Cheers,

Drilon

Thanks for answering Jacob! I appreciate it. Seems like a good way to tackle the problem! :)

Hey guys,

how can one setup a service booking system where the customer can book services between 9am and 4pm on every monday and friday? Would you use the ice_cube gem to create timeslots and then suggest the customer appointments in a given time frame? How would you approach this kind of problem?

Kind regards,

Drilon

Posted in RSpec w/capybara vs Mini Test

Hey guys,

what are your thoughts on RSpec vs Mini Test. Which one do you use and why?

Cheers,

Drilon

@Chris Oliver @Maud de Vries thank you!

Hey guys,

has anyone advice on this one? Are there maybe better ways to handle document uploads in rails?

Thanks for your answer and especially your content! Keep it up!

Are there any ruby gems for this specific problem? Or should I just use ActionMailer from Rails? If ActionMailer are there any tutorials on this topic online?

oh ok! makes a lot of sense! Thanks for the quick answer :)

Why do we initialize the customer in the base class when its already initialized after a customer object/instance is created in the controller?

Hey I would like to add "working days" to a task model and "working hours" on a shift model wich belongs to the task model.
So that I can select on which days a task will be repeatedly done and assign a employee trough a join table to it. May thanks in advance!

Posted in Is anyone using Rails 5 yet?

I'm not too sure about this, but there should be some breaking changes between Rails 4 and 5.

Cheers

Posted in Is anyone using Rails 5 yet?

Yes but there was apparently a problem with sprockets 3.7.0 till yesterday, caused by the method register_engine which is deprecated. If you started the puma server it printed something as follows in the terminal:
DEPRECATION WARNING: Sprockets method register_engine is deprecated. But now all of a sudden there's no warning anymore without making any changes to the /sass-rails-5.0.5/lib/sass/rails/railtie.rb file where the method is used.