我正在尝试使用基础6创建一个非画布; 我的想法是我有两个基本的专栏应用程序,然后我尝试隐藏左边的那个,只有当屏幕很小时使用非画布效果,但首先我需要让这个工作:col 2得到完整的显示屏幕宽度和第一列应仅在屏幕上激活.在桌面屏幕上应该只在一个屏幕上显示两列.
我们的想法是拥有内容,而不仅仅是基础示例中的菜单.如何获得描述的效果?
<body>
<div class="off-canvas-wrapper">
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
<!-- Close button -->
<button class="close-button" aria-label="Close menu" type="button" data-close>
<span aria-hidden="true">×</span>
</button>
<!-- Page1 content -->
</div>
<div class="off-canvas-content" data-off-canvas-content>
<!-- Page2 content -->
</div>
</div>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
检查此代码:https: //jsfiddle.net/q1e45fzz/16/
我有三个类:用户,订阅和计划.我想加载用户没有的所有计划.在Rails中最好的方法是什么?
我有两个集合:current_user.subscriptions
和Plan.where(active: true)
,我使用mongoid
def dashboard
@plans = Plan.where(active: true)#.each { @plans.delete_if has_current_user_plan subscription.title }
end
def has_current_user_plan(name)
current_user.subscriptions.where(title: name, active: true).exists?
end
Run Code Online (Sandbox Code Playgroud)
class User
has_many :subscriptions
Run Code Online (Sandbox Code Playgroud)
class Subscription
belongs_to :plan
belongs_to :user
Run Code Online (Sandbox Code Playgroud)
class Plan
has_many :subscriptions
Run Code Online (Sandbox Code Playgroud)