similar to: DRY question (newbie)

Displaying 20 results from an estimated 1000 matches similar to: "DRY question (newbie)"

2006 Jul 28
5
DREAMHOST SO SLOW
Does anyone know of any fixes to this? Any industry-known tips/tricks? The page loads sometimes take 20-30 seconds. so bad. mk -- Posted via http://www.ruby-forum.com/.
2006 Jul 28
2
gem install (Errno::EACCES)
I am finding it impossible to install a gem, and even more impossible to find help. Can anyone PLEASE help? - - - - - - - - - Mason-Kessingers-Computer:~/Desktop/rails/pygmalion masonkessinger$ gem install login_generator Attempting local installation of ''login_generator'' Local gem file not found: login_generator*.gem Attempting remote installation of
2006 Jul 18
4
Multiple Layouts - Single Controller
How do I do multiple layouts for a single controller: I am aware I can do... render(:layout =>''mylayout'') for individual actions, however this becomes a multiple render problem. I tried this... layout "mylayout", :except => [:myaction, :myotheraction] layout "myotherlayout", :only => [:myaction, :myotheraction] However that doesn''t
2006 Apr 04
2
newbie-server bound to 3000, cannot disconnect
I know there is a super easy answer to this, i just can''t remember. I have fired up my server on port 3000... and want to disconnect it. easy. ERROR MESSAGE: => Booting lighttpd (use ''script/server webrick'' to force WEBrick) => Rails application started on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server (see config/lighttpd.conf
2006 Aug 16
5
too many SESSIONS?
I just notices my app was down, and in the log file were lots of these: No space left on device - ../config/../tmp/sessions//ruby_sess.898b1cf95e14f8e3 So i figured that i had too many sessions. I went through and deleted the sessions and then in a few minutes, the site was back up again. Can anyone explain this? Did I do the right thing? Is there a way I can tell my app to accept more
2006 Jul 25
1
? Password Protection ?
Say I have some directories I want to password protect. sub.web-app.com/cms sub.web-app.com/cms_posts sub.web-app.com/cms_photos sub.web-app.com/cms_news where /cms is a page that allows access(links) to all three other cms pages. - - - Does anyone have any quick advice on how to password protect these areas? Any good online tutorials? Any advice? -- Posted via
2006 Jul 18
13
RANDOM
I am pretty much new at this ROR game and had what I think to be a simple question. I have a set of Sponsors that I would like to be able to select one at random and display in the my html. I have already set up the DB, scaffolded, set index controller and all is working smoothly. I know that I can display them all by doing <% for sponsor in @sponsors %> <%= sponsor.name %>
2006 Jul 04
13
NewBie question
Hi, I m very new to Ruby. I bought a book "Ruby on Rails" and I think I understand some concepts. My question is : Is there a way to not use "Cookies" or "Sessions Variables" to keep some information about the user. I ask this question because I would like to prevent some cases where the user browser won''t accept cookies. I m from Asp 3.0, and I
2006 Jun 27
2
Using a different layout/styleshheet
Hi, I have a view that I use to display and capture data. Once the user has input the required data, I then need to be able to print the view. I know that I can setup a stylesheet to take care of the page layout but it is not clear to me how I will make the print view call the new layout. If anyone could clarify this or point met in the right direction, I would be most grateful. Regards, Paul
2006 Aug 15
5
XML question
Is there a way you can use RoR to create an .xml file? Say I had a DB full of info that I wanted to format and have export as "lorem.xml" inside of a specific directory in my web server? Then, each time I updated the DB it would re-export the file (delete the old, save the new?) -- Posted via http://www.ruby-forum.com/.
2008 Apr 19
4
Is testing output within content_for possible?
I wanted to test that the links below were being rendered in the views. - content_for :sidebar do %ul.links %li= edit_link edit_admin_contact_url(@contact), "Contact" # view test it "should have the correct side bar links" do do_render response.should have_tag("ul.links") do with_tag("a[href=?]",
2007 May 23
4
content_for
Any ideas how I would go about writing specs for views which make use of content_for? I''d like, for example, to be able to specify that ABC view places XYZ in the sidebar, which I do using content_for(:sidebar). Am I missing something obvious? Kyle
2008 Jan 24
3
Help to spec a rails helper method that uses content_for
Hi guys, I am a Rspec newbie and am having problems creating a spec for a RoR helper method. I have in fact already implemented the helper method and am trying to create retrospective specs. I know its the wrong way to do it but I am still learning Rspec. In my view I have a call to a helper method. <% body_class "users" %> which sets a CSS class declaration in the content_for
2006 Jul 14
9
DRY Javascript Degredation
Hi, It seems there must be a better way to do this than what I am currently doing. I have a simple app that collects a users thoughts along with their email address and their first an last name. On a page that lists all the users thoughts they can click on a link to "add a thought" which then displays a form with ajax. My current methodology for this is not very dry. If js is
2006 Sep 29
1
newbie Q: it won't display foreign keys...
I have two tables CREATE TABLE continents ( id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE countries ( id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, continent_id int(11) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; I generate scaffolds for country and for
2010 Aug 18
2
RSpec 2/Rails 3 - content_for in view specs
My main layout includes separate content_for/yield sections for my header, sidebar, footer, and content. However, when running a view spec, the `rendered` variable seems to only contain a string of just the primary content and ignores the header/footer/sidebar as well as the rest of my layout file (the "render" call just returns my primary content wrapped in generic <html> and
2006 Mar 10
2
RoR Deployment on Shared Hosting
Hey all - Well, I''ve gone through all of the tutorials I can get my hands on, and I''ve developed what is basically a (very) simple front-end to a database that I maintain online. My big problem now is deployment. Almost everything that I''ve found on the web regarding deployment (and this includes the instructions for Switchtower/Ccapistrano) assumes that I have
2006 Jul 13
5
Generic page element display initializer in a layout?
All, I''ve run into a snag. I need to handle the display of elements on my page and I want to use my Javascript event handlers on page load. However, my BODY tag is trapped in my generic layout. I''m thinking that I can put an onLoad on the BODY tag that will just call a Javascript method called initializePage() and then provide this initializePage() call in my specific page
2007 Jul 16
4
Accessing content_for html in view specs?
Hi All, Hope all is going well. I''ve got a few views that create some content using ''content_for'' blocks <% content_for :blah do %> ..... <% end %> Has anyone worked out a way to be able to access the html that''s generated inside those blocks? Since they''re not part of the view, have_tag('''') seems to miss them,
2006 Jul 06
6
Class variables in templates/layouts
I''m having problems with class variables.. I have a class: class Content::ApplicantsController < ApplicationController layout "mylayout" @@tab = "mystring" [... the rest is standard scaffold-created stuff ...] and a layout (mylayout.rhtml): [...] <title><%= @@tab.capitalize %></title> [...] And I keep getting this error: uninitialized