Hi there
I'm fairly new to Rails and the Mac, and doing my first deploy...
I'm trying to set up my rails app on a brand new Apple mini-server running OXS1.6 (Snow Leopard). It is currently running fine on my new iMac i7 (same OS).
I start mongrel with this command:
mongrel_rails start -e production -p 3000 -d -a 127.0.0.1 --debug
A...
I have gotten a great deal of help from KandadaBoggu on my last question and very very thankful for that. As we were getting buried in the comments I wanted to break this part out.
I am attempting to create a tag feature on the rails blog I am developing. The relationship is Post has_many :tags and Tag belongs_to :post. Adding and dele...
I'd like to develop a number of non-trivial Rails applications which all implement a core set of functionality but each have certain particular customizations, extensions, and aesthetic differences. How can I pull the core functionality (models, controllers, helpers, support classes, tests) common to all these systems out in such a way t...
Whats wrong with this picture?
Model:
validates_acceptance_of :terms_of_service, :on => :create, :accept => true, :allow_nil => false
accessor :terms_of_service
View:
<%= check_box :organisation,'terms_of_service', {:style => "margin-left:0px"}, 1, 0 %>
And in the DB I have organisations.terms_of_service.
Every time I get "Terms ...
I've recently convinced my management that our outdated version of Rails (1.2.4) is slowing us down enough to warrant an upgrade. The approach we're taking is to start a fresh project with current technology rather than a painful upgrade. Our requirements for the project have changed and this will be much easier.
The biggest problem is ...
I just installed the gem for will_paginate and it says that it was installed successfully. I followed all the instructions listed with the plugin and I am getting an 'undefined method `paginate' for' error. Can't find much in the way of Google search and haven't been able to fix it myself (obviously). Here is the code:
PostsController
...
The cucumber test first makes an entry in the database and posts a form to a second server. This second server does some processing in background and then hits the first app (where the test is being run) with some data that the cucumber test needs to know about.
I've tried running the main server via script/server and script/server -e ...
I'm currently writing a Rails app, and hit a somewhat strange quirk. I have a controller PermissionsController, which is mainly for display purposes at the moment. So my routing is locked down:
map.resources :permissions, :only => [:index, :show]
Unfortunately, when writing the tests, one of the routing tests fails:
it "does not reco...
I'm using Ym4r and want to add a polyline to my map.
This works:
polyline = GPolyline.new([[27.4037755983,89.4263076782],[27.5155793659,89.3245124817]],"#ff0000",3,1.0)
@map.record_init @map.add_overlay(polyline)
But this doesn't:
polystring = "[27.4037755983,89.4263076782],[27.5155793659,89.3245124817]"
polyline = GPolyline.new([po...
Hi,
I use prototype since a long time, but for some reason I have to switch to Jquery.
I need to build a layout with resizable parts, I found http://layout.jquery-dev.net/
But I don't like the code generated, inline css is ugly.
Do you know any clean alternative? Jquery, Rails plugin or anything else
Cheers
...
Does Ruby (or Rails) provide an easy way to accomplish the following:
if @author.articles.each(:published == true)
puts "all articles of this author are published"
end
I think the example speaks for itself.
...
I have a drop-down box that I want to submit data, onchange.
Previously I used:
select_tag name, options_for_select(pairing_options, :selected => 'Y'),
{ :onchange =>
remote_function(
:url => {
:action => 'pair',
:escape => 'false',
:update_grid_item => update_p...
I've been searching on how to solve this issue but could not find any real and working solution.
User model:
validates_attachment_content_type :avatar, :content_type => ['image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png', 'image/gif']
Unnecessary error shows up when invalid file type is uploaded:
Avatar /tmp/sample,23283,0.txt ...
Hi,
Is it possible to cover my controller, that is highly depeinding on Etags with unit tests?
Here's what i'm trying to do:
in case if page is not stale (meaning that it's fresh), i'm adding some header to response.
When i'm trying to test it all (rspec), no matter how many similar requests i have, i still receive 200 OK instead of ...
I am building a ruby on rails project. it is a portal. I have a situation as follows:
the user browses around. Suddenly he gets a doubt.
I want to keep a small text box and a button that says "call me".
To clarify the doubt the user can enter his phone number in the "call me" box.
now the back office personnel should get an alert or ...
Say I've a user model and there are bunch of user info, like email, birthdate, location, telephone number etc.
What's the simplest way of hiding the attributes that are blank?
I've doing something like
<% if blog.title.empty? -%>
<p>Body: <%=h blog.body %></p>
<p>Comments: <%=h blog.comments %></p>
<% elsif blog.body.empty? %>
<p...
I created a controller and a model. The controller is called "Admin" and the model is called "Album". I edited database.yml with proper info and did the rake db:migrate command which didn't return any errors and did migrate the db inside schema.rb. Inside the controller I wrote:
class AdminController < ApplicationController
scaffold ...
Hi,
I have a teacher profile model which has many subjects (separate model). I want to add subjects to the profile on the same form for creating/editing a profile. I'm using accepts_nested_attributes for and this works fine for creation. However on the edit page I am getting a very strange error - instead of seeing 3 subjects (I added t...
Is there any trivial way to copy the data from developmenet database into the test one? I know theres a way to copy schema and recreate database, but is there any rake task to populate test database with development one?
...
I'm building an app that uses subdomains as account handles (myaccount.domain.com) and I have my sessions configured to work across the sub-domains like so:
config.action_controller.session = {:domain => '.domain.com'}
In addition to the subdomain a user can input a real domain name when they are creating their account. My Nginx conf...