New answers tagged ruby
Score of 0
0
votes
Form validation in ruby on rails
If you submit the form via JavaScript as a JSON request, you can keep the HTML exactly as it is. You also don't need a custom validate_signup method. Rails handles validation when you try to save a ...
Score of 1
1
vote
How to make a guest connection in Action Cable?
Action Cable doesn't require a current user for each connection.
There are two common options for guest connections:
Public connection - simply allow WebSocket connections without authentication.
...
Score of 3
3
votes
How to make sentence DSL in Ruby?
The idea of an Internal DSL is that it is just a clever way of using the host language's syntax. In other words, code written in an Internal DSL is syntactically valid host language code.
However, the ...
Score of -1
-1
votes
Automatically set instance variable as method argument?
method(:initialize).parameters.map { |_, arg| eval("@#{arg} = #{arg}", binding, __FILE__, __LINE__) }
Score of 0
0
votes
undefined local variable or method `http' for main:Object (NameError)
For me running:
ruby -run -e httpd . -p 8000
works well with ruby 2.2 but with 1.8.7
-e:1: undefined local variable or method httpd' for main:Object (NameError)
So guess you gotta go the manual route ...
Top 50 recent answers are included
Related Tags
ruby × 229124ruby-on-rails × 112171
ruby-on-rails-3 × 16119
ruby-on-rails-4 × 12301
rubygems × 11122
activerecord × 8542
rspec × 8059
arrays × 7678
regex × 5395
javascript × 4742
hash × 4300
sinatra × 4219
devise × 3878
heroku × 3804
postgresql × 3533
json × 3351
nokogiri × 3263
ruby-on-rails-5 × 3170
mysql × 3060
string × 2965
rvm × 2760
html × 2741
watir × 2684
selenium-webdriver × 2533
jquery × 2345