Skip to content

Instantly share code, notes, and snippets.

%li
= link_to "Remove from collection", remove_from_collection_posts_path(cid: params[:id], pid: post.id), data: { confirm: "Are you sure you want to remove this post?" }, remote: true
require 'rails_helper'
require 'pry'
RSpec.describe UsersController, type: :controller do
let(:climber) { User.create!(email: '[email protected]', password: '123456', first_name: 'test', last_name: 'test',
user_name: 'climber') }
let(:setter) { User.create!(email: '[email protected]', password: '123456', first_name: 'test', last_name: 'test',
user_name: 'setter', route_setter: true) }
let(:owner) { User.create!(email: '[email protected]', password: '123456', first_name: 'test', last_name: 'test',
user_name: 'owner', gym_owner: true) }
def rhost(www = nil)
if request.host != "www#{env_dev}.a.a"
request.host.gsub(/^w+(|\d+)\./, "").gsub(/\.a\.a/, "")
elsif www == 1 && request.host == "www#{env_dev}.a.a"
'www'
elsif www == 2
'test'
else
nil
end
@tbuehlmann
tbuehlmann / a.rb
Created February 10, 2019 11:51
demo
# a.rb
require_relative 'a/b'
module A
end