话唠

来源:互联网 发布:现在软件行业怎么样 编辑:程序博客网 时间:2024/06/11 02:33

1、rails4项目中有了安装了bootstrap,貌似可以直接使用bootstrap的css和js,试试看吧。

2、

<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>< ![endif]-->

原来这句话时用来是IE9之前的版本兼容HTML5元素的,才知道。。。


3、

form_for    f.select 用法

@departments = Department.all.collect { |department|[department.department_name, department.id]}

<%= f.label :department_id, "部署" %><%= f.select :department_id, options_for_select(@departments) %>

4、

rails console里记得可以用类似于user.errors.full_messages来查看错误何在?

5、

error: Your local changes to the following files would be overwritten by merge:
        .gitignore
Please, commit your changes or stash them before you can merge.
Aborting

解决办法 git stash 然后 git merge origin/master  ,接着 git stash pop

5、

resources :users do    member do      get :following, :followers    end  end
resources :users do  collection do    get :tigers  endend
区别在于 第一个  url 是    /users/1/following 和 /users/1/followers

     第二个url是 /users/tigers

6、 

绿茶婊中的语文课代表

7、

解决rails s  出错

lsof|grep 3000

kill -9 xxxx

8、

0 0
原创粉丝点击