#165 楼 @yedingding 100 max connections, 200,000 message 就需要 19 USD / month,贵贵的感觉。
<%= form_tag url_for(controller: 'topics', action: 'rate', id: topic.id), :remote => true, :class => "rating_form", method: "post" do %>
<input id="_assets_action_rate_controller_topics_id_28_ratings" class="rating_input" value=<%= "#{topic.rating}" %> max="5" min="0" name="ratings" size="1" step="1" type="text" style="display:none" />
<!--%= f.text_field :ratings, :size => 1, :min => 0, :max => 5, :step => 1 %-->
<div class="rateit" data-rateit-backingfld="#_assets_action_rate_controller_topics_id_28_ratings" data-rateit-resetable="true" data-rateit-ispreset="true">
</div>
<%= topic.rate_count %> Votes
<% end %>
然后使用:
$("form.rating_form input.rating-input").change () ->
$(this).parent().submit()
仍然无法绑定。
贴一段能正常上传的:
Processing by AccountController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user"=>{"name"=>"hujoy", "avatar"=>#<ActionDispatch::Http::UploadedFile:0x0000000884a1e0 @original_filename="Revolutionary.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"user[avatar]\"; filename=\"Revolutionary.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/tmp/RackMultipart20120403-1681-aw1qkz>>, "email"=>"[email protected]", "location"=>"", "github"=>"", "website"=>"", "tagline"=>"", "bio"=>""}, "commit"=>"更新资料"}
主要可以看这一段:
Processing by TopicsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "topic"=>{"node_id"=>"7", "title"=>"显式显示type是否会成功。", "cover"=>#<ActionDispatch::Http::UploadedFile:0x000000083ec530 @original_filename="facebook.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"topic[cover]\"; filename=\"facebook.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/tmp/RackMultipart20120522-2435-qsoh6v>>, "cover_cache"=>"", "body"=>"```\r\n <%= image_tag(@user.avatar_url) if @user.avatar? %>\r\n <%= f.file_field :avatar %>\r\n <%= f.hidden_field :avatar_cache %>\r\n```"}, "commit"=>"保存"}
Started GET "/topics/new" for 127.0.0.1 at 2012-05-22 21:01:14 +0800
Processing by TopicsController#new as HTML
[36mMONGODB[0m (0ms) hujoy_db_development_apr5['[34musers[0m'].[33mfind[0m({:_id=>14}).limit(-1).sort([[:_id, :asc]])
[35mMONGODB[0m (0ms) hujoy_db_development_apr5['[34m$cmd[0m'].[33mfind[0m({"count"=>"notifications", "query"=>{"user_id"=>14, :read=>false}, "fields"=>nil}).limit(-1)
Rendered topics/_base.html.erb (1.9ms)
Rendered shared/_error_messages.html.erb (0.0ms)
[36mMONGODB[0m (1ms) hujoy_db_development_apr5['[34msections[0m'].[33mfind[0m({}).sort([[:sort, :asc]])
[35mMONGODB[0m (1ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({"section_id"=>1}).sort([[:sort, :asc]])
[36mMONGODB[0m (0ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({"section_id"=>2}).sort([[:sort, :asc]])
[35mMONGODB[0m (0ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({"section_id"=>3}).sort([[:sort, :asc]])
[36mMONGODB[0m (1ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({"section_id"=>4}).sort([[:sort, :asc]])
[35mMONGODB[0m (1ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({"section_id"=>5}).sort([[:sort, :asc]])
[36mMONGODB[0m (1ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({"section_id"=>6}).sort([[:sort, :asc]])
[35mMONGODB[0m (1ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({"section_id"=>7}).sort([[:sort, :asc]])
[36mMONGODB[0m (1ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({"section_id"=>8}).sort([[:sort, :asc]])
[35mMONGODB[0m (1ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({"section_id"=>9}).sort([[:sort, :asc]])
Rendered topics/_editor_toolbar.html.erb (1.0ms)
Rendered topics/_form.html.erb (61.1ms)
Rendered app/cells/topics/sidebar_for_new_topic_node.html.erb (0.0ms)
Rendered app/cells/topics/reply_help_block.zh-CN.html.erb (0.0ms)
Rendered topics/_sidebar_for_new_topic.html.erb (5.1ms)
Rendered topics/new.html.erb within layouts/application (69.5ms)
Rendered common/_search_form.html.erb (0.2ms)
Rendered common/_user_nav.html.erb (1.8ms)
Rendered common/_google_analytics.html.erb (0.1ms)
Completed 200 OK in 139ms (Views: 118.3ms | Mongo: 11.7ms | Solr: 0.0ms)
Started POST "/topics" for 127.0.0.1 at 2012-05-22 21:01:37 +0800
Processing by TopicsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "topic"=>{"node_id"=>"7", "title"=>"显式显示type是否会成功。", "cover"=>#<ActionDispatch::Http::UploadedFile:0x000000083ec530 @original_filename="facebook.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"topic[cover]\"; filename=\"facebook.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/tmp/RackMultipart20120522-2435-qsoh6v>>, "cover_cache"=>"", "body"=>"```\r\n <%= image_tag(@user.avatar_url) if @user.avatar? %>\r\n <%= f.file_field :avatar %>\r\n <%= f.hidden_field :avatar_cache %>\r\n```"}, "commit"=>"保存"}
[36mMONGODB[0m (0ms) hujoy_db_development_apr5['[34musers[0m'].[33mfind[0m({:_id=>14}).limit(-1).sort([[:_id, :asc]])
[35mMONGODB[0m (0ms) hujoy_db_development_apr5['[34m$cmd[0m'].[33mfind[0m({"count"=>"notifications", "query"=>{"user_id"=>14, :read=>false}, "fields"=>nil}).limit(-1)
WARNING: Can't mass-assign protected attributes: node_id, cover, cover_cache
WARNING: Can't mass-assign protected attributes: node_id, cover, cover_cache
[36mMONGODB[0m (0ms) hujoy_db_development_apr5['[34musers[0m'].[33mfind[0m({:login=>/^(user|user)$/i, :_id=>{"$ne"=>14}}, {:_type=>1, :_id=>1}).limit(5)
[35mMONGODB[0m (0ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mfind[0m({:_id=>7}).limit(-1).sort([[:_id, :asc]])
[36mMONGODB[0m (0ms) hujoy_db_development_apr5['[34m$cmd[0m'].[33mfind[0m({:findandmodify=>"mongoid.auto_increment_ids", :query=>{:_id=>"topics"}, :update=>{:$inc=>{:c=>1}}, :new=>true, :upsert=>true}).limit(-1)
[35mMONGODB[0m (0ms) hujoy_db_development_apr5['[34mtopics[0m'].[33minsert[0m([{"mentioned_user_ids"=>[], "replies_count"=>0, "follower_ids"=>[], "likes_count"=>0, "tags"=>[], "title"=>"显式显示type是否会成功。234", "body"=>"```\r\n <%= image_tag(@user.avatar_url) if @user.avatar? %>\r\n <%= f.file_field :avatar %>\r\n <%= f.hidden_field :avatar_cache %>\r\n\n```", "_type"=>"Topic", "user_id"=>14, "node_id"=>7, "updated_at"=>2012-05-22 13:01:37 UTC, "body_html"=>"<div class=\"highlight\"><pre> <%= image_tag(<a href=\"/users/user\" class=\"at_user\" title=\"@user\"><i>@</i>user</a>.avatar_url) if <a href=\"/users/user\" class=\"at_user\" title=\"@user\"><i>@</i>user</a>.avatar? %>\n <%= f.file_field :avatar %>\n <%= f.hidden_field :avatar_cache %>\n</pre>\n</div>", "node_name"=>"杂志", "node_slug"=>"journals", "created_at"=>2012-05-22 13:01:37 UTC, "replied_at"=>2012-05-22 13:01:37 UTC, "_id"=>28}])
[36mMONGODB[0m (0ms) hujoy_db_development_apr5['[34mnodes[0m'].[33mupdate[0m({"_id"=>7}, {"$inc"=>{"topics_count"=>1}})
[35mMONGODB[0m (0ms) hujoy_db_development_apr5['[34musers[0m'].[33mupdate[0m({"_id"=>14}, {"$inc"=>{"topics_count"=>1}})
[36mMONGODB[0m (0ms) hujoy_db_development_apr5['[34musers[0m'].[33mfind[0m({:_id=>{"$in"=>[]}})
[1m[32mSOLR Request (10.0ms)[0m [ path=#<RSolr::Client:0x00000008c3a9a8> parameters={data: [1m[1m<?xml version="1.0" encoding="UTF-8"?><add><doc><field name="id">Topic 28</field><field name="type">Topic</field><field name="class_name">Topic</field><field name="node_id_i">7</field><field name="replied_at_d">2012-05-22T13:01:37Z</field><field name="title_textsv">显式显示type是否会成功。234</field><field name="body_textsv">```
<%= image_tag(@user.avatar_url) if @user.avatar? %>
<%= f.file_field :avatar %>
<%= f.hidden_field :avatar_cache %>
```</field></doc></add>[0m, headers: [1m[1m{"Content-Type"=>"text/xml"}[0m, method: [1m[1mpost[0m, params: [1m[1m{:wt=>:ruby}[0m, query: [1m[1mwt=ruby[0m, path: [1m[1mupdate[0m, uri: [1m[1mhttp://localhost:8983/solr/update?wt=ruby[0m, open_timeout: [1m[1m[0m, read_timeout: [1m[1m[0m} ]
Redirected to http://hujoy.com:3000/topics/28
[1m[32mSOLR Request (533.6ms)[0m [ path=#<RSolr::Client:0x00000008c3a9a8> parameters={data: [1m[1m<?xml version="1.0" encoding="UTF-8"?><commit/>[0m, headers: [1m[1m{"Content-Type"=>"text/xml"}[0m, method: [1m[1mpost[0m, params: [1m[1m{:wt=>:ruby}[0m, query: [1m[1mwt=ruby[0m, path: [1m[1mupdate[0m, uri: [1m[1mhttp://localhost:8983/solr/update?wt=ruby[0m, open_timeout: [1m[1m[0m, read_timeout: [1m[1m[0m} ]
Completed 302 Found in 1345ms
Started GET "/topics/28" for 127.0.0.1 at 2012-05-22 21:01:38 +0800
以下是显示新创建的topic
error_messages 无任何错误提示,development.log 也已经查过,没有错误提示。整个过程无任何错误提示,只是文件不会上传,然后:cover 为 nil
澳州不行,在天朝,各方面的人才需求都多一些。
UP!
https://github.com/proton/mongoid_rateable 不知道怎样?试着用用看。
put.im 的用户报道,可惜没有把 put.im 数据移过来,否则应该能进前 10 吧。
订单 4076548961 已提交。预计 2 月 15 日送达。 迅速入手,希望不要向上次买的某书一样,翻译一定要到位。
感兴趣的同学,我的邮箱:huaqingping@极麦尔道卡姆。
还是觉得卡片机不错,现在分辨率高。另外,摄影,首先要求技术,其次才是设备。我去年参加公司的活动,一个女孩用单反拍的几张照片,全都要不得,还不如手机拍的。