小编seq*_*e90的帖子

ActionController :: UrlGenerationError:尝试测试控制器时没有路由匹配

我得到一个ActionController :: UrlGenerationError:没有路由匹配(:action =>"edit",:controller =>"目标")错误,当我试图测试目标控制器

这是我的goals_controller_test.rb

require 'test_helper'

class GoalsControllerTest < ActionController::TestCase
  test "should be redirected when not logged in" do
    get :new
    assert_response :redirect
    assert_redirected_to new_user_session_path
  end

  test "should render the new page when logged in" do 
    sign_in users(:guillermo)
    get :new
    assert_response :success
  end

  test "should get edit" do
    get :edit
    assert_response :success
  end

  test "should get show" do
    get :show
    assert_response :success
  end
end
Run Code Online (Sandbox Code Playgroud)

这是我的routes.rb

Rails.application.routes.draw do
  devise_for :users

  authenticated :user do
    root 'du#dashboard', as: "authenticated_root"
  end …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails

3
推荐指数
1
解决办法
5212
查看次数

iOS 11浏览器图像错误

滚动页面时,iOS 11中出现以下错误。(在Firefox,Safari和Chrome中)。在Android设备中不会发生错误。

这些是背景图片,我不知道这是否可能是导致错误的原因。

在此处输入图片说明

预期的图像

图片2显示了图片的意图和在Android中的显示方式。

<div
  className="shelf-page-lists-icons-background"
  style={containerImage}
/>
<div
  style={styles.container}
>
  <p style={styles.listsTitle}>{list.title}</p>
</div>


  CSS 

  containerImage = {
    backgroundImage: url(${list.image}),
    backgroundSize: 'cover',
    height: 150,
    borderRadius: 4,
    position: 'absolute',
    width: imageWidth,
    overflow: 'hidden',
  }

  container: {
    height: 150,
    display: 'flex',
    flexDirection: 'column',
    justifyContent: 'flex-end',
    marginBottom: 10,
    padding: '0px 40px 13px 16px',
  },


  .shelf-page-lists-icons-background {
    opacity: 0.84;
    filter: brightness(0.4)
  }
Run Code Online (Sandbox Code Playgroud)

css image ios reactjs

3
推荐指数
1
解决办法
1605
查看次数

标签 统计

css ×1

image ×1

ios ×1

reactjs ×1

ruby ×1

ruby-on-rails ×1