I have not tried yet, as I would rather not spend time setting up memcached if this is not going to work...
I am using Ruby. Is is possible to store a resource, such as an FTP connection, in memcache?
I have to stay away from my MacBook and will use Windows for a while. I missed Textmate's folder view when editing my rails projects. Is there an editor on Windows with the folder view? I know there is the E text editor. But I'll save a few bucks if there is a free (cheaper) alternative, as I won't stay in Windows for long ...
I have been looking at paypal for a online transaction, but I wanted to know if there are other 3rd party vendor that offer a good service at a good price ( transaction fee) and ease of use of API for rubyonrails application.
When i have a table;
1 0 0 1 0
0 1 0 1 0
0 0 1 0 1
1 1 1 1 0
0 0 0 0 1
Say i want to only read and keep the values along the upper diagonal of this table, how can i easily accomplish this in pure ruby?
Such that the final structure looks like
1 0 0 1 0
1 0 1 1
1 0 1
1 0
1
Thanks
HI,
I used to have PHP websites and using url rewriting on picture to have SEO friendly urls,
On php I had links like
/image/blablablabla-1234-blablabla
rewriting to:
/image/1234.jpg
by using a url rewrite rule on apache .htaccess file.
Now I totally switched to rubyonrails and I would like to know what is the best way to do that on RoR? I am hosting websites on apache with passenger.
Thanks in advance
I'm learning RubyonRails.
I'm using some associations (has_many :through, ...)
But i'm having some problems with it when i'm combining my views.
How exactly do i combine these nested forms? Can i do this with partial forms and where do i have to write extra code for this? I have seen examples only use the "view" and others also edit the controller....
An example would be very nice :-)
Hello,
I need to make a collection with a lot of movies, but I was wandering if there is something like API or other method to make that database automatically? I will be using RubyonRails, but if there is a useful and fast tool, I will use it.
Thank you.
I am currently learning RubyonRails. I currently do all my development on my laptop. However, I know in all "real world" situations, I will be connecting to a dedicated server that will hold the site.
So here is my question: what are the pros and cons of developing on the machine I use vs running the website on a separate server?
I'm using thinking sphinx to for search on a rails app. I have a float field called 'height'. I need to be able to search this field for exact values (i.e. exactly 6.0, not 6.5). I also need to be able to sort on the field.
What I have so far:
indexes height, :sortable => true
Problem:
doesn't sort properly, returns 6.0 and 6.5 if I search for '6'
I want to share a method amongst all Ruby's data object classes. That is to say the following classes:
Hash
String
Number
Array
Firstly, any classes I've missed out?
Secondly, how can I share my_method amongst all classes at once?
class Hash
def my_method
"hi"
end
end
class String
def my_method
"hi"
end
end
class Number
def my_method
"hi"
end
end
class Array
def my_method
"hi"
end
end
while installing any Gem or doing any listing of gem gzip related error comes as shown below:-
C:\Documents and Settings\gangunragem install rhosync -v 2.0.0.beta7 --pre
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:\Documents and Settings\gangunragem list rails -r
* REMOTE GEMS *
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
Please help me out how to reslove this
Dear friends,
I'm trying to set up a small full functional website for a small community on a shared hosting. Scientific computing is quite heavy. Scalability is not important. The only criterion is performance. Which framework would you suggest among the following:(or more) from your list)
1)Ruby onRails
2) Grails
3) asp.net
4) zend
I'm really new to this area, only starting reading some books and googling different blogs...so your expertise is really appreciated!
thanks!
Hello,
I have some difficulties for using Ruby block, passing in a method.
As in the following case, I would like to display each element of @array, from Box instance (using .each method):
class Box
def initialize
@array = [:foo, :bar]
end
def each(&block)
# well, hm..
end
end
a = Box.new
a.each { |element| puts element }
Thanks for any help.
I have a multi-dimensional array:
a=[[2,3,4],[1,3,4],[1,2],[1,2,3,4]]
i've to compare all the 4 sub-arrays and get common elements.Next,take 3 subarrays at a time and get common elements.then take 2 sub arrays at a time and get common elements, in RUBY.
I am not able to validate passord with ()-=_+ , i.e it should accept these special characters but its not working when i use the regular expression as
`validates_format_of :password, :with => /^[A-Za-z0-9. ! @ # $ % ^ & * ( ) _ - + = ]*\z/`
its only excepting till * but not accepting ()-=_+ in rubyonrails.
Hi there,
This might be a stupid questions but I wanted to know what happens if two users edit some data at once and then both click submit at the same time, I assumed Rails handled requests one after the other and so someone would get an error message but is this correct?
Thanks
(Once one person has edited data I dont want it to be accessible or editable anymore)
After spending some time wireframing my ideas, I want to start building my rails app. However, I'm well aware that later down the line I'd like to consider multiple user accounts.
Should I be thinking about the implementation of this from this early stage, or is this something I can implement without too much fuss later?
It seems like something that would be stupid to attempt later, but part of me just wants to get the guts of the thing working - a couple of simply forms and writing/reading some stuff from the db.
I'm using the Ruby SVN bindings built with SWIG. Here's a little tutorial.
When I do this
@repository = Svn::Repos.open('/path/to/repository')
I can access the repository fine. But when I do this
@repository = Svn::Repos.open('svn://localhost/some/path')
It fails with
/SourceCache/subversion/subversion-35/subversion/subversion/libsvn_subr/io.c:2710: 2: Can't open file 'svn://localhost/format': No such file or directory
When I do this from the command line, I do get output
svn ls svn://localhost/some/path
Any ideas why I can't use the svn:// protocol?
I'd like to restrict access to my Rails app (running on Apache/Passenger) to just two IPs, but if the visitor doesn't fall into those two IPs, I would like for him/her to be prompted to enter a password that would allow any user with the proper credentials to access the site from anywhere.
I am new to configuring Apache and would appreciate any hints. Thanks!
Hi all,
Using the perennial example of a Blog webapp (and all resources are currently automatically mapped in routes.rb):
I have a simple index page that lists all my Post titles. I would like to add a form at the bottom of this page to quickly create new Posts.
I'm new to Rails and can't seem to figure this out! Please help!
HI all!
I would like to insert a hash at the beginning of a selected block of text in VIM (ruby comment). I selected the lines in Visual Mode, but how do I perform the same operation to all lines?
Thank you in advance!
what is the best way to implement real time updates in rubyonrails using Node.JS? It would be great to hear either real examples or your thoughts on alternative solutions
I'm working with Rubyonrails 2.3.4 and I'd like to pass some parameters from one page to another ones the first one is submitted.
For example:
On the first page, I have a form that when it's filled a Preview button can be clicked to check all the info entered before submitting the form. That button redirects to another page with the info entered before, but I don't know how to get it in the second page.