If you use haml as rails view template, you can write portion of your page using markdown by using the ":markdown" filter.
Is is possible to do the same using erb?
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why
Clojure/Compojure+Ring/Moustache+Ring
Groovy/Grails
Python/Django
Ruby/Rails
Turbogear
Cappuccino or Sproutcore
Javascript/jQuery
I am trying to write excel file by using ruby 1.9 spreadsheet version 0.6.4.1 on windows.
Everything is going ok,
until I get to the book.write statement
when I write book.write "c:/spreadsheet/excel-file.xls
I keep getting the following error
No such file or directory - c:/spreadsheet/excel-file.xls
Can anyone tell me what I should change in this path name?
I want to use selenium test to cover my rails project ! but i just find little documents on selenium test . I want someone to give me some documents for selenium test of all types !like website ,pdf ,text etc. you can sent them to my gmail [email protected] Thank you ,and best regards!
Hi,
I am trying to make a multi-dimensional array of characters in ruby, and this works, but is there a more elegant way?
def initialize(text)
@map = Array.new
i = 0
text.split("\n").each do |x|
@map[i] = x.scan(/./)
i += 1
end
#@map = text
end#constructor
For example this query:
SELECT `variants`.* FROM `variants` INNER JOIN `variant_attributes` ON variant_attributes.variant_id = variants.id WHERE (variant_attributes.id IN ('2','5'))
And variant has_many variant_attributes
What I actually want to do is to find which variant has BOTH variant attributes with ID = 2 and 5. Is this possible with MySQL? Bonus Question, is there a quick way to do this with RubyonRails, perhaps with SearchLogic?
I am on Ubuntu10
sudo apt-get install ruby1.9.1-full
then download sources of rubygem 1.3.7 and install it
sudo ruby setup.rb
then, for example, install sinatra
sudo gem install sinatra
Finally open irb and type
require "rubygems"
require "sinatra"
and get error
LoadError: no such file to load -- sinatra
from (irb):2:in `require'
from (irb):2
from /usr/bin/irb:12:in `<main>'
Gem.path is the same to INSTALLATION DIRECTORY from "gem environment"
I need to validate form on client-side and I was wondering if there is a rails plugin which will help me in this task (maybe it will build javascript needed to validate certain model)?
Do I need to pay the $30 just to play around in the sandbox for Website Payments Pro? I'm trying to get Active Merchant working in Rails, and it's giving me an error "invalid merchant configuration"... after digging around a bit it says I need to "accept the billing agreement" and/or sign up for the Payments Pro first. So, do I need to pay the $30 just to test in sandbox? Or is there another workaround for this error?
Hi,
I have started learning Ruby and just tried out my first hello world program in NetBeans IDE. I have one doubt, I can see that the new project wizard created set of package structure. It had one "Rakefile" in it. What does that mean and what is the use of it?
Thanks,
Bragaadeesh.
I'm trying out capybara with cucumber to get some better javascript test coverage. I have a lot of steps that check or use things from the Rails integration test helpers, for instance:
assigns(:current_user).should_not be_nil
No matter how I call assigns, even if I say something like p assigns it errors with:
undefined method `template' for nil:NilClass (NoMethodError)
So, it seems that I can't do that anymore. Is there an alternative to introspecting what's going on in the controller, or maybe some way of at least running those steps in such a way that I have the integration test stuff back?
When I use my regular client and send email through SMTP for an IMAP account, that outbound email gets saved in the IMAP "Sent" box.
How can I have the same behavior when I send email using RubyonRails Actionmailer?
I am running a Rails app so now I am trying to remote connect to mysql and I am getting this error
Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 0
Hi,
Have you an idea about this error message when i run the rake db:migrate
command under Aptana ?
rake aborted!
NoMethodError: undefined method `ord' for 0:Fixnum: SET
SQL_AUTO_IS_NULL=0
Thanks
Here My Config :
Windows XP PRO SP2
Wamp 2.0
Aptana 2.0.4
RubyGems 1.3.5
Ruby 1.8.6
Hi, I am working on creating a daemon in Ruby using the daemons gem. I want to add output from the daemon into a log file. So I am wondering what is the easiest way to redirect puts from the console to a log file?
// using Rails 2.3.5
//routes.rb
map.resources :users,
>> user = User.first
>> helper.link_to user.name, user
I am getting nil error. I thought the above code should work. What am I missing?
I am in the process of creating a Rubyonrails portal
This portal requires a lot of data feeding by the site owner's back-office personnel.
My client has this problem :
the office staff should not be able to access the back office interface from any other than his office computers
I have no idea how to achieve this. Is there a method for this?
Thanks in advance.
Hi all,
I am looking to automate the changing of passwords across multiple services and servers. For example: I want to change the root paassword to all of my web servers at once. I am thinking of writing a ruby script, but have you guys run across anything already written?
If so, would that also give me the ability to change other system passwords like Database passwords and SVN passwords.
How can I make a helper that will tell me how many weeks ago (rounded down) with rails? It could be based of the time_ago_in_words helper however I'd want it to return: "last week" then afterwards just two weeks ago, three weeks ago, etc...
I've been following Ryan Bates' Railscasts tutorial on CarrierWave, which you can find here
Everything works fine, except for when I go to view my profile, it gives me this error:
undefined local variable or method `user'
I don't know why it is telling me this, as I am using Devise for my authentication, and that is the name of my model.
Below are some of the files which may be useful:
https://gist.github.com/amarh21/7439421
I am using Rails 4.0.1 and ruby 2.0.0
Hi
I am am running some selenium tests(ruby) on my web page and as i enter an invalid characters in to a text box i have the JavaScript throw a alert like so
if(isNaN($(this).val()) || Number($(this).val().valueOf() <=0)){
alert("Please Enter A Number");
}
how can i handle this alert when its made and close the pop up?
i tried to use the wait_for_pop_up() and close() but i think that's only for browser pop up's and not JavaScript alerts.
any ideas?
thanks
I have a rails website on www.xyz.com. After I log in to www.xyz.com, if if move to xyz.com, I need to log in again, ie the session is not maintained.
How to make www.xyz.com and xyz.com use the same session.
Hi,
I have a rails app with authlogic and LDAP, but my problem is i can see all the users password on the log file, is there something to fix to encrypt those passwords.
For ldap i use :encryption simple_TLS
Thanks for your help
I'm setting up a Linux development environment. After installing Ruby and RubyGems, I quickly found out that I need to require 'rubygems' in order to use gems, whereas I do not need to do this in Windows Vista. Is there anything I can do to fix this? Should I even be worrying about it?
i'm an absolute newbie to webapps, so please forgive if my question is quite naive or not upto the mark.i have been assigned a task to develop a web app which integrates the twitter pull request with another application using the particular application APIs.basically i dont know what it means.Can anyone explain what is intended to be done and if there is any example of such web apps if any,it will be most appreciated, so that i can get an idea of what is to be actually done.i'm planning to do this using ruby