krmela

Activity Graph

Page 1 of 1

2017-08-04

[12:32:36] krmela: has joined #RubyOnRails
[12:33:44] krmela: good friday evening exist something with oppositive function Offer.find_by day: day).any?
[12:34:31] krmela: i thinked it is none? but that returns me in rails 5.1.3 undefined function
[12:45:40] krmela: Remote host closed the connection

2017-08-03

[04:59:08] krmela: has joined #RubyOnRails
[05:02:49] krmela: good early morning i have question about ransack gem situation i have model Order which has generated controller and have own line resources: in routes so when i am use order.ransack(params[:q]) generated search form has url to resource index controller any idea why that happends
[05:04:07] krmela: or how pass search_form_for another url
[05:28:52] krmela: emers2n: well i find my answer url:reports_index_path
[09:18:49] krmela: **interruption from silence on this chanell** hello there i have like say more theory question i have model food which has many orders i dont know how to make form and model where i am enter date and check choices for day like every food as checkbox so they can every day order just limited set of foods (yeah i am back from vacation )
[09:23:12] krmela: it is restrictive day choices for admins and in publick part i let choose only from saved set
[09:25:53] krmela: https://gist.github.com/netmoleCBA/d158f68f46f27da96aeb64b8b342beb9
[09:30:18] krmela: food model is all posible foods
[09:31:13] krmela: i need save like only few choosen foods in another relation so in order form i am draw only food which are in saved set
[09:33:35] krmela: dionysus69: let me remark for example now we have in foods 10 records but i wish some days show in order form only 2 choosen foods and not let clients order from all
[09:35:08] krmela: only one order from user per day
[09:38:48] krmela: for me is more important one thing how to save dave offer for example today is orderable 5 food tomorrow 10 and other days just 3 i dont know how to make relation where i can store these day offers as currently it shows on order form food.all which is wrong
[09:39:45] krmela: it is relation each one day can have many offers but i dont know which relation fits best
[09:41:14] krmela: yes i want every day they choose from calendar another set of foods
[09:41:51] krmela: but key is i dont know how to make relation how to store it
[09:45:55] krmela: ok let me say it another way now i have in foods id 1-10 tomorrow is 4t and you can order only id 1 2 3 next monday you can order from id 6 7 8 9
[09:46:41] krmela: i am looking how to make new functionality which per day stores offers per day
[09:47:23] krmela: and then i am in order form i render only allowed ids from food
[12:13:21] krmela: Quit: Leaving

2017-08-02

[09:13:16] krmela: has joined #RubyOnRails
[09:23:39] krmela: hello there i have question about ransack i have report controller where i am search for model Order which is in resources: in routes and but form submit send me to /orders source https://gist.github.com/netmoleCBA/2e0769a337f2f112a43d579482e2402e
[12:10:31] krmela: Remote host closed the connection

2017-08-01

[05:40:36] krmela: has joined #RubyOnRails
[06:06:53] krmela: good day there i have question how is possible to do something like this @order =Order.where(:datum => params[:datum] ).where(:user_id => current_user.id).first_or_create and on submit action just save it
[06:08:45] krmela: cam27: i am pretty old for school but not old to get learn new tricks
[06:11:08] krmela: cjohnson: i am have call model.first_or_create with some where
[06:11:30] krmela: i dont know how to be able pass model as well url where to send result
[06:12:12] krmela: cjohnson: i just want on submit save it but order is on submit action nill
[06:13:18] krmela: let me make gist with sources
[06:17:49] krmela: https://gist.github.com/netmoleCBA/d0822b40c1f876883c0c17d5fad0aca7
[06:19:12] krmela: i am welcome any idea why is bad in code
[06:30:06] krmela: cjohnson: any idea ?
[09:35:58] krmela: hello folks i have question let say i have records like user_id and choice and i wish each choice count of their occurency
[09:58:24] krmela: tbuehlmann_: i am find way for grouping and counting order.group(:food).count
[10:22:22] krmela: tbuehlmann_: my previous question was : Good Day there, i have question i cant figure out why my controller errors with ActionController::ParameterMissing - param is missing or the value is empty: order: source is on https://gist.github.com/netmoleCBA/42f4c9bf6c43e186bfdc76af5c738b9d
[10:29:44] krmela: tbuehlmann_: well i am asked earlier but nobody knows i am use in that source find_or_create and i dont know where is mistake
[10:37:25] krmela: tbuehlmann_: let me rephase it it i am looking how to write code which let me this code work @order=Order.where(:datum => params[:datum] ).where(:user_id => current_user.id).first_or_create order belongs to food but it always ends on cant find food id
[10:38:49] krmela: i am looking for working example of this first_or_create as mine source dont works
[10:43:28] krmela: cabotto: yes it fails as it unable find id
[10:44:37] krmela: excuse me i check source brb
[10:55:59] krmela: well i am updated https://gist.github.com/netmoleCBA/42f4c9bf6c43e186bfdc76af5c738b9d actually it errors undefined method `food_id' for nil:NilClass looklike order class not pass to form
[10:57:03] krmela: on edit where i have @order.food_id
[10:58:33] krmela: yes i have better errors second strange is not there
[11:05:56] krmela: xhoy well i am looked for way to use .first_or_create
[11:06:20] krmela: anyway ty for help
[11:41:58] krmela: Remote host closed the connection

