最后几张早鸟票了
我们公司 支持下
工作 7 8 个月,才 5k 的路过
试了楼上的几个方法,页面还是要用 js 控制
def index
if params[:state] == "[\"shipped\", \"apply_refunded\"]"
params[:state] = ['shipped', 'apply_refunded']
end
@apply_refunds = current_merchant_info.refund_apply_records
.find_customer(params[:customer])
.find_uuid(params[:uuid])
.find_order_state(params[:state])
.find_start_time(params[:start_time])
.find_stop_time(params[:stop_time])
.order(created_at: "DESC")
.page(params[:page]).per(20)
end
我在 controller 里加了这个处理,数据能筛选了,但页面 select 不能选中“未退款”这个 option 了
应该是 grouped_options_for_select 吧,但不是这个意思。我想点击“未退款”,显示出 ['shipped', 'apply_refunded'] 这两个状态的数据
那该咋解决。。
可以了 谢谢
5.0.0.1 版本的
不知道咋实现。。。
哦,那这种应该怎么显示提示
我搞错啦,这个新的 log 输出在 logstasher.log 里的吧
我这个是在 development.rb 上改的
Started GET "/addresses" for 127.0.0.1 at 2017-03-10 14:15:43 +0800
Processing by AddressesController#index as HTML
Rendering addresses/index.html.erb within layouts/application
^[[1m^[[36mAddress Load (0.2ms)^[[0m ^[[1m^[[34mSELECT `addresses`.* FROM `addresses`^[[0m
Rendered addresses/_table.html.erb (1.6ms)
^[[1m^[[36mPicture Load (0.2ms)^[[0m ^[[1m^[[34mSELECT `pictures`.* FROM `pictures` ORDER BY `pictures`.`id` DESC LIMIT 8 OFFSET 0^[[0m
Rendered collection of pictures/_picture.html.erb [8 times] (2.1ms)
^[[1m^[[35m (0.3ms)^[[0m ^[[1m^[[34mSELECT COUNT(*) FROM `pictures`^[[0m
^[[1m^[[36mAddress Load (0.2ms)^[[0m ^[[1m^[[34mSELECT `addresses`.* FROM `addresses` ORDER BY `addresses`.`id` DESC LIMIT 1^[[0m
Rendered addresses/index.html.erb within layouts/application (10.6ms)
Completed 200 OK in 61ms (Views: 58.7ms | ActiveRecord: 0.9ms)
Started GET "/" for 127.0.0.1 at 2017-03-10 16:12:27 +0800
^[[1m^[[36mActiveRecord::SchemaMigration Load (0.2ms)^[[0m ^[[1m^[[34mSELECT `schema_migrations`.* FROM `schema_migrations`^[[0m
Processing by AddressesController#index as HTML
Rendering addresses/index.html.erb within layouts/application
^[[1m^[[36mAddress Load (0.3ms)^[[0m ^[[1m^[[34mSELECT `addresses`.* FROM `addresses`^[[0m
Rendered addresses/_table.html.erb (8.2ms)
^[[1m^[[36mPicture Load (0.2ms)^[[0m ^[[1m^[[34mSELECT `pictures`.* FROM `pictures` ORDER BY `pictures`.`id` DESC LIMIT 8 OFFSET 0^[[0m
Rendered collection of pictures/_picture.html.erb [8 times] (1.8ms)
^[[1m^[[35m (0.2ms)^[[0m ^[[1m^[[34mSELECT COUNT(*) FROM `pictures`^[[0m
^[[1m^[[36mAddress Load (0.3ms)^[[0m ^[[1m^[[34mSELECT `addresses`.* FROM `addresses` ORDER BY `addresses`.`id` DESC LIMIT 1^[[0m
Rendered addresses/index.html.erb within layouts/application (41.0ms)
Completed 200 OK in 391ms (Views: 377.4ms | ActiveRecord: 2.2ms)
我刚试了这个 gem,但 log 还是和原来的一样啊
我加了那句了的
支持一下
@huacnlee 谢谢帮忙,但好像还是有点问题,我是希望能够在添加图片后还是保持一页 8 个,多出来的能直接搞到第二页去
@huacnlee 用 js 也不知道咋做啊
同样想在杭州找 ruby 工作,已经在宁波 ruby 开发半年了,年后准备去杭州找 ruby 了。不知道有没有公司收初级的!
在 boss 直聘发你们 hr 了 #10 楼 @ceasia_hrhz
#24 楼 @banana 才半个月就这么厉害了啊 #23 楼 @ForrestDouble 加油!
#5 楼 @ceasia_hrhz 你们还招初级萌新吗
#5 楼 @chenge 不好意思,第一次发,之前都在潜水。。
问题就是那些定义方法有什么书介绍吗?另外像 https://www.v2ex.com 怎么在一个页面,点击不同标签出来不同的内容,而且地址栏变成https://www.v2ex.com/?tab=tech