ruby on rails 支持html5吗,红宝石在铁路帮手html5(ruby on rails helpers html5)

红宝石在铁路帮手html5(ruby on rails helpers html5)

Position

我得到了那个错误,

语法错误,意外的keyword_do_block d =(f.text_field:position,do data-length:30); @ output_buf ^ / home / whitehat / Documents / Books / Web开发/ Ruby On Rails / Projects / free-lance / dressing-shop /app/views/products/new.html.erb:39:语法错误,意外tSYMBEG,期待keyword_do或'{'或'('ld:position,do data-length:30); @ output_buffer.safe_appen ^

Position

And I got that error,

syntax error, unexpected keyword_do_block d=( f.text_field :position, do data-length:30 );@output_buf ^ /home/whitehat/Documents/Books/Web development/Ruby On Rails/Projects/free-lance/dressing-shop/app/views/products/new.html.erb:39: syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' ld :position, do data-length:30 );@output_buffer.safe_appen ^

原文:https://stackoverflow.com/questions/46046740

更新时间:2019-07-09 06:29

最满意答案

将data-length更改为'data-length' :

Change data-length to 'data-length':

相关问答

将data-length更改为'data-length' :

Change data-length to 'data-length':

你有几个问题,其中大部分已经被下面的人回答了。 然而,一个尚未完全解决的答案是:是的,您可以使用脚本/控制台来查看路由到哪里。 只需输入app.[route_helper] ,它将以路径进行响应。 例如app.users_path将返回/users/ 因此,对于您的示例,请输入完整网址的app.entries_path或其控制台中相对路径的app.entries_path 。 You have several questions in there, most of which have alrea

...

创建一个新的助手: 选择帮助文件的名称,例如tags_helper.rb 在/ app / helpers目录中创建文件 根据文件名创建一个模块。 在这种情况下 module TagsHelper

end

将你的助手定义为方法 module TagsHelper

def hello_world(name)

"hello #{name}"

end

end

现在你可以在你的视图中使用hello_world帮助器方法。 To create a new helper: choose a

...

我想我的经验法则是使用帮手构建一个单一的“单位”的显示器 - 像包含一个链接的跨度 - 并使用部分来构建一个更复杂的显示单元,由多个单元组成“显示 - 像网格或菜单。 I guess my rule of thumb is to use a helper to build a single "unit" of display -- like a span containing a link -- and to use a partial to build a more complex unit o

...

您可以使用相同的标记,但是,您需要使用RoR的帮助程序来获取图像的URL - 您可以使用image_path :

data-pages-bg-image=""

data-bg-overlay="black"

data-overlay-opacity="0.5">

You can u

...

Play 2.0视图助手在包views.helper中定义。 目前, 列表中缺少HTML 5新类型。 但是自己扩展它应该很容易。 例如,请参阅@inputPassword源 。 Play 2.0 view helper are defined in package views.helper. HTML 5 new types are currently missing from the list. But it should be really easy to extend it yourself

...

您的服务器端解决方案与客户端解决方案无关。 如果明天的浏览器支持一种名为Ray的新输入类型,那么Ruby是否支持它并不重要。 您的表单将作为HTTP POST发送数据,Ruby和任何其他体面的服务器端应用程序都可以处理。 Your server-side solution has nothing to do with your client-side solution. If tomorrow browsers support a new input type called Ray, then i

...

这是我建议的重写代码: class Micropost

def formatted_json_data

{

content: simple_format(h(self.content)),

created_at: time_ago_in_words(self.created_at),

id: self.id,

image: self.image,

link: self.link,

...

我不认为在AngularJS中使用帮助器是个好主意。 assets/*的模板不能共享applicationHelper范围,因此无法执行此操作。 如果必须,请尝试在views/*使用erb,它应该可以工作。 I don't think it is a good idea to use a helper within AngularJS. The template in assets/* can't share the applicationHelper scope, so it can't do

...

您可以尝试引入足够的各种Rails宝石来支持它(从ActionPack开始并继续使用ActiveSupport),但是您肯定需要引入相当多的东西 - 它最终需要使用locale初始化语言环境系统用于翻译的文件。 如果你不需要本地化,dvyjones的建议会更快。 You can try bringing in enough of the various Rails gems to support it (starting with ActionPack and continuing with Ac

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值