首页 \ 问答 \ 继续为#获取未定义方法'bio'的未识别方法'bio'(Keep getting unidentified method 'field' for undefined method `bio' for #)

继续为#获取未定义方法'bio'的未识别方法'bio'(Keep getting unidentified method 'field' for undefined method `bio' for #)

我刚刚将我的应用程序部署到Heroku,我正面临着这个问题。 在注册页面中:

<div class="field">
    <%= f.label :bio %><br />
    <%= f.text_field :bio %>
  </div>

并在日志中

ActionView::Template::Error (undefined method `bio' for #<User:0x007f5e772493c0>):
<div class="field">
        <%= f.label :bio %><br />
        <%= f.text_field :bio %>
      </div>

有什么想法吗? 谢谢Ps。 用于在部署之前正常工作

编辑

我试图迁移但是我收到了这个错误

Couldn't create database for {"adapter"=>"sqlite3", "pool"=>5, "timeout"=>5000, "database"=>"db/test.sqlite3"}
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

I just deployed my app to Heroku and I'm facing this problem. In the sign up page:

<div class="field">
    <%= f.label :bio %><br />
    <%= f.text_field :bio %>
  </div>

and in the logs

ActionView::Template::Error (undefined method `bio' for #<User:0x007f5e772493c0>):
<div class="field">
        <%= f.label :bio %><br />
        <%= f.text_field :bio %>
      </div>

Any thoughts on this? Thanks Ps. used to work fine before deployment

EDIT

I tried to migrate but I got this error

Couldn't create database for {"adapter"=>"sqlite3", "pool"=>5, "timeout"=>5000, "database"=>"db/test.sqlite3"}
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

原文:https://stackoverflow.com/questions/39500282
更新时间:2023-09-25 19:09

最满意答案

@hun我从我身边尝试可能是对你有帮助的:

.small + .small {
        position: relative;
        margin-left:-198px;
        margin-top:111px
    }

@hun i Try from my side may be that's help you:

.small + .small {
        position: relative;
        margin-left:-198px;
        margin-top:111px
    }

相关问答

更多
  • 嗯,我想你可以在这里使用nth-child CSS选择器。 我假设您希望第四个
  • 占用三个普通
  • 元素的宽度(在现有CSS中定义),因此我们想要的宽度为:10.66666667%* 3 = 32%。 删除HTML中的额外2
  • 元素,并使用nth-child(4) ,如下所示: nav ul > li:nth-child(4){ width: 32%; } 现在,第四个
  • 元素的宽度是其他元素的三倍。 这是一个JSFiddle ,向您展示它实现了什么。 (我设置了一个临时背景颜色, ...
  • 你需要给第18行的div一个宽度。 看起来这个div的宽度不够大,所以当你重新调整它时,它不需要换行到下一行。 如果在重新调整“街道地址”文本框下降到下一行的页面后仔细查看,则该文本框的宽度大于第16行上div的宽度。由于包含选项的div是内联的 - 块,并且只有宽度与其内部元素的大小,并且这些元素的宽度小于“街道地址”文本框,它不会换行。 这是一个例子,我给了div一个宽度: http : //jsfiddle.net/Gnax5/
  • 你错过了; 在css中漂浮之后。 你需要关闭它。 演示 (与失踪人员合作; ) You are missing the ; after the float in the css. You need to close it. DEMO (Working with the missing ;)
  • 将first-of-type选择器更改为last-of-type ,将margin-left更改为margin-right 。 在这里检查更新的plunker: https://plnkr.co/edit/XZDYi37LWZGeU10HvWdC?p=preview li:not(:last-of-type) { margin-right: 40px; } Changed first-of-type selector to last-of-type and margin-left to margi ...
  • 您可以使用display: flex 。 更改您的display: table-cell to display: flex 。 然后改变text-align:center; 和vertical-align:middle; align-items: center; 并justify-content: center; 使其垂直和水平居中。 编辑:然后我还为图像添加了150px的最大宽度,以便在图像大于它时阻止它从容器中扩展出来。 向@Hkidd道具指出这种情况发生了。 .con { width: 300p ...
  • 将#bodyPart的height与min-height一起#bodyPart为auto #bodyPart { clear : both; width : 1100px; min-height : 500px; margin-top : 10px; margin-left : auto; margin-right : auto; border-style : solid; border-width : 0px 1px; border-color : white; height:auto; } 然后添加一 ...
  • 这是一个简单的修复。 http://jsfiddle.net/Gep2G/4/embedded/result/ img{width:100%; hieght:352px;} 只要您指定一个维度:浏览器将以正确的比例自动填充图像。 继续为每个媒体查询设置所需的高度。 此外,你的CSS中有一些错误。 例如,id应仅应用于单个元素。 使用多个元素的类(如包装元素)。 Its a simple fix. http://jsfiddle.net/Gep2G/4/embedded/result/ img{widt ...
  • 小提琴的例子 首先你为菜单div设置position: absolute ,然后将top设置为50%,将transform选项设置为-50%。 资料来源: https : //css-tricks.com/centering-css-complete-guide/ 希望这可以帮助 Fiddle example First you set position: absolute for the menu div, then set top to 50% and the transform option to - ...
  • @hun我从我身边尝试可能是对你有帮助的: .small + .small { position: relative; margin-left:-198px; margin-top:111px } @hun i Try from my side may be that's help you: .small + .small { position: relative; margin-left:-198px; ...
  • 你是在追求这种外观吗? http://desandro.com/resources/jquery-masonry/ 如果是这样,不,没有简单的方法来处理纯CSS。 你也需要一些JS。 Are you after this type of look? http://desandro.com/resources/jquery-masonry/ If so, no, there is no easy way to handle that with pure CSS. You need a bit of JS as ...
  • 相关文章

    更多
  • 研磨设计模式之工厂方法模式(Factory Method)-模式讲解1
  • 研磨设计模式之工厂方法模式(Factory Method)-模式讲解2
  • 研磨设计模式之工厂方法模式(Factory Method)-场景问题
  • 研磨设计模式之工厂方法模式(Factory Method)-模式讲解3
  • 研磨设计模式之工厂方法模式(Factory Method)-解决方案
  • Securing Solr on Tomcat access using a user account
  • USER AND SCHEMA
  • user and schema(转)
  • Solr4.7---Field、CopyField、DynamicField
  • 微信公众平台消息接口开发 微信浏览器HTTP_USER_AGENT判断
  • 最新问答

    更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。