It seems my rspec route for :controller => 'phones', :action => 'edit' works...it should be 'phones/123/edit', and IS according to rspec tests and rake routes. But when I create a redirect_to expectation, the expectation fails.
Here's the routes test for the url:
it "maps #edit" do
route_for(:controller => "phones", :action ...
Hello,
does anybody know, where I can find the Google Calendars Event-GUI?
I'm building an social networking site, which relies on google calendar.
For adding and changing events, I want to use googles GUI (i dont want to code this myself if there is a partial/control already existing).
Does anybody know where I can find this?
...
Does it make any difference in terms of developing Rails apps now that it uses rack to talk to web servers? Should we do anything differently to take advantage of it? Is it just cleaner or does it have any performance improvement over the cgi implementation?
...
I was looking through the Datamapper directories and opened up dm-core/tasks/dm.rb. Just generally speaking, what the heck is going on in this file? It looks like Greek to me. Particularly this thing about "specs" - what are those for? Is that similar to a software spec which defines what a project is supposed to encompass?
require 'spe...
I'm building a generator in rails that generates a frontend and admin controller then adds the routes to the routes file. I can get the frontend working with this:
m.route_resources controller_file_name
but I can't figure out how to do the same for the nested admin route (admin/controller_file_name). Anyone know how to generate these ...
I have a Character model and a Link model. The Link model represents a link from a character to another character. A link has a textual 'description' attribute. A link from character A to character B is distinct from the opposite link from B to A. A character has zero or one link to another character. A character may have various links t...
hi,
i'm new to ruby on rails and am working with version 2.3 on mac osx.
i am trying to create the same functionality a scaffold creates, but on my own.
i created a "post" controller, view, and model.
in post controller, i have the following:
class PostController < ApplicationController
def index
end
def new
@post = Post.new
...
Hi,
Is there a way to specify email AND name for sender and recipient info when using ActionMailer?
Typically you'd do:
@recipients = "#{user.email}"
@from = "[email protected]"
@subject = "Hi"
@content_type = "text/html"
But, I want to specify name as well-- MyCompany <[email protected]>, John Doe <john.doe@myco...
Before the switch and in all apps on this passenger that run rails 2.0
my routes would yield "myapp/controller/action"
Now they yield "controller/action". Interestingly the stylesheet_link_tags do work as normal.
I prepend a prefix in the production environment to deal with this but it is a hideous hack of course.
Any help is appreci...
Just wondering if anyone has experience with the three. I have used read through some RoR and used Django. They seem fairly easy to use. Is lift "easy" like these two are? I know easy is subjective and has no context here. I mean in a very high level and general sense.
...
hello,
i am working in rails 2.3 on mac osx leopard.
every time i type a url that does not exist in a rails application i get the following error
Routing Error
No route matches "/whatever_i_typed" with {:method=>:get}
this is find for development, but i was wondering how i can make sure users see a friendlier 'oops! not found' page. ...
I want to a list of emails in a text file outside of my repository and doc root in ROR. But I need the application to write to it. What is the best way to accomplish this? My guess is a sym link but I'm not sure.
I am also curious about where I should keep this text file. It is a list of emails to invite people to use my service.
Th...
When rails serializes an object to store in the database it uses YAML. I want to also use
Base64 encoding/decoding when doing this so the YAML will be much more compact on INSERT and UPDATE statements. The objects I am serializing are rather large, and Base64 encoding is reducing my insert and update statement times by 70%.
I've been cr...
Let's say I have Book model and an Author model. I want to list all authors sorted by their book count. What's the best way to do that?
I know how to do this in SQL, either by doing where .. in with a nested select or with some join. But what I'd like to know is how to do this nicely with ActiveRecord.
...
I consider myself as an entrepreneur with basic programming skills. My main experience is with PHP, but mostly as a code breaker- meaning being able to figure out the basics and manipulate the code to my needs. Recently took up studying RoR and it seems easy to understand.
I will be putting together some resources to build a niche socia...
What specific piece of advice could have saved you from going down the wrong track, saved you lots of rework or just helped you generally?
...
I need to have a setup and teardown method for some Rails tests that is class or system wide, yet I have only found a way to define a regular setup/teardown that works on a per test level.
For example:
class ActiveSupport::TestCase
setup do
puts "Setting up"
end
teardown do
puts "tearing down"
end
end
will execute th...
How do I turn this into a has_one association?
(Possibly has_one + a named scope for size.)
class User < ActiveRecord::Base
has_many :assets, :foreign_key => 'creator_id'
def avatar_asset size = :thumb
# The LIKE is because it might be a .jpg, .png, or .gif.
# More efficient methods that can handle that are OK. ;)
se...
Hi,
How can I get hold of the matching route for a url in rails? Given a url, I want to query the respective controller and action. Note, the current page isn't the url in question.
This question has been posed before but wasn't answered.
Cheers.
...
Hi,
I'm exploring Sinatra and I want to use sessions but I don't want them to be stored in a Cookie, I found Rack::Session::Pool which works very well.
Now I want sessions to expire after a certain duration but I don't understand how to instanciate the Rack::Session::Pool and them use it in Sinatra.
Any Clue ?
...