Discussion: General

September 3rd, 2009 Leave a comment Go to comments

Add comments here for discussion on matters that don’t fit neatly into another discussion category.

  1. Gabriel
    November 29th, 2009 at 09:31 | #1

    @Gabriel
    Comment nr. 91 in this railscasts mentions the same problem:
    http://railscasts.com/episodes/102-auto-complete-association

    Unfortunately the fix didn't work for me...

  2. Gabriel
    November 29th, 2009 at 09:39 | #2

    @Gabriel
    HAHA! Finally! The fix did work, there was just a backup file from emacs that was still used instead of the corrected version (does any experienced emacs user know how I can supress the generation of these someFile~ backups with a tilde in the end?)

  3. November 29th, 2009 at 09:43 | #3

    @Gabriel

    I should probably write up to the steps to use auto_complete -- the account in AWDR is terrible.

  4. Brian Mantenuto
    November 30th, 2009 at 21:42 | #4

    For all you javascript afficianados out there...

    http://www.chromeexperiments.com/

    Browser ball is my favorite. of course they all work best with CHROME.

  5. Brian Mantenuto
    November 30th, 2009 at 21:58 | #5

    another random note...

    for any of you systems folks out there check out the Puppet Project

    http://reductivelabs.com/trac/puppet/wiki/AboutPuppet

    we have been using this to manage a larger (6000+) linux farm.

    its written entirely in Ruby.

  6. Lateral Punk
    December 10th, 2009 at 05:37 | #6

    How do you get script/console to list your tables in the pretty manner like they do in the railscast screencasts?

  7. December 10th, 2009 at 09:12 | #7

    @Lateral Punk

    I think it's hirb - http://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html and http://tagaholic.me/2009/06/19/page-irb-output-and-improve-ri-with-hirb.html

    Let us know if it works with Ruby 1.9.1. I also don't know how well it does with tables with a lot of columns.

  8. Lateral Punk
    December 10th, 2009 at 17:26 | #8

    works like a charm!

  9. Lateral Punk
    December 11th, 2009 at 15:51 | #9

    Could you please put up a screencast or how-to on using BlueprintCSS as mentioned in class? I'm a newbie designer and don't know the first thing about CSS and stuff...

  10. Lateral Punk
    December 11th, 2009 at 17:23 | #10

    Are the videos to the lectures going to be avail after the course is over?

  11. December 11th, 2009 at 18:18 | #11

    @Lateral Punk

    Yes. It is conceivable that I would take them down for awhile because I'm reconfiguring the server, but . . . yes.

  12. Lateral Punk
    December 12th, 2009 at 15:19 | #12

    HOw do you do comments in ERB files e.g.
    <!-- { :action => "update" } do |person_form| %>

    Delete:

    -->

    and rails barks...

    I want to be able to comment out code which I'm using as reference or wahtever..seems non trivial from what I've seen on the net...

  13. Ron Newman
    December 12th, 2009 at 15:44 | #13
    <% # ruby_code_you_want_to_comment_out()  %>
  14. Lateral Punk
    December 12th, 2009 at 16:53 | #14

    Nope. doesn't work.

    Need something that is multiple lines and actually comments it out, and in the erb files.

  15. Lateral Punk
    December 12th, 2009 at 16:55 | #15

    Another quesiton, how do you get all your controllers to use the same application stylesheet? I use scaffold and it generates one layout per controller and I can't figure out how to make them all point to the same..i mean i know you do
    stylesheet_link_tag 'application'

    but then if I try to remove the stylesheet generated from scaffold for that controller, it defaults back to the normal settings, and doesn't use the application..all our assignments and example code do what I want, but I can't figure it out how to get it to work for my application..moreover, by default rails doesn't generate the scaffold.css in the public directory which is weird..all this is a little screwy ot me...

  16. Lateral Punk
    December 12th, 2009 at 16:56 | #16

    repharse the above with layout..e.g. how do you share the layout/stylesheet amongst all the controllers to be the same like in our assignments...

  17. peter
    December 12th, 2009 at 17:02 | #17

    @Lateral Punk

    I think you can use the standard HTML comments to comment out the HTML code, but I think you can use =begin and =end to comment out multiple lines of ruby.
    http://ruby.about.com/od/rubyfeatures/a/comment.htm

    As far as I can tell, in the top of your controller, you can just add a layout definition there:

    class MyController < ApplicationController
    layout 'my_layout'

    HTH

    -peter

  18. Lateral Punk
    December 12th, 2009 at 17:08 | #18

    Gosh darn it, I don't know why I figure things out right after I post a quesiton!
    Anyways, it was a real odd ball fix. You have to manually remove all layout files in the vview/layout directory save applicaiton.html.erb for things to work right! go figure!

  19. AdamK
    December 12th, 2009 at 17:09 | #19

    @Lateral Punk

    For multi-line comments I've been using this:
    =begin
    code & stuff
    =end

    just be careful, the "=begin" & "=end" must be at the beginning of the line.

    As for the stylesheets, I haven't played with them yet, but I am planning to do the following (I'm also generating a lot of scaffolds) and hope it will work:
    - Get rid of all the extra layouts, creating one single application layout
    - have application layout reference the stylesheet I want to use across the board

  20. December 12th, 2009 at 23:05 | #20

    @AdamK
    @Lateral Punk

    To use just the one layout, remove the others, and just have application.html.erb

    Regarding multiple-line comments -- AdamK, will the =begin/=end strategy work in .erb templates? I thought not, but maybe I'm wrong.

  21. AdamK
    December 12th, 2009 at 23:22 | #21

    @john

    My bad - had read the question two fast. It doesn't work with .erb templates.

  22. December 12th, 2009 at 23:23 | #22

    @AdamK

    OK, that does work:

    <%
    =begin
      multi-
      line
      comment
    =end
    %>
    

    Remember that your views should be pretty dumb -- the heavy lifting should be in the controller. So presumably your view comments are short and sweet.

  23. December 12th, 2009 at 23:25 | #23

    @AdamK

    I may be hallucinating, but try it in the manner of what I pasted in here

  24. AdamK
    December 13th, 2009 at 00:39 | #24

    @john

    As could I, but it doesn't work for me. I tried putting it around a form_tag block and it returned errors - "SyntaxError in XXX"

  25. AdamK
    December 13th, 2009 at 00:47 | #25

    Is anyone else working with the ym4r_gm plugin to incorporate maps functionality? I've got it wired up okay, but am having one fairly significant hang up. I've got a map embedded in a view used to create a new object & if the create fails on model validation, the map stops working. There isn't an error per se, but when I re-render the :new view, the map isn't there & instead is just a text representation of the map ('map.div()')

    If anyone has experience with the plugin in question and can point me towards some good references beyond the basic load a map with markers etc, I'd appreciate it.

    Adam

  26. December 13th, 2009 at 08:24 | #26

    @AdamK

    What does the "create" do? If the model is intimately associated with what is shown in the view, should the view be able to do anything anyway?

  27. AdamK
    December 13th, 2009 at 10:38 | #27

    @AdamK
    I figured out my map problem. I was mixing up when I should be creating a map versus referencing an existing map.

Comment pages
1 2 3 154
  1. No trackbacks yet.