That's a very short error message. What did the rest of the error say?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an
Since this is in the Rails forum I'll assume you're talking about a
website
using JavaScript.
The short answer is No. JavaScript is sandboxed to avoid giving
viruses precisely the kind of control you're asking about. Altering a
user's network settings via a website would be a very dangerous
The link has an extra on the end. Remove that and it works :)
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
Rather than asking for small pieces of information one at a time on a
forum, you would be much better served by completing a few Rails
tutorials and creating some Rails projects on your own computer. Then
you will understand what's happening on the server.
--
Posted via
I think Spree should work fine as long as you pay attention to the
requirements; such as Ruby version and Rails version.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this
You shouldn't need a Regex for that, how about String#include?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
I suspect that a full answer to that question would necessitate the
writing of several books. I don't fully understand what's going on in
the background but I'll have a go at explaining my take on it.
The Ruby interpreter creates a runtime environment in which to hold
the objects.
Since Rails
Prasad Gurjar wrote in post #1125841:
For e.g How objects are called from controller to view ? what actions
are performed in background?
The controller is given a template, either implicitly by the method name
or explicitly in the code.
The template may have multiple extensions, e.g.
I'm not sure what the standard is, but I expect you'd handle the
conditional when entering the value into the hash.
hash = {}
hash[:reward] = condition ? Bark five times : Bark four times
%{reward} % hash
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are
Usually the simplest way to learn how a gem works internally is to go
and read the source code. This should be available in the gem files, on
a github repository, or in the documentation.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the
I haven't examined Roo, but you can see RubyXL reading the file into
memory here:
https://github.com/gilt/rubyXL/blob/master/lib/rubyXL/parser.rb
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
I use the MIT license as well. It's common enough that users will
recognise it immediately, and covers the basics while being succinct.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To
The String class has methods associated with it. You use these the same
way as most methods in Ruby:
s = 'a string'
s.upcase
#= A STRING
s.reverse
#= GNIRTS A
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on
I've never personally used it, but allegedly
http://rubygems.org/gems/axlsx should work.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails
Joel Pearson wrote in post #1123519:
I've never personally used it, but allegedly
http://rubygems.org/gems/axlsx should work.
My mistake, that only outputs xlsx. Roo seems to be the obvious choice.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you
Yes, that's how editing files usually works. You overwrite a modified
copy of the file.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails
If you're coming from VBA you'll probably need to brush up on your
Object Oriented Programming as well.
http://www.tutorialspoint.com/ruby/ruby_object_oriented.htm
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on
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
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/.
What are you using as the sender (from) address?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
uniq can take a block as well if you wanted to unique similar arrays on
a specific element:
@mem.uniq { |mem| mem[1] }
Or even on multiple criteria:
@mem.uniq { |mem| [ mem[1], mem[2] ] }
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to
I believe the standard way to do this would be to show a previously
hidden div containing a form.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop
Do you mean you want to link to other sites, or you want to download and
display pages / partials from other sites inside your app?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe
If you were going to use Hash#merge to remove duplicates between the two
result sets, you might as well just use Array#uniq on the Array.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To
If you want to store multiple on/off switches together, then Binary is
your friend.
No, Yes, No, No, Yes, Yes, No
0100110
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from
I think when you say static html for the pages, you really want
dynamically generated content. You need a simple template which presents
the requested information with links up and down the chain.
The first thing you need to do, particularly if you have data to start
off with, is sort out the
One reason to use Symbols is that they are immutable. When you're
passing one around as an argument or Hash key, it won't change.
Another is that multiple instances of a Symbol are the same object,
making a smaller memory footprint than Strings.
A string is not a symbol. Some structures will
Thanks all. MediaWiki is the one I'm planning to use at the moment.
Looks like it's time to learn how Apache PHP work :)
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this
I've been asked to put together a simple intranet Wiki, but the only
server I have available is a Windows 7 machine with Rails ( on Ruby
2.0 ) installed.
I've been looking around for options which will work on this platform -
I tried Instiki and Refinery CMS but neither of them appear to be
This should help:
http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails
Useful link, thanks.
I was hoping for a Rails option because I haven't yet found another web
host which will work on a Windows 7 PC without a fuss.
I've tried Wordpress and Joomla, but Microsoft's WebMatrix refuses to
work without an actual Internet server, and I only want a local Intranet
I suppose you could check the environment from within the relevant
function.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it,
I've installed conemu, it looks useful.
How do you get Rails to output colour characters to the console?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop
Aha, found it. I added Pry to the gemfile, replaced IRB with Pry in the
config, and created a .pryrc file with a command to turn the colours on.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
No problem, we're here to help :)
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
There's a quick guide on how to install Sqlite3 on Windows 7 here:
http://www.ruby-forum.com/topic/4413168
I followed the instructions on there, and after a few minor tweaks, I
managed to get it working.
I've tried to attach a zip with the necessary files in. Hopefully if you
can download
Thanks for the tip! If the call to super triggers the validation then
that should be perfect.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving
I'm using Rails 3.2.13 with Ruby 2.0.0
I have a field in a form called hours which normally passes a
numerical value.
However, my users also want the option to pass time values, like
01:15, 00:25, :05, etc.
I've tried to allow for this sort of thing with the below code:
__
validates
I've managed to get the event to fire now, but what I get from STDOUT is
0.0
So I guess that means I'm not receiving a string from input.
before_validation :convert_hours
protected
def convert_hours
STDOUT hours
if hours hours =~ /:/
hrs, mins = hours.scan(
Catching that 0.0 value was the right direction to look in:
def convert_hours
if hours_before_type_cast hours_before_type_cast =~ /:/
hrs, mins = hours_before_type_cast.scan( /(\d*):(\d*)/ ).first
self.hours = BigDecimal( ( hrs.to_f + ( mins.to_f / 60.0 ) ), 4 )
end
end
I can see it being quite dangerous to uninstall all dependancies of a
given gem. In theory it could be dependant on gems which have become
part of the core library in more recent Ruby versions, for example.
However if you mean you want to keep only the latest version of each
gem, there's the
You can also execute system commands from within irb using system
system( mkdir lesson2 )
or backticks
`mkdir lesson2`
Although in the case of mkdir you'll probably want to use Dir.pwd to
check you're in the right directory, and Dir.chdir('c:/myfolder') to
move to the correct folder first.
--
42 matches
Mail list logo