2017-07-28

[06:59:52] krmela: has joined #RubyOnRails
[07:02:07] krmela: good day there i have question i have have many food has many orders , how to make virtual atribute on orders table foodx where x is choosed food in order table
[10:35:43] krmela: hello there i have question if anybody knows how to whitelist params and where ti shalll be
[11:23:11] krmela: hello there i have question can anybody look on this https://stackoverflow.com/questions/45371845/rails-5-update-or-create-form i dont know where is mistake
[11:28:28] krmela: i dont as i am look for combination day and user and if i am found it i wanted update it and if now i wanted create new
[11:29:24] krmela: as user and date is unique one order per day per user
[11:30:49] krmela: well in food_id is choosen id
[11:51:10] krmela: defsdoor: still same error i am tryed this
[12:20:51] krmela: Quit: Leaving

2017-07-27

[06:05:41] krmela: has joined #RubyOnRails
[06:06:59] krmela: Good Morning there
[07:03:21] krmela: Good day there does anybody knows which is proper syntax for redirect_to :back in rails 5 https://gist.github.com/netmoleCBA/dc1dbab1e86d4e0d4ed28e651e3f174f
[08:14:18] krmela: good day there i have question i have simple controller with index edit and update action in edit i am asign object and i wish in update save it sources is in https://gist.github.com/netmoleCBA/dc1dbab1e86d4e0d4ed28e651e3f174f can anybody tell me what is wrong
[09:50:07] krmela: Good Day there, i have question i cant figure out why my controller errors with ActionController::ParameterMissing - param is missing or the value is empty: order: source is on https://gist.github.com/netmoleCBA/42f4c9bf6c43e186bfdc76af5c738b9d
[11:10:50] krmela: Ping timeout: 240 seconds

2017-07-26

[04:52:47] krmela: has joined #RubyOnRails
[04:54:44] krmela: hello there good morning i have question what means error dynamic constant assignment sources is on https://gist.github.com/anonymous/69d192e712a74a8f5740d68b8cc0bf6a
[05:00:23] krmela: START_DAY = :monday
[05:00:23] krmela: CZHEADER = %w[Pondělí Úterý Středa Čtvrtek Pátek Sobota Neděle]
[05:00:23] krmela: it is all three constant HEADER = %w[Monday Tuesday Wednesday Thursday Friday Saturday Sunday]
[05:04:14] krmela: Abhijit: well how other way to redeclare it i think i have it declared ontime on class creation as i dont see any mistake
[07:18:13] krmela: Remote host closed the connection

2017-07-25

[09:15:37] krmela: has joined #RubyOnRails
[09:20:31] krmela: good day there
[09:24:58] krmela: i have question i have @orders = Order.where(:datum => @date.beginning_of_week..@date.end_of_week)each day can have just one order or none how to get to order for some day
[12:46:37] krmela: Remote host closed the connection

2017-07-24

