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.
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 :-)
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?
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 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
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.
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.
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)
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.
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!
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'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!
I'm working with Rubyonrails2.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.
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!
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?
Possible Duplicate:
Can I add custom methods/attributes to built-in Python types?
In Ruby you can override any built-in object class with custom method, like this:
class String
def sayHello
return self+" is saying hello!"
end
end
puts 'JOHN'.downcase.sayHello # >>> 'john is saying hello!'
How can i do that in python? Is there a normally way or just hacks?
Here's one that stumped me for a while, though in retrospect it should have been obvious. I was getting the error message
NoMethodError: undefined method `constantize' for 0:Fixnum
when accessing a model through a polymorphic association. Turns out the table on the belongs_to side of the association had an integer type column instead of a string.
Easily fixed, but it seems like Rails ought to raise an error in this situation -- instead it happily adds the row with 0 in the type column.
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 have controller with action new, and I want it to create ActiveRecord::Base descendant object, and write it into database (without showing it to user).
def new
active_order = current_user.orders.find {|o| o.status > 0 }
active_order = Order.new if active_order.nil?
(...)
end
Order.new creates local object, but my question is -- how to make Rails to fill it with default values and write to database?
What's Sinatra's equivalent of Rails' redirect_to method? I need to follow a Post/Redirect/Get flow for a form submission whilst preserving the instance variables that are passed to my view.
Does the redirect method preserve them? (I'm at work at the moment and don't have access to Sinatra to try for myself.)