In my Rails app, I have a lot of data that is declared as text in the migration file. But when I print these attributes/fields out in the view, all the line breaks are lost and I get one large chunk of text. How do I maintain the line breaks?
...
Hi there.
I'm still new to rails and testing with rspec, so hopefully you can help me.
I have a controller which requires login. I use the restful authentication function of rails.
To create things in tests I'm using the factory framework factorygirl.
Ok the problem is the following:
I want to test a controller (authentication requ...
Before I asked this question I had a look through the search results for 'Ruby on Rails' here on SO. Couldn't find much, but the following (found on this page) amused me
Personally, I started using .html, moved onto php, tried ruby (hated it), discovered Python / DJango.. and have been happy ever since.
Now here's the deal. I have ...
For a new SaaS app that I'm working on, I want the end user to be able to create "promotions" which they can send to their customers; they will be able to do this via direct (snail) mail, e-mail, or SMS text message.
Typically these promotions will be HTML email messages with lots of pretty graphics and whatnot. I don't expect my use...
Test
def test_generateCashFlowStmt
get :getDateRangeForCashFlowStmt
xhr :post,
:generate_cash_flow_stmt,
{:fromDate => {:year=>"2009", :month => "3", :day=>"1"},
:toDate => {:year=>"2009", :month => "3", :day=>"31"} }
table = [ .... ]
assert_equal table, formatCashFlowStatementAsTable( assigns(...
Here's my situation: I'm an ASP.NET Developer first and foremost. That's not going to change anytime soon. I have built my small business on it. With that being said, I'm looking to add other technologies to my arsenal. Not just for learning purposes, but to one day be able to offer clients an alternative solution. For this reason, ...
I tried getting these frameworks working on Windows Vista for a couple of days but to no avail.
Every single time I thought I had them working I would get some random error involving the PostgreSQL or MySQL setup, or the paths were screwed up or some other command line error "not recognized as an internal or external command" (or somet...
I want to make a megadrop down like the one used in Rails gudes site (http://guides.rubyonrails.org/) or the ones used in BaseCamp.CAn they be done using the Rails form helpers??
...
We am using authlogic for my user authentication.It works on other machines but i am getting the error
Extracted source (around line #20):
7: <%= link_to "Home", "/", :title => 'Home', :class => 'header-logo' %>
18:
19:
20: <span style="padding-left:850px;"> <% if current_user %>
21: <%= link_to "My Accoun...
the following is my dropdown to select chat rooms:
<% form_for :chat_room do |form| %>
<%= form.select(:title, @chat_rooms.collect! {|x| x.title},{:include_blank =>'select a chat room'}) %>
<% end %>
My routes are:
ActionController::Routing::Routes.draw do |map|
map.resource :account, :controller => "users"
map...
I'm using AASM by Rubyist to build a 4-step wizard for an AR object. According to the state of the object, there are different validations that need to be done. What is the smartest way to validate an object according to it's state on a certain transition?
...
What message queues are people using for their Rails apps and what was the driving force behind the decision to choose it. Does the latest Twitter publicity over their in house queue Starling falling down affect any existing design decisions.
I am working on an app that will need a message queue to process some background tasks, I haven...
Have you ever had to connect to SQL Server with ActiveRecord? Is this possible? Can anyone provide some starting points?
...
This is a really weird Rails problem - I have googled to see if this is related to a known bug, but haven't found anything - would be gratfeul for useful links as well as solutions.
I can boil the problem down to this:
If I start up my Rails App, and execute the following Rails code via an HTTP request.
Time.zone = 'Europe/London'
log...
Hi,
I have this:
SectionHistory.find(:all, :conditions => ["id=? and (name!=? or code!=?)", sec.id, sec.name, sec.code])
And I get the error "The character "!" following "and (name!=? or code" is not valid"
if my condition string is just "id=? and (name!=?)" it's OK
We're using DB2.
Any suggestions on this?
Thanks
...
I'm setting up a SaaS style website wherein I will have multiple clients all managing their workflows and data on the same site -- and thus the same database.
I'm not even sure if there is a word for this concept, but is there any established way of auto-segregating the data so that any ActiveRecord calls to the database are filtered/re...
I'm creating some gems that can be used within Rails controllers and views. I'd like to be able to test the gems independently. But I've not been able to figure out how to create an instance of Rails inside the gem to test that the gem will work inside a Rails app.
I strongly prefer to use RSpec, but could probably adapt a Test::Unit so...
I'm new to VB .NET, and if possible, I'd like something like Rails partials - bits of HTML template that can be referenced in a page's script, possibly within a loop. I know there might not be anything like that.
...
I am looking for a suggestion on the best way of having an end user from a Rails application's view files set the sort order of a result set returned by a model's "find" method. In other words I would like a user to be able to choose their sort order from a selection list.
Initially, I thought I could just put the string that I would p...
My application is in RoR
I have an action/view called showsummary where the ID has been passed into the URL, and the controller has used that to instantiate @vendor where @vendor.name is the name of a company.
I would like the URL to be, rather than showsummary/1/ to have /vendor-name in the URL instead.
How do I do that?
...