[09:06:44] krmela: has joined #RubyOnRails
[09:09:49] krmela: hello there , i have question exist way which make some fields protected from edit so i am set them in on creation and then i never able to edit them
[09:24:18] krmela: Remote host closed the connection

2017-07-19

[09:22:21] krmela: has joined #RubyOnRails
[09:26:33] krmela: Good Day there
[09:30:10] krmela: i have question i have in form array of checkboxes week_day[food_ids][] and i dont know how to save it to weekday.food_ids= (source https://gist.github.com/netmoleCBA/59019465cc9b53cc3d956bccba60b376)
[09:38:32] krmela: tbuehlmann_: hello there can you check this https://gist.github.com/netmoleCBA/59019465cc9b53cc3d956bccba60b376#file-_form-L20 it is it is bad or not food is typically food.all
[09:41:49] krmela: tbuehlmann_: well but if i am use dayoffers how to generate it if you can poke me a little more
[09:43:28] krmela: tbuehlmann_: do you mean use nested atributes i am still new in rails ty for any advices
[09:51:03] krmela: tbuehlmann_: my first idea was week_day[food_ids][] where checked boxes sends back array of food id and i am somehow send it to weekday.food_ids=
[09:52:11] krmela: tbuehlmann_: well i am looking for working solution at firts as easier as possible
[09:52:58] krmela: tbuehlmann_: as i am in this part pretty unexperienced i am never programmed in rails N-N relations as now is first
[09:54:28] krmela: tbuehlmann_: well acutally with my code i dont know how to save it and second i dont know how it works with validation (every weekday must have choosed at least one food ))
[09:58:13] krmela: tbuehlmann_: actually validation failed that week day must exist but strange i am on existing record
[10:04:54] krmela: tbuehlmann_: error added to https://gist.github.com/netmoleCBA/59019465cc9b53cc3d956bccba60b376
[12:46:55] krmela: Quit: Leaving

2017-07-18

[06:11:28] krmela: has joined #RubyOnRails
[06:15:49] krmela: Ping timeout: 246 seconds
[10:13:21] krmela: has joined #RubyOnRails
[10:16:28] krmela: hello there i have model WeekDay which has many dayoffer and Food which has many day offer i dont know how to make for given WeekDay in one array put related foods and in second array unrelated foods
[10:30:12] krmela: tbuehlmann_: i need associated and unassociated foods
[10:30:50] krmela: tbuehlmann_: dayoffer is limited set of food for given work day
[10:33:28] krmela: tbuehlmann_: https://gist.github.com/netmoleCBA/59019465cc9b53cc3d956bccba60b376
[10:34:59] krmela: dminuoso: i thinked it WeekDay.dayoffer.food but console it wont accept
[10:37:27] krmela: tbuehlmann_: well it is web for big canteen so we have various foods choices stored in foods
[10:37:59] krmela: tbuehlmann_: days are stored in weekday and day offer is restricted set of choices for given day
[10:38:28] krmela: tbuehlmann_: so i need get for given weekday associated and unassociated foods
[10:40:02] krmela: dminuoso: i am sorry that i am made you hungry
[10:42:31] krmela: tbuehlmann_: and second part of question is how to get for give workday unassociated foods i am plan to display two groups of check boxes and and on save process two arrays
[10:47:24] krmela: well guys dminuoso and tbuehlmann thanks for help btw if you coming nearby Olomouc in Czech Republic poke me i am glad invite you for some beer
[10:52:18] krmela: dminuoso: you helped me a lot other days
[12:50:09] krmela: Read error: Connection reset by peer

2017-07-17

[05:51:10] krmela: has joined #RubyOnRails
[05:52:31] krmela: Good day there , i have question exist any tutorial for rails 5.1 showing how to use form remote: true ?
[09:34:28] krmela: Hey there, i have question i am use ransack to create search based on date range i have two fields datum_gteq and datum_lteq but it always find total_records 0
[10:39:29] krmela: hello there i have question about ransack is here anybody experienced i am work with date range in console something like this works but in page not w=WeekDay.ransack(datum_lteq: '2017-07-01',datum_gteq: '2017-04-04').result
[10:39:59] krmela: i have two date fields on form and it wont find any records but in console it doeas
[12:46:19] krmela: dminuoso: thanks for reply it was mistake already corrected
[12:46:23] krmela: Quit: Leaving

