小编Meh*_*yer的帖子

资产application.css未声明,但在清单中声明

我收到此错误:

ActionView::Template::Error (Asset `application.css` was not declared to be precompiled in production.
Declare links to your assets in `app/assets/config/manifest.js`.

  //= link application.css
and restart your server):
Run Code Online (Sandbox Code Playgroud)
  • Rails 5.1.4

  • 链轮(4.0.0.beta5、4.0.0.beta4、3.7.1)

  • 链轮轨道(3.2.1、3.2.0、2.3.3)

Manifest.js

//= link_tree ../images

//= link_directory ../javascripts .js

//= link_directory ../stylesheets .css
Run Code Online (Sandbox Code Playgroud)

Assets.rb

# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'

# Add additional assets to the asset …
Run Code Online (Sandbox Code Playgroud)

sprockets rails-sprockets ruby-on-rails-5.1

7
推荐指数
1
解决办法
482
查看次数

prepareForSegue是在视图控制器之间传递值的正确方法

我正在尝试学习Swift,我正在尝试开发着名的音符应用程序.

有一个绑定到tableview的数组和另一个用于添加注释的视图.在第二个视图中,textfieldshouldreturn事件触发segue并返回tableview.

我想知道这是否正确.因为通过这种方式,我正在操纵另一个视图控制器中的变量.我不是MVC大师,但我觉得这是错的.这是我的代码片段:

func textFieldShouldReturn(textField: UITextField) -> Bool {

    self.performSegueWithIdentifier("backSegue", sender: self)
    return true
}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    if(segue.identifier == "backSegue"){
        let navController = segue.destinationViewController as UINavigationController;
        let myController = navController.topViewController as NotesTableViewController;
        if(self.ourTextField?.text != nil || self.ourTextField?.text != ""){
            myController.notes.append(self.ourTextField?.text ?? "");
        }

    }
}
Run Code Online (Sandbox Code Playgroud)

谢谢.

ios segue swift

6
推荐指数
1
解决办法
1600
查看次数