Re: [Rails] Need suggestion how can I skip the rest par inside a loop when erro is raised

2013-09-12 Thread Scott Ribe
On Sep 12, 2013, at 8:56 AM, Joel Pearson wrote: > Just use error handling properly. > > begin > #standard code > rescue > #only runs if an error occurred > else > #only runs if an error did not occur > ensure > #always runs at the end regardless of error level > end It seems to me that OP may

Re: [Rails] How much css do I need to know for becoming a Ruby on Rails Develoepr?

2013-09-12 Thread Dave Aronson
On Thursday, September 12, 2013, Alireza T. wrote: Do I need to worry about CSS? Please note that, I > have no interest in becoming a front end developer and my main interest > is back-end. > You'll need the basics, probably not much more... but you'd get better money if you can do the whole job,

[Rails] How much css do I need to know for becoming a Ruby on Rails Develoepr?

2013-09-12 Thread Alireza T.
I have a bachelor degree in Comp Sci. I know the basics of CSS. I can change fonts, backgrounds, colors, etc but I can not make complex layouts. I am planning to learn Ruby on Rails so I can apply for jobs as a Web Application Developer. Do I need to worry about CSS? Please note that, I have no in

Re: [Rails] Re: Should "sanitize" return an empty string for non-strings?

2013-09-12 Thread Hassan Schroeder
On Thu, Sep 12, 2013 at 11:52 AM, Robert Walker wrote: >> Params are strings by definition; can you provide a test case/code >> that demonstrates where this is not the case? > > Not necessarily the case. For example the create and update actions in a > users_controller will likely contain the use

[Rails] Re: Should "sanitize" return an empty string for non-strings?

2013-09-12 Thread Robert Walker
Hassan Schroeder wrote in post #1121316: > On Wed, Sep 11, 2013 at 3:36 PM, Paul E. G. Lynch > wrote: >> If, in your view, you are expecting params[:name] to be a string, but >> actually rails has parsed it into {"."=>"1234"} (or something more >> malicious) > > Params are strings by definition; c

[Rails] How to use rails runner altogether with bundle install --without development test?

2013-09-12 Thread Rodrigo Rosenfeld Rosas
In my Capistrano recipes, bundle install --without development test is performed. Then I tried to run a script with: bundle exec rails r scripts/my-script.rb It complained about not finding a development-only gem dependency that is not even required by that script. How am I supposed to call ra

Re: [Rails] Should "sanitize" return an empty string for non-strings?

2013-09-12 Thread Hassan Schroeder
On Wed, Sep 11, 2013 at 3:36 PM, Paul E. G. Lynch wrote: > If, in your view, you are expecting params[:name] to be a string, but > actually rails has parsed it into {"."=>"1234"} (or something more > malicious) Params are strings by definition; can you provide a test case/code that demonstrates w

Re: [Rails] Re: Should "sanitize" return an empty string for non-strings?

2013-09-12 Thread Paul Lynch
It is because I am trying to distinguish between "real bugs" and bad input (a 400 error) that I don't want this to be a 500 error. I have a rescue action that sends me an email when a 500 error occurs (though it limits the number it sends) because if there is a bug in the program that users are ru

Re: [Rails] Re: Should "sanitize" return an empty string for non-strings?

2013-09-12 Thread Jordon Bedwell
On Thu, Sep 12, 2013 at 12:22 PM, Paul Lynch wrote: > It is because I am trying to distinguish between "real bugs" and bad input > (a 400 error) that I don't want this to be a 500 error. I have a rescue > action that sends me an email when a 500 error occurs (though it limits the > number it send

Re: [Rails] Having some issues on backend regarding a social networking project on ROR

2013-09-12 Thread Yash Ladia
Thanx for your reply.My problem is that at a later point of time this would account for very large data set as the users will increase. I want to optimize my website and want to save time on data query from the database.Also, i will be looking for similar user profile based on user's attribute

[Rails] Re: Need suggestion how can I skip the rest par inside a loop when erro is raised

2013-09-12 Thread Love U Ruby
Joel Pearson wrote in post #1121289: > Just use error handling properly. > > begin > #standard code > rescue I am looking for the below operations,but only when error will be occured : a = (1..10) i=0 until a.size>10 next i+=1 if i<5 # this should be done on Error p a[i] i+=1 end If still I

[Rails] Re: Need suggestion how can I skip the rest par inside a loop when erro is raised

2013-09-12 Thread Joel Pearson
Maybe a real example would help, rather than infinite-loop pseudo-code. val = -3 until val > 2 begin val +=1 1/val rescue puts 'Error on ' + val.to_s else puts 'No Error on ' + val.to_s end puts 'Finished with ' + val.to_s end -- Posted via http://www.ruby-forum.com/.

[Rails] Re: Need suggestion how can I skip the rest par inside a loop when erro is raised

2013-09-12 Thread Joel Pearson
Just use error handling properly. begin #standard code rescue #only runs if an error occurred else #only runs if an error did not occur ensure #always runs at the end regardless of error level end -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed

[Rails] Re: Having some issues on backend regarding a social networking project on ROR

2013-09-12 Thread Yash Ladia
Thanx for your reply.My problem is that at a later point of time this would account for very large data set as the users will increase. I want to optimize my website and want to save time on data query from the database.Also, i will be looking for similar user profile based on user's attribute

Re: [Rails] Re: Should "sanitize" return an empty string for non-strings?

2013-09-12 Thread Matt Jones
It's unclear to me why you *wouldn't* want a 500 ISE here. Silently swallowing ArgumentError or NoMethodError is a terrible idea, since it also can obscure real bugs. If you really want that behavior, try: <%= sanitize(params[:name]) rescue '' %> --Matt Jones On Thursday, 12 September 2013 09

Re: [Rails] Re: Should "sanitize" return an empty string for non-strings?

2013-09-12 Thread Jordon Bedwell
On Thu, Sep 12, 2013 at 9:26 AM, Paul Lynch wrote: > In this case it is user (hacker, scanner, etc.), not the programmer, who has > passed the illegal argument. I don't think that should result in a 500 > server error. To avoid that, either the programmer has to check each input > parameter to m

Re: [Rails] Re: Should "sanitize" return an empty string for non-strings?

2013-09-12 Thread Paul Lynch
In this case it is user (hacker, scanner, etc.), not the programmer, who has passed the illegal argument. I don't think that should result in a 500 server error. To avoid that, either the programmer has to check each input parameter to make sure it is a string, or something like sanitize has to m

[Rails] Need suggestion how can I skip the rest par inside a loop when erro is raised

2013-09-12 Thread Love U Ruby
I need one suggestions from you :- Suppose I do have a code as below: until row == nil do #code1 begin #code2 <~~ which can raise an error rescue end #here I want some guard which can check,if any error occurred or not.If #error then skip below part and continue

Re: [Rails] Having some issues on backend regarding a social networking project on ROR

2013-09-12 Thread Peter Hickman
The information would seem to fit a RDMS perfectly. But then as you have not given us any idea as to how simple or complex you expect this data to be no one can tell. Tell us what the data is like and we will be able to give you a better answer. On 12 September 2013 09:16, Yash Ladia wrote: > I

[Rails] Having some issues on backend regarding a social networking project on ROR

2013-09-12 Thread Yash Ladia
I am working on a social networking project. I need to store about 10-15 user profile information like movies,music,books,relationship-status and so on. I am confused about which database should i use to store user profile info. There are NOSQL solutions like MONGODB as well as Neo4j(graph). Or