2017-07-14

[05:44:53] krmela: has joined #RubyOnRails
[05:54:25] krmela: Good morning there is there any expert on ransack search form ?
[06:16:13] krmela: hello there i have simple ransack date range all works now i am trying to enable remote true and edit code to make it works but i am failed any ideas ? source is on https://gist.github.com/netmoleCBA/b4e6eb71425b39877cf39ce51a18dea5
[07:44:45] krmela: hello there i have ransack form with date range search criteria all worked now i am like to enable on it remote true can anyone give me suggestion which ways is best to do
[08:31:23] krmela: hello there
[08:36:18] krmela: i have question can anyone suggest me good example for ransack with remote true as i am digging and my code not find nothing if form is used
[09:31:59] krmela: good evening there , i have question i have ransack form with remote but ajax returns just same page and not ransacker record any idea ?
[12:45:00] krmela: Quit: Leaving

2017-07-13

[06:11:28] krmela: has joined #ruby
[06:14:20] krmela: has joined #RubyOnRails
[06:29:14] krmela: Remote host closed the connection
[06:31:51] krmela: has joined #RubyOnRails
[06:39:36] krmela: good day there i have question i am edit some day offers for food for canteen and i dont know which is best way to save array of choices in rails can anybody see on attached gist https://gist.github.com/netmoleCBA/089950c54a4b8e066da8afc54fa5a62e ty
[10:07:39] krmela: Quit: Leaving
[11:57:19] krmela: has joined #RubyOnRails
[12:05:19] krmela: good day , i am tryed add to generated resource controller WeekDay ransack search form with kaminari with remote true and it stopped works and i am dont see any entered records just search form sources is on Gist https://gist.github.com/netmoleCBA/dead5201c2f2534a8483c78dd4fadaed can anybody correct me i am looking for two hours for any my mistake
[12:44:02] krmela: Remote host closed the connection

2017-06-29

[05:43:59] krmela: has joined #RubyOnRails
[05:50:34] krmela: good morning everybody i am working on simple week view with indication , i am pass to partial template two variable @week which is date range first five days of week and day which is actual week and i wish in partial template use another style for actual day can anybody look on attached gist and told me what is wrong ? https://gist.github.com/netmoleCBA/c9fd3029a997fb50798774ec7200d080
[05:59:57] krmela: dminuoso: output shall be simple list of li element where is by style highlighted active day
[06:03:15] krmela: dminuoso: ok let say today is Thursday so when is in partial rendred thursday i wish add that <li> class active
[06:03:41] krmela: dminuoso: just for another color rendering
[06:05:09] krmela: dminuoso: i am pass partial week range and actual day just dont know how to make condition in partial to make another style assigment in partial den
[06:10:11] krmela: dminuoso: i send to partial hash of 5 dates and one date and i dont know how to compare in partial if two dates are same to render that date differently sorry for broken english
[08:42:01] krmela: good day there , i am use lastest rails and web i see all used variables just dont know what happends on page are just two levels of partials any idea http://pasteall.org/pic/show.php?id=116806
[08:47:23] krmela: mikecmpbll: https://gist.github.com/netmoleCBA/57cafbd3c8273ee0f53904d221290eea i dont see that i have it anywhere
[08:50:47] krmela: mikecmpbll: do you give me hint how to do remake it ?
[08:53:28] krmela: Ty mates i was blind ty very much
[12:20:51] krmela: Quit: Leaving

2017-06-28

[11:52:45] krmela: has joined #RubyOnRails
[11:53:48] krmela: good day there
[11:58:28] krmela: i have question how to get fastly number of working day between two dates excluding dates in model LockedDay.date_locked my last try is on https://gist.github.com/netmoleCBA/682b7b31de2070484019d32a6320f4ed but i think there must be better way
[11:59:50] krmela: it is used for food orders in our canteen
[12:32:47] krmela: Quit: Leaving

2017-06-27

