roelof

Activity Graph

Page 1 of 12 | Next »

2019-02-13

[18:09:35] roelof: has joined #RubyOnRails
[18:09:59] roelof: Why is this not giving me a link with the icon
[18:10:21] roelof: <%= article_path(article) do %> <i class ="material icons"> delete </i> <% end %>
[18:50:43] roelof: I see, I also do not get a answer to my question. Maybe I have to find a better channel to ask for help or leave rails
[19:09:37] roelof: Quit: Page closed

2019-02-08

[19:31:49] roelof: has joined #ruby
[19:34:07] roelof: someone who can help me to make this work : https://gist.github.com/RoelofWobben/e7429eefd37df9a1bf3b4ddad9065ca3
[20:15:45] roelof: @havenwood : oke, then there is another bug
[20:17:40] roelof: https://dpaste.de/VXu0
[20:21:16] roelof: @havenwood : added the tests.
[20:22:12] roelof: no, the dpaste.de : https://dpaste.de/dROT
[20:23:50] roelof: oke, to which name
[20:24:37] roelof: now convert the second to a time string
[20:24:53] roelof: I can do that
[20:25:20] roelof: and then make a method seconds that returns zero
[20:25:35] roelof: according to the test I need a method seconds
[20:25:59] roelof: ` expect(@timer.seconds).to eq(0) `
[20:31:27] roelof: @havenwood : giving up oin this one : https://dpaste.de/OJ0R
[20:32:31] roelof: yep, but still do not see what I have to change to make it work
[20:36:02] roelof: now I see this : NoMethodError: undefined method `seconds=' `
[20:40:06] roelof: next problem
[20:40:26] roelof: expected: "00:01:06" got: "00:00:66"
[20:46:29] roelof: @havenwood : updated gists: https://gist.github.com/RoelofWobben/e7429eefd37df9a1bf3b4ddad9065ca3
[20:49:48] roelof: yep, everything is finally green
[20:50:15] roelof: but I think we can do without the initialize method
[20:53:56] roelof: @havenwood thanks, this is the code that makes all tests green : https://gist.github.com/RoelofWobben/e7429eefd37df9a1bf3b4ddad9065ca3
[20:54:14] roelof: but still wierd that I have to do twice : @seconds = seconds
[20:57:05] roelof: oke, I leave it this way but still I find it wierd
[20:57:21] roelof: @havenwood : thanks a lot
[20:58:37] roelof: thanks now time for learning rails at the Odin project
[20:58:56] roelof: and later on that course learn more and more about ruby
[20:59:29] roelof: have all a good evening
[21:04:11] roelof: Ping timeout: 256 seconds

2019-01-13

