Activity
Posted in Subscriptions with Stripe Discussion
Awesome! I haven't heard back from them yet, so maybe it was a little downtime on their end yesterday.
Posted in Subscriptions with Stripe Discussion
I'll ping Wistia and see if they have an idea why that's happening. Worst case I imagine I can re-upload it.
Posted in Subscriptions with Stripe Discussion
Hmm, I tried downloading too and it keeps cutting short. It should be almost 600MB. Not sure what's wrong. Does the video fully load for you?
I still need to walk through deploying this to production, but you should be able to use Puma just fine in production.
Yes it is. Not sure why it's not opening for you but, here's a Youtube link https://youtu.be/VvuPsXQwRrQ
Octobuild sounds like an awesome idea! I hadn't heard of it. Thanks for sharing that!
Also awesome start to the USDS project! It looks great so far. Nice and simple. :)
You can probably create a validation for it somehow. You'd need something to read the video in Ruby and check the length. Ideally people are uploading the same format of video all the time so you can do that easily.
This is a pretty awesome site to learn about it, also they have a bunch of links to screencasts: http://betterspecs.org/#scr...
You should be able to just upload them! Just make sure you don't include any validations that force images or styles that try to resize them. You'll just want to have raw uploads in that case. That's really all you need to do.
That would be the Turbolinks progress bar. It gives you a sense of progress since the site is using Turbolinks and the browser doesn't actually show progress when pages are loading. You can find out some more about it here: https://github.com/rails/turbolinks#progress-bar
I'm just storing the wistia video ID in Rails and then embedding the videos.
The one thing I might think of is that you want to make sure you're using ERb asset_url helper appropriately to reference your images. If you're using those through CSS, you can use the "asset-url" helper in your CSS. The urls that are used in production have different URLs than in development so you have to use these helpers.
Posted in PDF Receipts Discussion
It's basically designed to be simpler rather than customizable, but you can take the PDF code that's in the gem and adapt it easily to add your own header and footer. Take a look at this code: https://github.com/excid3/r...
Thanks for the kind words Felipe! I really appreciate it. :) Really glad you like the gem and the architecture of it! I think the videos turned out to be really fantastic documentation that I never planned. :)
You can update your config when you setup Omniauth, you can specify your scope there. There are a lot of options for this, so just look up the available scopes for facebook to get the full list.
config.omniauth :facebook, "APP_ID", "APP_SECRET", scope: 'email', info_fields: 'email, name'
Posted in AASM state based on variable
This is more just a stylistic refactor, but you could also smash the event blocks inline to make them shorter. I also prefer case statements to ifs in situations like this. They're a little cleaner to read and using a ternary if statement for total_price also looks a little nicer, but this is all personal preference.
before_save :check_budget
event :over_budget { transitions from: [:new, :new_approval_needed], to: :new_approval_needed }
event :on_budget { transitions from: [:new, :new_approval_needed], to: :new }
def check_budget
case aasm_state
when 'new', 'new_approval_needed'
(total_price > 500) ? over_budget : on_budget
end
end
I didn't know about human_state
! That's super useful! It also makes sense that they have locale options for the names. That's something I would have not even though of providing but makes perfect sense that they provide that.
Hey Josh,
I would love to see this! I think what you're looking for is learning how to create generators that install things from a gem. I've been building the simple_calendar gem and made an episode on how you can create generators that should be helpful. https://gorails.com/episodes/vlog-day-13?autoplay=1
The next step after you get a basic generator done is to take a look at the refills gem and see how they build the "import" generator. I'm not entirely sure, but it should be a good basis on how to do that. I've yet to dive into any of the USDS styleguides, but this would be a really really cool gem to make and should help adoption of it a lot. You'd be famous if you get this built. :)
Whoo! Thank you thank you! :)
Posted in AASM state based on variable
This is basically what the code would look like. There's not a significant way to refactor this other than pulling it out into a concern, but that hides the problem more than it cleans it up.
When you need to print out aasm_state
, you can convert it from the string by doing this aasm_state.gsub("_", " ")
to remove the underscores. You can then upcase the string or whatever you need to make it display nicer.
Absolutely! You can just pass in an array with all the meetings and then inside the block you can print them out differently using a helper or something. Rough outline here, first section goes in the controller.
# Pass @meetings into the calendar
@meetings = work_meetings + personal_meetings
<% month_calendar meetings: @meetings do |day, meetings| %>
<% meetings.each do |meeting| %>
<% if meeting.meeting_type == "work_meeting" %>
Code for work meeting
<% else %>
Code for personal meeting
<% end %>
<% end %>
<% end %>