红宝石在铁路帮手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
...