Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
柴凯龙
@ckl
Member
NO. 11053 / 2014-01-13

[email protected]
杭州师范大学
杭州
28 Topics / 55 Replies
0 Followers
0 Following
0 Favorites
学生新手!
GitHub Public Repos
  • wechat-app-mall 0

    微信小程序商城,微信小程序微店

  • wxParse 0

    wxParse-微信小程序富文本解析自定义组件,支持HTML及markdown解析

  • bootstrap-datetimepick... 0

    Both Date and Time picker widget based on twitter bootstrap (supports Bootstrap v2 and v3)

  • bootstrap-datetimepicker 0

    Date/time picker widget based on twitter bootstrap

  • ruby_play 0

    hava fun by ruby

  • china_city 0

    省市区街道四级联选择 Rails Engine Gem

  • iNotify 0

    :loudspeaker: JS achieve the browser title flashing , scrolling, voice prompts , browser notice.

  • mui 0

    最接近原生APP体验的高性能框架

  • aceDemo 0

  • community_health 0

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 在 Mac 系统命令行中 subl .无效 at April 12, 2014

    #3 楼 @ninehills 你说的是可以的,但是我重新打开终端,有无法打开了

  • 在 Mac 系统命令行中 subl .无效 at April 12, 2014

    #1 楼 @Juanito 我安装了 3 但是还是不行,

  • params [] 问题 at April 10, 2014

    #4 楼 @rociiu 谢谢

  • params [] 问题 at April 10, 2014

    #1 楼 @rociiu 谢谢,我想问一下,name=“010003” + “[]”可以这么写吗,因为后期我这个 name 都是动态的。

  • 项目里需要一个简单问卷管理子系统,请问一下有没有 gem 包 at April 08, 2014

    这个我还需要问一下我老师。

  • JS 中事件绑定问题 at April 07, 2014

    #7 楼 @jablie 谢谢!可以了!非常感谢

  • JS 中事件绑定问题 at April 06, 2014

    #4 楼 @xlaok 非常谢谢 4 楼的解答。我这边是这样的 和这个网站说的类型http://darkbaby123.iteye.com/blog/769603 controller:

    def update_item
        @user =User.find(params[:id])
        respond_to do |format|
          if  @user.update_attributes(user_params) 
            format.html { redirect_to 'edit' }
            format.js
          else
            format.html { render 'edit' }
            format.js
          end
        end
    end
        end
    

    views:我有一个 update_item.js.erb

    $("#category").html("<%= j render :partial => 'category_item', :collection=>User.get_category(@user) , :as => :category_item %>")
    

    user.js.coffee

    $(document).ready ->
      phy_exam_tpl_item_edit = (category_item_id,tpl_item_id) ->
          <<<这里是一系列的操作>>>>
      $(".tpl_item_edit_modal").click () ->
        category_item_id = $(this).attr("data-category-item-id")
        tpl_item_id = $(this).attr("data-phy-exam-tpl-item")
        phy_exam_tpl_item_edit category_item_id,tpl_item_id
    

    我 rander 的是一个表格内容:有编辑、删除操作。我通过以上方法实现局部刷新,但是编辑删除的事件绑定无效了。需要重新绑定相对应的点击事件响应。

    问题:我不知道怎么重新绑定,我试了几种都没成功。(重新绑定是写在 user.js.coffee 中还是 update_item.js.erb 中?)

  • JS 中事件绑定问题 at April 06, 2014

    #3 楼 @hz_qiuyuanxin 这是一个局部刷新的方法

  • JS 中事件绑定问题 at April 05, 2014

    #1 楼 @hz_qiuyuanxin 我分开写的,只是帖子里看成这样的,前三点我都完成了,问题是第 4 点还不知道!

  • 局部刷新问题 at April 04, 2014

    我知道了!

    $.ajax
          type: "Patch",
          url: update_url,
          dataType: "script",
          data: $("#edit_tpl_item_modal").serialize()
          complete: ->
            location.reload()
        event.preventDefault();
    
  • 局部刷新问题 at April 04, 2014

    #3 楼 @saiga 谢谢!但是我现在碰到一个问题:

    $("#tpl_item_edit_modal_confirm").click (event) ->
        #edit_tpl_item_modal.submit()
        $.ajax
          type: "Patch",
          url: update_url,
          dataType: "script",
          data: {"_method":"update_item"},
          complete: ->
            location.reload()
        event.preventDefault();
    

    我这个表单数据需要用 json 的方式写到 date 吗?怎么写?那在 controller 中怎么获取这个 json 数据呢?

  • 局部刷新问题 at April 03, 2014

    #1 楼 @badboy 我把我的问题说明白了,请问你的意思?

  • scope 中 joins 的多表查询 at March 27, 2014
    self.joins(:phy_exam_tpl_item).where("health_phy_exam_record_items.phy_exam_record_id = ?",phy_exam_record_id).merge(Health::PhyExamTplItem.group_category(category_id))
      }
    

    知道错误了!把&改成 merge 就可以了

  • 怎么写一个动态的 id 或者 class 控制器名 at March 26, 2014

    #1 楼 @cassiuschen 谢谢!可以了 id 我写对的!

  • 怎么写一个动态的 id 或者 class 控制器名 at March 26, 2014

    #1 楼 @cassiuschen 谢谢你!那个 id 那边怎么写呢?

  • 如何调用 belongs_to 的 model 方法???急谢谢 at March 25, 2014

    @miclle 谢谢了 我找到了!

  • 如何调用 belongs_to 的 model 方法???急谢谢 at March 25, 2014

    @miclle 不好意思 方法举例错误!方法改为 bar

  • params.require () 问题 at March 19, 2014

    <%= form_tag(save_items_health_phy_exam_tpls_path,method:'post') do %> 这是表单, def new_options @phy_exam_tpl = Health::PhyExamTpl.find(params[:id]) end

    def save_items @phy_exam_tpl_item = Health::PhyExamTplItem.new(phy_exam_tpl_id: params[:id], category_item_id: params[:category_item_id]) if @phy_exam_tpl_item.save @phy_exam_stand_result = Health::PhyExamStandResult.new(health_phy_exam_stand_result_params) @phy_exam_stand_result.phy_exam_tpl_item_id = @phy_exam_tpl_item.id if @phy_exam_stand_result.save flash[:success]=t("flash.phy_items_add_success") else flash[:danger] = t("flash.phy_items_add_failure") end else flash[:danger] = t("flash.phy_items_add_failure") end end

    def health_phy_exam_stand_result_params permited=params.require(:health_phy_exam_stand_result).permit(:name,:definition_type,:unit, :device,:result_type,:normal_max,:normal_min,:result_text,:description) end

    但是错误信息提示没有找到 health_phy_exam_stand_result 谢谢大神

  • 在 rails 中使用 Bootstrap 风格的 Confirm Box at January 13, 2014

    我写在后缀为 js 文件里,连接:<%=link_to "删除",users_path, rel: "nofollow",:data => { confirm: "Are you sure you want to raise taxes on the poor?",method: "delete",remote: "true"}%>怎么没有起作用啊

  • 在 rails 中使用 Bootstrap 风格的 Confirm Box at January 13, 2014

    请问一下,着两块内容是写在后缀是 js 的文件吗?还是后缀为 js.erb 还是后缀为 js.coffee。

  • Prev
  • 1
  • 2
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English