Does Jammit require a JavaScript compressor on the production server?
Does Jammit require YUI Compressor or the Google Closure Compiler to be installed on the production server in order to work? ...
Does Jammit require YUI Compressor or the Google Closure Compiler to be installed on the production server in order to work? ...
I am somewhat of a Rails newbie so bear with me, I have most of the application figured out except for this one part. ...
I have a two-part somewhat noob question about form_for and nested resources. Let's say I'm writing a blog engine and I want to relate a comment to an article. I've defined a nested resource as follows: map.resources :articles do |articles| articles.resources :comments end The comment form is in the show.html.erb view for articles...
What's the more accepted Rails approach? Validate that a foreign key exists on creation/update or "Damage control" when we want to use the non-existent foreign key? Initial validation requires more resources on row creation/updating, and may even be redundant when I'm creating rows systematically in my code (i.e. not user generated)....
I'd like to make myself a nice little rails template to DRY up my development process. At the same time I'd like to use gem bundler. How would you go about doing this or do you consider them mutually exclusive? ...
Thanks in advance. Tried to provide as much detail as possible. Attempting to create a link that updates a boolean record in a database. Basically, someone can mark a gift as purchased without going a separate form. I've done this in the past with post and delete links without problems. :post not accepted by controller (only I get:...
I am using the following command: script/runner -e production ~/apps/application/current/vendor/gems/whenever-0.4.1/bin/whenever but I get the error: /usr/lib/ruby/1.8/optparse.rb:1445:in `complete': invalid option: -e (OptionParser::InvalidOption) from /usr/lib/ruby/1.8/optparse.rb:1443:in `catch' from /usr/lib/ruby/...
This is my source code def update @recipe = Recipe.find(params[:id]) respond_to do |format| if @recipe.update_attributes(params[:recipe]) format.html {redirect_to :action => "edit" } end end end I get an error on this line respond_to do |format| and the error message is "You have a nil object wh...
Hi, I am trying to tell ruby to not run a block of html and ruby if no active record exists in the database. Below is the code I was trying to run conditions on. <% if @statemant.comments.exists?() do %> <div id="comments"> <h2>Comments</h2> <%= render :partial => @statemant.comments %> </div> <% end %> ...
I'm working on an iPhone app and I need to figure out how to properly nest the information in the URL (really a POST body) in order for rails to recognize it as an object hash such as: Parameters: {:student => {:name => "Bob", :age => "13"}, :user_credentials=>"..."} I've tried the following two ways and neither work for me: /studen...
I am creating a proxy for a soap web service at runtime using soap4r. proxy = SOAP::WSDLDriverFactory.new("http://www.example.com/endpoint?wsdl).create_rpc_driver How do I execute a rpc with a object parameter? Any examples would be very helpful. Thanks. ...
I'm using SASS files in Rails development. And I wonder if I should gitignore generated CSS files. The problem with adding CSS files in Git is that they are simply redundant. SASS files at public/stylesheets/sass are the files I need. So I have the following lines in gitignore: # public/stylesheets/*.css But if I do this, when I pus...
this works: ids = [1,2] varietals = Varietal.find(:all, :conditions => [ "id IN (?)",ids]) But what I want to do is that plus have a condition of: deleted => false varietals = Varietal.find(:all, :conditions =>{ :deleted => false}) any ideas? am i going to have to use find_by_sql? ...
To avoid an accidental 'rake db:reset' on our production environments, I was thinking about disabling 'rake db:reset' and related tasks that drop the database in the production environment. Is there an easy way to do this, or do I have to redefine the rake task? Is there a better alternative? ...
I like how Rails gives me flexibility in naming view files, ie index.erb or index.html.erb essentially do the same thing. The problem is that I've merged two separate projects, where one uses filename.erb for all its views and the other uses filename.html.erb. It seems that Rails expects only one naming scheme as I keep getting missing...
I am not trying to test rake tasks. I have a test program which sends out emails ( real emails yes) to test email templates etc. class EmailTemplatesTest < ActiveSupport::TestCase context 'send_password_info' do setup do Emailtb.send_password_info(user) Rake::Task['email:run'].invoke # this actually delivers email ...
Is there any way to control the float format in a form field? I want to format a float like an integer if the modulus is 0, otherwise display the float as is. I overrode the Model accessor to do this formatting. When an edit form is loaded, I would like to have the following transformations: stored value | accessor returns | form fie...
I have a list of items with some details that I would like to reveal upon clicking a show/hide details link. after some experimenting, I've come across two issues. I'm having trouble making it so that the show/hide link only reveals the div of a specific item. right now, it is revealing all of the divs when clicking any of the show/h...
I decided to create a big social network application with Ruby on Rails. How many visitors can Rails take? Did I make a true choice or not? ...
Possible Duplicates: Uploading files in Ruby on Rails Uploading files in Rails Uploading Pictures Ruby on Rails I am doing a web site which allow users to upload images, is there any way to simplify the upload process? ...