I have an Entry model which has_many :tags. I want to be able to list my tags in an text input (ie. "tag-1, tag-2", etc.), however, I am running into an issue.
If I just use
form_for(:entry, form_options) do |f|
f.text_field :tags
end
My text box gets created, but is filled with something like #<Tag:0xb79fb584>#<Tag:0xb79faddc>, w...
Is there any way of publishing the parameters expected by the RESTful methods in Ruby on Rails? Using SOAP, we can use WSDL, but does RoR implement WADL or WSDL 2.0 for RESTful services?
Edit: I am aware of a SOAP based solution using ActionWebService. I was refering to a RoR equivalent of https://wadl.dev.java.net/
...
I'm a Ruby on Rails / PHP guy, and my company got me to work with ASP.NET. It's not too bad, I'm glad to learn a new language but since I started working with this technology everyone is bothering me about Repeaters.
The thing is that I totally fail of seeing the point: what make using a repeater better than just displaying things in a ...
I'm experiencing something that I can't explain with Rails 2.3.2. I've created a new app, with one controller and one action to try narrowing this down. My entire controller is as follows.
class LinesController < ApplicationController
def show
respond_to do |format|
format.html { render :text => proc {|response, output|
...
I'm having a very strange issue with a freshly deployed Rails app on a staging server. Up until this point all development has been done locally. I just setup the staging server and pushed the code to the staging server today, and have been getting strange errors that I can't seem to track down.
My server is a debian Lenny box and I'm...
I have written a method to calculate a given percentile for a set of numbers for use in an application I am building. Typically the user needs to know the 25th percentile of a given set of numbers and the 75th percentile.
My method is as follows:
def calculate_percentile(array,percentile)
#get number of items in array
return nil i...
I have a many_to_many relationship between ImageShells and Users. I need to find all ImageShells that have no users.
I have a query that finds them but how do I put this into a named_scope?
SELECT * FROM image_shells INNER JOIN image_shells_users ON (image_shells_users.image_shell_id!=image_shells.id)
class ImageShell < ActiveRec...
I frequently have some code that should be run either on a schedule or as a background process with some parameters. The common element is that they are run outside the dispatch process, but need access to the Rails environment (and possibly the parameters passed in).
What's a good way to organize this and why? If you like to use a part...
I am attempting to connect to Bing Maps SDK through a RoR application. My goal is to calculate driving distance between two locations after geocoding them. I am new to SOAP and ROR so I may be making a simple mistake.
Two days of Googling (Binging?) and I'm coming up short. Here is what I am doing:
Environment
Ruby 1.8.7 on Windo...
(Sorry if a newb question...I've done quite a bit of research, honestly...)
I'm writing some Ruby on Rails code to parse RSS/ATOM feeds. My code is throwing-up on on a pesky '£' symbol.
I've been trying the approach of normalizing the description and title fields of the feeds before doing anything else:
descr = self.description.mb_ch...
Hello,
I'm looking for a rails plugin/gem which brings the functionality of marking an ActiveRecord-Model deleted, instead of deleteing it.
Does anybody know, what gems or plugins are up to date? (AAP is out-dated and is_paranoid doesn't appear to be used by the community).
Do you know alternatives?
...
I need to produce somewhat complicated PDFs from a Rails app - tables with column spans, styling, nested tables etc
I've looked at Prawn and I'm not sure it provides enough flexibility and HTMLDOC seems to be severely lacking in CSS support,
are there any other options out there?
thanks,
john.
...
I have a simple contact form with Subject and Message that I want to validate to prevent blank e-mails.
ActionMailer doesn't support validation. Where should I put it (i.e. in a separated model or directly in controller)?
UPDATE: what is the best way to implement validation in a non ActiveRecord model?
...
How does one find out which controller or which action they are in from an erb template in Rails?
...
Hello,
does anyone know how to prevent the failing mechanism of link_to_unless_current?
f.e.: I have my page navigation with
link_to_unless_current "new task", new_task_path
When I click on the link, i come to the new taks path form... And no link is created -> ok.
Then I put incorrect values in the form and submit.
The TasksCont...
Hello,
I'm new to Ruby and recently ran into an issue comparing to values when creating a Ruby on Rails application. In a controller I had the following statement that always returned false:
if (user.id != params[:id])
The problem was the user.id (which is an Active Record) is an integer and params[:id] is a string. It took me a wh...
For single table inheritance, how do you force Rails to use an integer column for the 'type' column instead of string?
...
I would like to create a migration to add test data to other developer's environments using the data that I have manually added to my own test environment over the past month or so. Is there a good plugin or gem to do this quickly? I started trying to create one manually yesterday and wanted to claw my eyes out after about 10 minutes, so...
Hi!
How do people generate auto_incrementing integers for a particular user in a typical saas application?
For example, the invoice numbers for all the invoices for a particular user should be auto_incrementing and start from 1. The rails id field can't be used in this case, as it's shared amongst all the users.
Off the top of my head...
I think I'm approaching this the wrong way, which is why I can't seem to figure out an easy solution. I'm relatively new to Rails, so bear with me.
I have a layout, "store," that contains all of the common visual elements for the other controllers. In this layout, I need to dynamically create the sidebar with data from two models, Produ...