This ‘omniauth-stripe-connect’ gem makes it simple to get a Rails application communication with Stripe using Stripe Connect and OAuth 2.0. https://github.com/isaacsanders/omniauth-stripe-connect And stripe documentation https://stripe.com/docs/connect/getting-started#register-application
Tag Archives: rails
Resources for setting up Passenger and RVM on a CentOS cPanel / WHM Server
Basic steps to get RVM, Ruby and Passenger running on a CentOS cPanel / WHM Server This initial guide was pretty accurate and worked through most of the installation – up until running # bundle exec rake assets:precompile Attempting to … Continue reading
Purge or recreate a Ruby on Rails database – Stack Overflow
Link
Rails Best Practices slideshow
Link
Preserve Rails Ferret Index with a Symlink and Capistrano
Link
Preserve Rails Ferret Index with a Symlink and Capistrano
First, deploy your app and build your index. Once that’s done, copy your index folder to the shared folder:
cp -R /path/to/your/app/current/index /path/to/your/app/shared/
Lastly, in your deploy.rb file that you use to control your deployments, tell capistrano to create a symlink to the shared directory for your ferret index:
desc "Preserve ferret index"
task :after_update_code, :roles => [:web] do
run <<-EOF
ln -s #{shared_path}/index #{latest_release}/index
EOF
end
Simple static pages in ruby on rails.
Link
Simple static pages in ruby on rails.
— April 2, 2008 at 09:38 PDT
Simple things should be simple, complex things should be possible. — Alan Kay
Here’s a tiny little tip for handling those boiler-plate pages that aren’t part of your app’s functionality but you usually need anyway. It’s good for setting up about, contact, copyright, etc. You can always throw those pages into /public as static html files, but if you want them to get styled with layouts, they need to be rendered as actions. This is a way to do that simply. It’s not rocket science, but I haven’t done a noob post in ages and I’m getting over a cold and I haven’t posted in too long so gimme a break.
Say you want to have a simple landing page and a few typical boiler-plate pages. Let’s start with the routes.
In config/routes.rb
map.root :controller => 'home'
map.home ':page', :controller => 'home', :action => 'show', :page => /about|contact/
In app/controllers/home_controller.rb
def index
# render the landing page
end
def show
render :action => params[:page]
end
Throw your about.html or about.html.erb and other pages into app/views/home and you’re good to go. If you’ve set up page caching, this won’t even slow your app down.
The :page => /.../
bit in the route constrains it to match only those specific urls. If you want, you can change that to a constant, like HomeController::
PAGES, so it’s easier to manage.
If you want to link to those pages, you can use the route helper methods, home_path
and home_url
link_to 'About', home_path('about')
You could always unroll the routes and have a separate route for each page, but I find this way a bit drier. But if you’d rather have a specific named route helper for each page, that’s an okay way to go. Either way, you get to use layouts in your pages, and have a nice simple way to get them rendered.