[16:01:21] roelof: has joined #ruby
[16:02:05] roelof: is VSCode a good ide on Windows. Im thinking of starting with the Odin project to learn ruby and ruby on rails ?
[16:09:39] roelof: oke, I used it for learning haskell I use vscode also
[16:10:10] roelof: is there some sort of tutorial what I need to make my first steps with ruby
[16:11:20] roelof: I can do that one also
[16:11:49] roelof: earlier I used rubyMonk but that one does not work properly anymore :(
[16:19:03] roelof: tryRuby is easy. I think I will start wit the Odin project
[16:19:57] roelof: is Atom much better then the VSCode ?
[16:38:00] roelof: Quit: Page closed

2018-11-27

[14:31:44] roelof: has joined #ruby
[14:32:40] roelof: is still RubyMonk the best free way to learn ruby ? and can I work on Windows 10 well with ruby ?
[14:46:50] roelof: Quit: Page closed

2018-03-16

[07:13:36] roelof: has joined #ruby
[07:14:57] roelof: I try to solve level 4 of the ruby warrior. But I see this error ` comparising Fixnum with nil failed ` with this code : http://lpaste.net/363679
[07:15:04] roelof: what did I do wrong ?
[07:32:18] roelof: am now at level 6 of ruby warrior but im really stuck. I want that if the health is not enough the warrior steps one back and rest but of I use this code I see a message that I can only perform one action at the time
[07:32:24] roelof: how to solve this ?
[07:33:26] roelof: yep . how I can make this work in ruby. I try to learn some ruby by using this site
[07:35:50] roelof: it can be
[07:36:08] roelof: other recommendations for the first steps in ruby ?
[07:41:10] roelof: Quit: Page closed
[11:54:37] roelof: has joined #ruby
[11:55:03] roelof: Where can I the best ask question if im stuck with ruby warriors
[12:47:47] roelof: good afternoon here
[12:48:56] roelof: here too. the whole day rain , rain and rain
[12:51:49] roelof: Quit: Page closed

2018-03-04

[18:08:41] roelof: has joined #ruby
[18:09:23] roelof: Is there another free alternative to ruby monk. When I want to visit the site I see a certificate error
[18:26:31] roelof: Quit: Page closed
[21:11:46] roelof: has joined #ruby
[21:12:13] roelof: What is the best free resource to learn ruby with challenges ?
[21:24:21] roelof: Quit: Page closed

2016-07-11

[11:36:36] roelof: has joined #RubyOnRails
[11:37:10] roelof: How do I make it work that I can update a record.
[11:37:39] roelof: Im making a record with this : @account = FactoryGirl.create(:valid_account)
[11:38:06] roelof: and want to change the name with this : process :update, method: :patch, params: {params: {id: @account["id"],name: "Test Account" }, format: :json }
[11:38:38] roelof: but if I look at the error message : No route matches {:action=>"update", :controller=>"account", :format=>:json, :params=>{:id=>1, :name=>"Test Account"}}
[11:39:01] roelof: I cannot use the name part which has to change. How do I make this work ?
[11:46:35] roelof: sevenseacat: my problem clear or not ?
[11:53:11] roelof: sevenseacat: this better or is there missing info : https://gist.github.com/rwobben/92f65dcd023ec1ad37a37a3315ca94c9
[11:55:09] roelof: sevenseacat: params {} ??? where it schould be {params: {id: @account["id"],name: "Test Account" }, format: :json }
[11:56:04] roelof: I wonder where you found params : {} . params schould not be empty ?
[11:56:58] roelof: aha, there is a problem. It schould not be nested , I will take a look why this happens
[12:02:50] roelof: sevenseacat: updated the gist to the new situation : https://gist.github.com/rwobben/92f65dcd023ec1ad37a37a3315ca94c9
[12:06:17] roelof: I deleted the nested params line to a single params line ,nothing more sevenseacat
[12:08:56] roelof: sevenseacat: im thinking how to solve it. Appereantly I have to add account so something like this params : { :account {id: @account["id"], name:"Test Account}, format :json } I think
[12:10:16] roelof: Can I use the webbrowser on a api ? So I have to goto /accounts/update to see what you mean ?
[12:13:00] roelof: sevenseacat: the accounts_params looks like this : params.require(:account).permit(:name, :category)
[12:17:25] roelof: sevenseacat: appereantly I do not know: I have now this : params: { :account => {id: @account["id"], name:"Test Account"}, format :json }
[12:17:52] roelof: and I see this error message : syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' (SyntaxError)
[12:22:26] roelof: Ping timeout: 250 seconds
[12:26:45] roelof: has joined #RubyOnRails
[12:27:21] roelof: I think I has to do with the :account -> part but have no idea how to solve this. Anyone who can give me a hint ?
[12:33:35] roelof: Can somehow help me to figure out where and how to solve the syntax error here : process :update, method: :patch, params: { :account => {id: @account["id"], name:"Test Account"}, format :json }
[12:36:27] roelof: chips and now I see this old message again : No route matches {:account=>{:id=>1, :name=>"Test Account"}, :action=>"update", :controller=>"account", :format=>:json
[12:40:07] roelof: dminuoso: I have no idea anymore, The only thing I try is to update a account which is made by Factorygirl
[12:40:34] roelof: I try to change the name from "Example Account" to "Test Account"
[12:41:38] roelof: I try to run a rspec controller spec on my api
[12:42:36] roelof: dminuoso: how do I check that on a api ?
[12:43:20] roelof: dminuoso: i also mean that
[12:43:58] roelof: or do you mean the patch method could be wrong, dminuoso ?
[12:45:49] roelof: oke, I use it like this : process :index, method: :get, params: {format: :json } and then it worked
[12:47:56] roelof: dminuoso: and I have used it like this : process :show, method: :get, params: {id: @account["id"], format: :json } for a show action which worked well
[12:48:18] roelof: dminuoso: and I have used it like this : process :show, method: :get, params: {id: @account["id"], format: :json } for a show action which worked well
[12:49:11] roelof: so there schould be 2 seperate parameters in the hash. The record and the part format: :json
[12:49:30] roelof: and I think there is something wrong
[12:50:53] roelof: If I look at the route : PATCH /account/:id(.:format) account#update , it only need a id
[12:51:06] roelof: but somehow I have to say the new data
[12:55:15] roelof: sevenseacat: not for a api. For a full blown site I always made a form. Push the update button and it worked
[12:55:56] roelof: oke, I will
[12:56:15] roelof: sevenseacat: thanks for the help so far
[12:56:37] roelof: dminuoso: thanks so far
[12:58:30] roelof: sevenseacat: then I cannot find the good tutorials :(
[13:07:59] roelof: Quit: Page closed

2016-07-10

[16:05:27] roelof: has joined #RubyOnRails
[16:06:44] roelof: I have put this into my spec file : process :show, method: :get, params: {account: @account_attributes, format: :json }
[16:07:03] roelof: but now I see this error message: ActionController::UrlGenerationError: No route matches {:account=>{:name=>"{name: test} ", :category=>"Bezittingen langer dan 1 jaar"}, :action=>"show", :controller=>"account", :format=>:json}
[16:07:11] roelof: how to solve this one ?
[16:11:07] roelof: pontiki: this better : https://gist.github.com/rwobben/40e66eb65b6d54e21fa0f1d550393f61
[16:14:28] roelof: pontiki: done it, rake routes is added
[16:19:42] roelof: no, @account-attributes do not contain a id. Can I somehow add it to the factory ?
[16:20:29] roelof: because I use factory girl for testing
[16:20:54] roelof: sorry, that was a wrong one. I use a :valid account
[16:21:05] roelof: moment, I have to update the gist
[16:22:17] roelof: gist is updated. I try to test the show function of my controller.
[16:25:06] roelof: I thougt, it would be handy.But apperently Im wrong
[16:25:13] roelof: back to the books
[16:34:28] roelof: I change the code to @account = FactoryGirl.create(:valid_account)
[16:37:51] roelof: other problem. How can I get the id of this record : #<Account id: 1, name: "Example account", category: "Bezittingen langer dan 1 jaar", created_at: "2016-07-10 16:36:44", updated_at: "2016-07-10 16:36:44">
[16:38:13] roelof: I thought ["Account id"] would do the job
[16:42:46] roelof: fryguy: thanks
[16:46:21] roelof: Quit: Page closed

2016-07-07

[05:17:25] roelof: has joined #RubyOnRails
[05:18:20] roelof: Is there a way I can check if a json request contains { , or [ . I try to validate it so it will not end up in the database
[05:19:18] roelof: I tried a regex and a json scheme but on both do not do the job. Or I see no error messages or things like "{test} " are validated which is wrong
[05:23:34] roelof: fvthree: and where is our place for you ?
[05:38:12] roelof: Is there a way I can check if a json request contains { , or [ . I try to validate it so it will not end up in the database
[05:38:17] roelof: I tried a regex and a json scheme but on both do not do the job. Or I see no error messages or things like "{test} " are validated which is wrong
[05:39:40] roelof: Radar: oke, how can I reprase it then so im asking about my problem
[05:39:53] roelof: I m reading that page now
[05:40:26] roelof: oke, lets try
[05:40:52] roelof: im making a api where people can enter financial accounts
[05:41:18] roelof: now I want only that the name part is a string that does not contain [ , {
[05:41:33] roelof: I wonder what the best way to achieve this ?
[05:42:12] roelof: the financial account has a model name where the name of the account is mentioned
[05:42:36] roelof: example of a json request ?
[05:50:01] roelof: matt_d: yep, that is the idea that I try to make
[05:51:36] roelof: Radar: oke, let's say I have this json request to my api : curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -H "Postman-Token: 5c88a90e-8470-852e-074e-1a1eb1a8d56a" -d 'account[category]=Bezittingen langer dan 1 jaar&account[name]="test" ' "http://paytime-rails5-wissel.c9users.io/account/"
[05:52:16] roelof: this one schould be stored in the database because the account[name] has no { [ or ,
[05:52:25] roelof: Radar: so far so good ?
[05:53:36] roelof: I think it is : the account model has two fields . Name and category
[05:54:44] roelof: I did that one validates :name :format /[a-zA-Z] , message : "illigial input"
[05:55:19] roelof: but I do not see that message on the json output here : render json: { errors: @account.errors,status: 422}
[05:56:02] roelof: matt_d: I have now this code : https://gist.github.com/rwobben/153c0175e47f9755226e9ca68dea8b09
[05:56:23] roelof: but then "{test}" is also validated , which is wrong
[05:57:43] roelof: this is my controller : https://gist.github.com/rwobben/3677af190d864048a2df75c1a8fa6386
[05:57:52] roelof: Radar: ^^^^
[05:58:55] roelof: oke, so make a custom validation function, Radar ?
[06:00:00] roelof: sorry, I have wrote some test and with the regex I do not see the custom error message so the test is failing
[06:03:03] roelof: at some wierd way I cannot place the message "Illigial input" into the json output, If I can do it , I would be very happy
[06:05:02] roelof: Radar: can I do something like this : render json: { errors: @account.errors, messages: message, status: 422} ?
[06:06:29] roelof: Radar: oke, I will go back to the regex idea and see if I can see the custom error message
[06:17:23] roelof: pff, syntax error here : validates :name, :format '/[a-zA-Z]/' , message : "iligale input" , the , after name is not good :(
[06:20:40] roelof: oke, that part is working
[06:25:32] roelof: oke, that is only for the test but no problem for another message
[06:32:46] roelof: Radar: still problems with the regex : When I do : validates :name, :format => {:with => /[A-Za-z]/},:message => "name should only contain alphanumeric characters"
[06:34:32] roelof: I see this error message : Unknown validator: 'MessageValidator'
[06:36:43] roelof: oke, and now some old test are failing, I have to see why
[06:41:58] roelof: very wierd, I have this as output : {:name=>"Example account", :category=>"Bezittingen langer dan 1 jaar"}
[06:42:32] roelof: and sending it to this validation : validates :name, :format => {:with => /[A-Za-z]/,:message => "name should only contain alphanumeric characters"}
[06:43:22] roelof: and I see the error message. but Example Account is only alphanumeric characters so it schould be valid
[06:44:00] roelof: yep, this is a old test which is failing , which has worked before
[06:50:23] roelof: I think I see the problem, Im using Example Account which has a space in it. A space is not a alphanumeric character
[06:50:34] roelof: so I have to change the regex
[06:58:57] roelof: baweaver: is this a question for me ?
[06:59:03] roelof: at this moment , no
[07:01:26] roelof: im going to hit the books how to make a regex which says alpanumeric and spaces are allowed
[07:01:33] roelof: Thanks all for the help so far
[07:05:06] roelof: thanks, this one seems to work : [a-zA-Z|" "]
[07:08:55] roelof: and here it do not do what I was expecting : validates :name, :format => {:with => /[a-zA-Z|" "]/,:message => "name should only contain alphanumeric characters"}
[07:09:01] roelof: time for a break
[07:09:48] roelof: I have done that course a time ago
[07:10:10] roelof: but still wierd that on rubalar it works and on the rails code it do not
[07:18:40] roelof: Quit: Page closed
[10:53:41] roelof: has joined #RubyOnRails
[10:58:25] roelof: why do I see this error : {:errors=>{:category=>["is not included in the list"]}, :status=>422} on a item which is on the valiidation list : https://gist.github.com/rwobben/ee02f1ac6777513497cc311ce24f9bb9
[11:04:18] roelof: dminuoso: does Rails 5 also uses spring ?
[11:05:14] roelof: hmm, then maybe it can be the culprit of my problems I described earlier in this channel
[11:05:36] roelof: a rspec which fails where it schould have been correct
[11:07:09] roelof: turbolinks : nope , I do not use it
[11:07:33] roelof: Spring is used so I have to find out how to restart, delete it
[11:09:26] roelof: I did bundle exec spring stop and the problem still exist
[11:10:13] roelof: why do I see this error : {:errors=>{:category=>["is not included in the list"]}, :status=>422} on a item which is on the valiidation list : https://gist.github.com/rwobben/ee02f1ac6777513497cc311ce24f9bb9
[11:13:58] roelof: workmad3: sorry, can you explain what you mean ?
[11:14:53] roelof: I see: I have to do : @account = Account.new(account_params)
[11:16:29] roelof: and I have looked at the code for some time
[11:16:35] roelof: thanks all
[11:26:41] roelof: another question. I have this regex [a-zA-Z| " "] . now im feeding it with "{test}" . I expect a failure but I see a success. Why ?
[11:26:58] roelof: Quit: Page closed
[11:27:25] roelof: has joined #RubyOnRails
[11:29:26] roelof: I have tested it with http://rubular.com/ and there only the characters are chosen not the {
[11:31:22] roelof: I cannot test reggy. Im working on Windows and I cannot open tbz files :(
[11:42:15] roelof: no boundries
[11:43:12] roelof: thinbgs like "Exampel Account" are good. the only things that are bad are { , [ so everything you do not use in a string
[11:44:36] roelof: oke, the name can be test or Test but not {test} or [test] or {test1, test2}
[11:47:10] roelof: the [\w|"]+ seems to do the job. I see a validation error :)
[11:50:24] roelof: sorry: I do not work, I still see a malformed record and a status 200 instead of 422
[12:06:21] roelof: universa1: my question comes to this : how can I take care that only alphanumeric characters are valid , so if something contains a { or a [ it must be invalid
[12:06:34] roelof: so test is valid , {test} must be invalid
[12:07:28] roelof: better said "test" is valid "{test}" or "[test]" are invalid
[12:13:21] roelof: matthewd: oke, some more puzzeling to do . I have to make a regex that says something must begin with a alphanumeric character ,from the second it can be a alphanumeric character or a space
[12:48:08] roelof: Ping timeout: 250 seconds

2016-07-06

[09:54:28] roelof: has joined #RubyOnRails
[09:55:40] roelof: How can I solve this error : undefined local variable or method `schema' for #<ValidateAccountService:0x00000003f6a448 on this code : https://gist.github.com/rwobben/fdb161e680919c0a72dba14f4d27dabe
[09:57:40] roelof: sorry, then I see this message : uninitialized class variable @@schema in ValidateAccountService
[09:57:57] roelof: or must I change both to @@schema ?
[09:58:55] roelof: oke, I do and have to change more
[10:03:27] roelof: alfiemax: I do not see what you mean exactly
[10:03:53] roelof: but I have now another problem. In the last line I have this : @account.create!(@params)
[10:04:05] roelof: but @account is not defined there :(
[10:06:50] roelof: @account schould contain a "member" of the account model
[10:08:29] roelof: alfiemax: I thought I know the difference a instance variable I can use outside the class, a class variable I can use only within the class
[10:09:47] roelof: I try to validate a json request which if it's validates will be stored into the database
[10:17:23] roelof: oke, when using instance variables they are only work for instances of a class not the class itself. the class variables works for instances and classes. This better, alfiemax ?
[10:48:54] roelof: no body who wants to work with me to make this service object work ?
[10:56:55] roelof: raldu : I know\
[11:03:32] roelof: when I do this : https://gist.github.com/rwobben/66a045db37bef89864643e3db2e4c22c. I see this error message : Invalid schema - must be either a string or a hash
[11:04:13] roelof: frojnd: hi
[11:06:30] roelof: frojnd: can you show the code and the errors you see ?
[11:08:09] roelof: try this <%= link_to "About", about_path %> , frojnd
[11:09:52] roelof: the problem is that 'about_path` is a string which contains about_path
[11:10:03] roelof: and not the real path
[11:26:12] roelof: alfiemax: when I do what you said and make schema , @schema I see this error message : Invalid schema - must be either a string or a hash
[11:28:02] roelof: alfiemax: here you have : https://gist.github.com/rwobben/7b4dfb43b728f98dcd18ebc4ecf3c126
[11:31:36] roelof: which comment. I do not see any?
[11:32:05] roelof: now I see it
[11:34:19] roelof: alfiemax: thanks, now I see this one again : undefined method `create!' for nil:NilClass
[11:34:37] roelof: Im getting the feeling that im running around in circles :(
[11:38:39] roelof: alfiemax: same error message. Maybe I have to find a better way to validate json request
[11:39:32] roelof: no problem. Thanks for the help so far
[11:41:16] roelof: Quit: Page closed
[15:26:33] roelof: has joined #RubyOnRails
[15:28:40] roelof: how can I validate that a json value is not allowed to be a hash or a array. I thought a json-scheme of "name" => {"type" => "string"} would do the job but that one accepts {test} which schould not be validated
[15:35:59] roelof: CamonZ : here you have the whole validate_account_service : https://gist.github.com/rwobben/6f40490def79a8764f8b3bf912b468d1
[16:59:24] roelof: Quit: Page closed