Hi Guys. I want to generate QR codes in ruby on rails, to run in the background of my website written in rails. Saw this http://code.google.com/p/qrcode-rails/ but cannot work out how I could get this to work for me. Basically in RoR I want to:
Pass a generator a string, my unique code, a 20 character length number (e.g. 320329288899988...
I'm going through Ruby on Rails Up and Running by O'Reilly and have run into a question that I'm not sure where to go to for help.
I'm at the part in the book where I'm creating new objects from the console and then saving them to the database. I've already created the database (MySQL), run the migration and finally verified that rails...
I'm pretty new to Rails 3, and I'm trying to make an RSS/Atom feed. I know about auto_discovery_link_tag, but what is the associated controller/action supposed to look like?
Thanks!
...
Trying to migrate a sqlite3 db for a rails app to mysql db. The column named "content" was a string type in sqlite3. I want to change it to varchar (or perhaps text) in mysql. I am not sure if there is a way to do this by using "ruby script/generate" command. Any ideas? Obviously, I could start all over again with desired column types...
Why are some rake tasks not listed by rake -T? Like db:migrate:reset? I can execute it without a problem, but why is it not listed there? Is there a way to get a real full list of rake tasks?
% rake -T
(in /home/zeus/projects/my_project)
rake about # List versions of all Rails frameworks and the environment
rake db:create ...
I'm developing a facebook app which can be viewed in an iframe on Facebook itself, or as a standalone site (the line between Facebook Connect and iframe apps seems to have blurred...).
The stylesheet I have now looks good on my site, but doesn't look right when viewed through the FB iframe (probably b/c the browser screen is much bigger...
I am learning Rails and I have noticed that Rails continously uses helper method such as link_to instead of just using plain html. Now I can understand why they would use they would use some helper methods, but I don't understand why they would prefer helper methods over just coding the html directly. Why does Rails prefer helper method ...
There is a Rails application I started a full year ago. It’s a Rails 2.3 app.
Now, someone else has made remote changes (it’s on Github, sorry, but it’s private). And I have done
sudo gem update
that is, updated all my gems, including Rails (to 3).
Realizing this, I have done
rake:freeze:edge RELEASE=2.3.8
or whatever to make th...
I'm using the rails gem: OmniAuth to login users.
When using an OpenId provider I would like to get certain field, like email and nickname but I don't see any documentation on this.
Any ideas?
thanks
...
I swear this was working a few weeks ago but I keep getting "coerce must return [x, y]" when I use the rturk gem to create a hit.
RTurk.setup(configatron.amazon.access_key_id, configatron.amazon.secret_access_key, :sandbox => true)
hit = RTurk::Hit.create(:title => "SOMETESTTHING" ) do |hit|
hit.assignments = 5
hit.description = "FOO...
I am using Devise for authenticating a Rails application. I am now able to successfully route /users/sign_in and /users/sign_out to /sign_in and /sign_out via this code in routes.rb:
devise_for :user, :as => ''
How do I map /registration/sign_up to /sign_up?
So that sign_in, sign_out, and sign_up all have the same pattern.
Note that...
I am following the guide on railstutorial.org. I get this error when I type the command on the title.
Counting objects: 66, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (52/52), done.
Writing objects: 100% (66/66), 86.47 KiB, done.
Total 66 (delta 3), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ra...
In the Rails ActiveRecord Associations guide, I'm confused over why the tables for has_one and has_many are identical:
Example tables for has_many:
customers(id,name)
orders(id,customer_id,order_date)
Example tables for has_one:
these tables will, at the database level, also allow a supplier to have many accounts, but we just want on...
I have a few queries for you Rails 3 gurus out there. How can you accomplish the following?
The following pseudocode is currently invalid. Thanks all.
@items = (@itemsA + @itemsB).order("name ASC")
@item = Item.where("type = ?" and "condition = ?", "book", "new")
@commenteditems = Item.find_all_by_type_and_condition("book", "new").in...
Form validation with jQuery is as easy as adding a classname to a field. Form validation with rails is as easy as putting a condition in to your controller (and/or model).
I figure there should be a way to write the validations once and have them applied both client and server side. I've always been a fan of writing my own javascript,...
I have a User model and Posts model. I want to display the posts belonging to each user,
via a URL say http://localhost:3000/my_posts/1" but Rails is reporting error saying
that no matching route exits for
http://localhost:3000/my_posts/1.
Rails looks at the complete url : "http://localhost:3000/my_posts/1" as a route , but my
i...
I get this everytime I run: rails server
I get: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
I searched for a solution here and they said to type: chmod go-w /usr/local/bin
But I get this error: chmod: Unable to change file mode on /usr/local/bin: Operation not permitted
I am using OSX btw.
...
Suppose I have an Comment model that belongs_to a Post model.
I want to make it so that creation of a new Comment instance (whether by new, create, find_or_create_by_x, etc.) will fail (preferably raise an exception) unless the Post is set immediately (either by passing it in as a parameter or by always referencing the post when creatin...
I'm developing simple image sharing site to train my ruby-on-rails-fu. I have following resources in my config/routes.rb file.
resources :users do
resources :images
end
resources :images
Here's the problem I'm facing - how should I go about implementing functionality like "latest images" and "your image subscriptions"? Having vanil...
i found this "executed with no substitution back into the output" , but maybe my English wasn't too good , i cant really understand what it means. Can anyone help out?
...