SWFUpload with rails
Hey. I try to use SWFUpload Javascript/Flash library for uploading files in my Rails (RoR) app. Upload works with standard form but with SWFUpload I get "HTTP Status: 422" error code. Can someone tell me how to fix that? ...
Hey. I try to use SWFUpload Javascript/Flash library for uploading files in my Rails (RoR) app. Upload works with standard form but with SWFUpload I get "HTTP Status: 422" error code. Can someone tell me how to fix that? ...
Hi all, I'm getting some interesting results in a migration (Rails 2.3.5) class Comment < ActiveRecord::Base .. belongs_to :item, :counter_cache => "comment_counter_cache" .. end Migration: change_column :items, :comment_counter_cache, :integer, :default => 0 Item.find(:all).each do |item| item.update_attribute...
I'm new to using AJAX in Rails (I know... I know...), and am positive that I'm doing something wrong that's probably just the wrong call or something. But I've hunted and can't seem to find it. Anyway, I'm rendering out quick partial (this is working right) and then I want to refresh it with an AJAX call. Here's what I thought would wo...
I have a good half-dozen fixtures in my Rails test suite - some quite large - that represent static look-up tables in the database. Since their values theoretically don't change, I'd like to save the time of wiping and reloading the tables between each test. Is there a trick/plug-in/gem/hack to demarcate these fixtures as only needing ...
Hi , I have mailer action in my application, the mailer is configured with gmail smtp. The following is my config details under environment.rb file require "smtp_tls" ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.perform_deliveries = true ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.default_charset...
Hi, I have some URLs, like http://www.example.com/something?param1=value1&param2=value2&param3=value3, and I would like to extract the parameters from these URLs and get them in a Hash. Obviously, I could use regular expressions, but I was just wondering if there was easier ways to do that with Ruby or Rails. I haven't found an...
please help me with pagination of this method my method is this one controller # def show @topic = Topic.find(params[:id]) @posts = @topic.posts.find(:all ,:order=> 'id') end views # %div{:style=>"margin: 0 auto;"} %table.sortable.style2{:cellpadding=>5} %thead %tr %td{:width => "25%",:align => "center"...
So I know how to override the default getters for attributes of an ActiveRecord object using def custom_getter return self[:custom_getter] || some_default_value end I'm trying to achieve the same thing however for a belongs to association. For instance. class Foo < AR belongs_to :bar def bar return self[:bar] || Bar.last ...
Hello, I'm trying to convert an ActiveRecord model to JSON in Rails, and while the to_json method generally works, the model's virtual attributes are not included. Is there a way within Rails to list not just the attributes of a model, but also it's attr_accessor and attr_reader attributes in order that all readable attributes are avail...
Imagine the following use case: You have a basecamp style application hosting files with S3. Accounts all have their own files, but stored on S3. How, therefore, would a developer go about securing files so users of account 1, couldn't somehow get to files of account 2? We're talking Rails if that's a help. ...
I'm developing a new gem (fork of nifty-generators). Right now my "deployment" consists on the following: I make changes on the gem's source code I commit to github I update the gemspec lower numer (i.e. go from 0.1.1 to 0.1.2) Build the gem and push it to gemcutter (gem build, gem push) Install the new gem (sudo gem install mygem) Th...
i'm looking for a rails plugin for open id authentication. I'm using restful-authentication Can you tip me any plugin? Do you know any tutorials for using these plugins? thanks ...
I'm using a date_select with the option :discard_year => true If a user selects a date in the date select, and then he comes back and returns the select to the prompt values of Month and Day, Rails automatically sets the select values to January 1. I know this is the intended functionality if a month is selected and a day is left bla...
I would like to allow users to call my ruby on rails app as a service which returns a 'div' with html content in it, and embed that div into their app (which will not be a rails application). For example, assume someone has their own php website that has a header/footer template that gets rendered, and a content area of the page that ...
Really neat how FB grabs meta-data from a link you type in the update status box, including thumbnails, etc. Is this something I should write from scratch in Jquery, or are there pre-built solutions that would help me here? ...
Hi guys, I have a program where a gem, facebooker, calls a redirect and in the same action I end up callling a redirect through redirect_back_or_default. My question is: Is there a way to catch the multiple redirect error? A begin/rescue block doesn't seem to do it. Or, is there a way to check to see if a redirect has already been c...
Hi all, How can I set my rails application with custom timezone? I want to set my application timezone with UTC-04:00 without daylight saving. update: To clarify my question, I understand that I can set the time zone name in the environment.rb file with one of the names from TimeZone constants. I want my application timezone as UTC ...
Hi! First of, im a newbie ruby programmer so please bare with me if this is a very dumb question. I get this uninitialized constant error when i submit my nested forms. order.rb class Order < ActiveRecord::Base has_many :items, :dependent => :destroy has_many :types, :through => :items accepts_nested_attributes_for :items ac...
Hi I am not sure why I am having this problem, maybe I am using the check_box_tag incorrectly. I have a form that is used to send an email message. You are supposed to be able to choose one or more boxes that represent different groups of people. <%= check_box_tag (:bcc_email, value = @spouses) %> <%= f.label :bcc_email, "Company Spou...
When someone installs this plugin, I would like a file to be copied into the config/initializers directory of the app. I could do this in install.rb by copying a template file that resides somewhere in the plugin. Another option would be to require the user to run a generator after install. I know rspec-rails makes you run a generator...