Activity
Posted in Page Specific Javascript
That's actually what I would recommend doing. If you set up your JS to look for data-behavior
tags like I covered in this episode you can load things into those tags.
The best way is not to really have page specific javascript, but instead to have these little widgets that can be reused anywhere by detecting things on the page. It'll keep the JS and Rails code very separate and the flexibility of making it not tied to specific pages helps a lot in the future.
If you haven't tried this already, you'll probably want to include bourbon with @import instead of the require statements so you can use it in your sass code.
It should, but with more complex things like ckeditor, you might have to have those lang/en.js files compiled separately. Something like this based upon the filename in the Rails Assets gem.
config.assets.precompile += %w( lang/en.js )
This is definitely one part where the documentation with Rails Assets is poor.
Definitely. This is where form objects tend to make a lot more sense because it's that much more complicated. An intermediate step of uploading, processing, and finding errors before doing the actual import can be a good thing for this too.
It's really, really well done. Props to the authors!
I'm definitely migrating over some older apps too! :)
Posted in Page Specific Javascript
This is a really great question Michael. Do you have examples of what kind of Javascript you intend to run on specific pages? I can give you some generic advice, but it's always easier to understand with some examples.
Posted in Multitenancy with Apartment Gem
Are you executing pg_dump
manually from the command line? I've noticed that when it's run without the user option, it defaults to the current operating system username. Wondering if that is what's happening.
I haven't had the time to find any solution to that recently. Hopefully someone can leave a comment if they find a solution!
Posted in Setup MacOS 10.10 Yosemite Discussion
Sounds like your server isn't running. You can run "brew info postgres" to get the instructions for starting the postgres server.
It should be in the top right if you click on "Account" in the navigation too.
Posted in File Uploads with Refile Discussion
Yes you can. This isn't specific to Refile, but just some regular Javascript hitting the browser File api. http://jsfiddle.net/LvsYc/
Posted in Setup MacOS 10.10 Yosemite Discussion
Try restarting your terminal. That usually fixes it.
Posted in Setup MacOS 10.10 Yosemite Discussion
Yep they should! I use ZSH too, but it supports almost the exact same syntax.
Posted in Multitenancy with the Apartment gem
You probably want to create a Rake task to run through your existing users and create their tenants. You could also do this in the Rails console. Just loop through each user and then create the tenant and that should be it.
Another solution is you could catch the error when the tenant doesn't exist and to create it then. This would let you roll it out and they would each be created as they were used.
I'd probably recommend the first option because it means that all your users are running on the same code all the time. It's generally better to have consistent data than not.
The &:symbol
syntax basically just turns a method name into a block to call. What it is doing is sorting the array of events by the simple_calendar_start_time
column. First we select out the ones for the day in the select block and then we sort by the start time so that all the events are filtered and in order.
That make more sense?
What isn't working for you?
Posted in Admin for the specific case
I think Pundit would make a lot of sense for this. With Pundit, you're passing in the user and you can use it to evaluate whether the user has access to the object. Instead of putting the authorization logic int a method on the Work model, you can do it inside the Pundit class instead. That makes things a lot better organized and manageable for you.
Definitely need to get on this one! It's one of the most requested things and I just need to sit down and do it. I'm just using the Stripe JS library coupled with the Rubygem. The JS turns the card into a token, sends it to the server, and the server charges the card and updates the user. That's about it.
I'll make sure to bump this topic up in the queue so I can record it soon.
Just shovel those onto the csv outside of the records loop. Pass in the values you want and they should show up at the bottom.