我已经做了一些搜索,并提出了很多混合结果,使用Dojo来切换显示vs隐藏的div.
dojo.style它看起来有些用途可能已被替换dojo.fxdijit但因此无法访问DOM节点.show()和hide()我似乎无法让他们中的任何一个工作.
有人可以指点我这是一个最新的walkthru.
解决了
使用以下组合......
dojo.addOnLoad(function() {
dojo.style(dojo.byId('myDiv'), "display", "none");
});
Run Code Online (Sandbox Code Playgroud)
并切换它
function toggleDivs(){
if( dojo.style(dojo.byId('myDiv'), "display") == "none"){
dojo.style(dojo.byId('myDiv'), "display", "block");
dojo.style(dojo.byId('myDiv2'), "display", "none");
} else {
dojo.style(dojo.byId('myDiv'), "display", "none");
dojo.style(dojo.byId('myDiv2'), "display", "block");
}
}
Run Code Online (Sandbox Code Playgroud) has_attached_file :image, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", :path => "/:style/:filename"
我不确定是什么 :path => "/:style/:filename".
我还想为这个附加图像添加样式,那是什么:路径是什么?我想要的风格是这样的::styles => { :medium => "275x275>", :thumb => "175x155>" }
基本上这里发生的是我正在安装heroku并且我必须使用S3,这似乎很简单,只是不习惯这种附件约定的东西.
此外,我刚刚注册了一个S3帐户......但是它heroku正在宣传它的免费或其他东西.这有什么用?
尝试了一切,似乎找不到问题.
错误 localhost:3000
No route matches {:action=>"new", :controller=>"comments"}
Run Code Online (Sandbox Code Playgroud)
服务器出错
Rendered tasks/show.html.erb within layouts/application (134.7ms)
Completed 500 Internal Server Error in 187ms
ActionView::Template::Error (No route matches {:action=>"new", :controller=>"comments"}):
66:
67: <br />
68:
69: <%= link_to 'New Comment', new_task_comment_path %>
70:
71:
72:
app/views/tasks/show.html.erb:69:in `_app_views_tasks_show_html_erb___1205853643464254853_2489437560'
app/controllers/tasks_controller.rb:18:in `show'
Run Code Online (Sandbox Code Playgroud)
Routes.rb 有我的资源嵌套
resources :tasks do
resources :comments
end
Run Code Online (Sandbox Code Playgroud)
和我的相关部分 $rake routes
$ rake routes
task_comments GET /tasks/:task_id/comments(.:format) {:action=>"index", :controller=>"comments"}
POST /tasks/:task_id/comments(.:format) {:action=>"create", :controller=>"comments"}
new_task_comment GET /tasks/:task_id/comments/new(.:format) {:action=>"new", :controller=>"comments"}
edit_task_comment GET /tasks/:task_id/comments/:id/edit(.:format) {:action=>"edit", :controller=>"comments"}
task_comment …Run Code Online (Sandbox Code Playgroud) amazon-s3 ×1
dojo ×1
heroku ×1
new-operator ×1
paperclip ×1
routes ×1
ruby ×1
toggle ×1
visibility ×1