[04:54:52] krmela: has joined #RubyOnRails
[05:24:03] krmela: Radar: Sorry but pastie,org is now for me offline at least cloudfare reports that
[05:29:45] krmela: well here is gist https://gist.github.com/netmoleCBA/d4cfb56507cf2d8a9e25af709349bab9 very shortly class shall generate from given date workdays monday to friday just asking if this is effective way or another way is possible ?
[05:48:47] krmela: hello there i have question , exist some reccomended way how to get from date range of day monday-friday in same week as is give date i am optionally wish give it as object to partial my last try is on https://gist.github.com/netmoleCBA/d4cfb56507cf2d8a9e25af709349bab9
[05:56:00] krmela: Radar: i have like order food for canteen and i need render simple calendar monday to fryday as well detect if isi not holiday i have our holidays and lockeddays in Lockedday model
[05:57:46] krmela: @days_from_this_week = (day.at_beginning_of_week..day.at_end_of_week) i find some code just now thinking how to remove last two elements of range
[06:00:05] krmela: Radar: anyway ty for try
[06:13:24] krmela: bios: redirect_to signout_path and return
[06:13:58] krmela: bios: make sure u have this path declared
[06:14:09] krmela: get '/signout', to: 'devise/sessions#destroy', as: :signout
[06:14:09] krmela: bios:devise_scope :user do
[06:15:56] krmela: yes u can use that in controller
[06:19:39] krmela: bios> maybe another way is @user.update_attributes(current_sign_in_token: "")
[06:20:33] krmela: bios> as u erase token rails kick him automaticallz
[09:05:29] krmela: Remote host closed the connection
[12:08:18] krmela: has joined #RubyOnRails
[12:17:07] krmela: good day , iam rendering simple work day calendar and i have strange error on line where i am compare wday https://gist.github.com/anonymous/e6f14807182d4b38da13d72787a5ef95
[12:19:22] krmela: it is <%=if (day.wday == actualday.wday)%> in index.html.erb
[12:55:55] krmela: Quit: Leaving

2017-06-26

[05:55:27] krmela: has joined #RubyOnRails
[05:57:51] krmela: good day there i have question i am writing function which check for next work day from given date excluding as well free days from table i dont know where this days shall be it is model related or in controller ?
[06:03:24] krmela: havenwood: well i have in model table locked days and trying write function which look for next bussiness day 1-5 excluding days specified in table locked days
[06:07:34] krmela: crova: it is empty hash i think
[06:08:51] krmela: Jason: you forgot to add to model , dependent: :destroy
[06:13:45] krmela: Jason: yes add that to user model
[06:53:20] krmela: havenwood: question where is best place to place bussiness day calculation in model or controller or another ?
[06:53:32] krmela: hello dminuoso
[06:55:29] krmela: dminuoso: it is two function they got date as param and looking for next bussness day excluding holidays from some table
[06:55:47] krmela: prev/ next bussiness day
[07:06:09] krmela: well first try of date looking function https://pastebin.com/rX1u8heN can anyone give me suggest on that ?
[08:53:04] krmela: hello there i am trying make function which check if it is work days and date is not in locked days just maybe anyone knows what is wrong on line 3 https://pastebin.com/s21kaL4t
[08:57:14] krmela: dminuoso: sorry my mistake i am make another pastebin with whole class
[09:01:22] krmela: well here is https://pastebin.com/bkMjvnBp i am dealing with looking next working day /previous
[09:07:09] krmela: well i am in that looking for next business day and check if is that day holiday then date increases , but it failed with current date
[09:08:28] krmela: well i am trying look for next/previous bussines day in calendar sorry
[11:00:26] krmela: Quit: Leaving
[12:19:53] krmela: has joined #RubyOnRails
[12:42:59] krmela: Quit: Leaving

2017-06-22

[09:15:56] krmela: has joined #RubyOnRails
[09:17:29] krmela: hello there can anyone tell me how to is correct syntax for collectionselect with rails 5.1 and new form_with
[09:18:13] krmela: <%=form.collection_select( :supplier_id, Supplier.all, :id, :name {:id=>:food_supplier})%>
[12:39:08] krmela: Quit: Leaving