So any time i hit enter and go to a new line... radrails automatically gives me two tabs over. I'd rather turn this off. I haven't been able to figure out how in the settings.
Ideas? thoughts?
is 2 tabs preferred for a specific reason?
...
Hello!
I'm trying to have an image that when clicked associates the selected guideline to a project. I'm using link_to_function which somewhat behaves but I can not get the method I am calling in the link_to_function to redirect to another page. Is there a better way to do this? Below is a bit of my code. I can paste in additional parts ...
I have this:
class User < ActiveRecord::Base
has_many :serials
has_many :sites, :through => :series
end
class Serial < ActiveRecord::Base
belongs_to :user
belongs_to :site
has_many :episodes
end
class Site < ActiveRecord::Base
has_many :serials
has_many :users, :through => :serials
end
class Episode < ActiveRecord::Base...
So I am creating a website that I want to have an admin directory in rails 1.8.x and I'm struggling a bit to get the form_for to link to the right controller. I am trying to be RESTful. What I basically want is an admin page that has a summary of actions which can then administer sub models such as:
/admin (a summary of events)
/admin/s...
I'm having an issue getting authorize.net to run credit card transactions from my rails app.
Here is what is in my environment.rb
if ENV['RAILS_ENV'] != 'production'
::GATEWAY = gateway = ActiveMerchant::Billing::Base.gateway(:authorize_net).new(
:login => "scrubbed",
:password => "scrubbed")
else
::GATEWAY = ga...
I'd line to create some kind of undo in my rails app, that's based on an sqlite3 database.
For now, a database wide undo would suffice, I mean an undo that can return back in time through states of the whole database, not single tables (for avoiding problems with references etc..)
I found vestal_versions, but it's table level and a bit ...
I'm trying to get IronRuby on Rails running with iis7 server 2k8 and can only get as far as it cannot load the assembly 'IronRuby.Rack' (Screen Shot: http://grab.by/3VZm) has anyone gotten this working? Any tips you can give me?
Thanks,
-CJ
...
I have a document with dynamic image and dynamic text and would like the text around the image. The image is right aligned on the landscape page. Here is what I have so far:
pdf.bounding_box([0,pdf.bounds.top - 50], :width => pdf.bounds.width, :height => pdf.bounds.height-50) do
pdf.text @article.title, :size => 30, :style => :bold
...
Alright all you little geniuses you.. please help. :D
I have written a Capistrano recipe to remove the all.js cached javascript file and tell the server to restart, but it still doesn't work right. And inevitably I have to go, manually delete the all.js file and then manually restart apache. (touching restart.txt doesn't always work)
A...
I'm looking to convert single digit numbers to two-digit numbers like so:
9 ==> 09
5 ==> 05
12 == 12
4 ==> 04
I figure I could put a bunch of if-else statements (if number is under 10, then do a gsub) but figure that's horrible coding. I know Rails has number_with_precision but I see that it only applies to decimal numbers. Any ideas ...
I have some simple lists and bold/italic text to format with prawn. How do I get prawn to pay attention to the html tags instead of just displaying them explicitly.
If prawn can't do this, what are my other options?
...
ruby-1.8.7-p249 > xml = Builder::XmlMarkup.new
=> <inspect/>
ruby-1.8.7-p249 > xml.foo '<b>wow</b>'
=> "<inspect/><foo><b>wow</b></foo>"
ruby-1.8.7-p249 >
Builder is escaping the content and is converting the b tag into an escaped value. How do I tell Builder to not escape it? I am using Ruby 1.8.7.
...
Now I know how to build xml without escaping values. http://stackoverflow.com/questions/2693036/how-to-tell-bulider-to-not-to-escape-values
However I need to build tags dynamically.
Desired result
<bank_info>Chase</bank_info>
What I have is
attr = 'bank_info'
builder = Builder::XmlMarkup.new
builder.attr { |x| x << 'bank_info' } #...
Hi,
My rails application requires few values to be specified in the text box.
My web page contains few text boxes .How can i specify the values of these text boxes in the url as query string while using webrick?can any one help, am new to this.
Thanks in advance.
...
Hi,
I was following this tutorial from capistrano:
http://www.capify.org/index.php/From_The_Beginning#Spinners_and_Spawners
But at a certain point, I couldn't go on because I don't have a script/spawner file. So, what can I do instead?
Thanks in advance
...
which database should I use, if my application is going to be in multiple languages (including Chinese, Japanese etc)? In other words, is MySQL better or worse than Postgres to handle unicode etc? (these are the only two databases my hosting company has)
Also, which language is better for handling unicode? PHP or Ruby/Rails?
...
I'm making a forum application with various levels of authorization, one of which is a Monitor. I am doing this by extending my User class, and I plan on fine tuning this with "-ship" classes (e.g. administratorship, authorship, moderatorship, etc.). Apparently the Monitor class is part of ruby mixin. How do I keep my resource name wi...
Having trouble with AR 2.3.5, e.g.:
users = User.all( :select => "u.id, c.user_id", :from => "users u, connections c",
:conditions => ... )
Returns, e.g.:
=> [#<User id: 1000>]
>> users.first.attributes
=> {"id"=>1000, "user_id"=>"1000"}
Note that AR returns the id of the model searched as numeric but the selected user_id of...
When I run a cucumber test it executes the code thinking that a collection obtained inside of a controller via a has_many relationship on a model is empty when it isn't. I ran this same test but with the debugger turned on and a breakpoint before the collection is used. When I print collection in the debugger at this breakpoint the colle...
After deploying DelayedJob as a gem, I got the following error:
undefined method `handle_asynchronously' for #<Class:0x4601b08>
Same code works when I deploy DelayedJob as a plugin.
I have tried the solution suggested by this SO question and I still get the same error.
I am using DelayedJob 1.8.4, Windows XP, Rails 2.3.5.
...