Search Results

Search found 5 results on 1 pages for 'tybro0103'.

Page 1/1 | 1 

  • CSS: series of floated elements without wrapping but rather scrolling horizontally

    - by tybro0103
    I'm working on a album viewer. At the top I want a horizontal container of all the image thumbnails. Right now all the thumbnails are wrapped in a div with float:left. I'm trying to figure out how to keep these thumbnails from wrapping to the next line when there are too many, but rather stay all in one horizontal row and use the scrollbar. Here's my code: (I don't want to use tables) <style type="text/css"> div { overflow:hidden; } #frame { width:600px; padding:8px; border:1px solid black; } #thumbnails_container { height:75px; border:1px solid black; padding:4px; overflow-x:scroll; } .thumbnail { border:1px solid black; margin-right:4px; width:100px; height:75px; float:left; } .thumbnail img { width:100px; height:75px; } #current_image_container img { width:600px; } </style> <div id="frame"> <div id="thumbnails_container"> <div class="thumbnail"><img src="http://www.blueridgexotics.com/images/glry-pixie-bob-kittens.jpg" alt="foo" /></div> <div class="thumbnail"><img src="http://www.blueridgexotics.com/images/PB-KitJan08-1.jpg" alt="foo" /></div> <div class="thumbnail"><img src="http://www.blueridgexotics.com/images/PB-KitJan08-3.jpg" alt="foo" /></div> <div class="thumbnail"><img src="http://www.blueridgexotics.com/images/PB-Jan08.jpg" alt="foo" /></div> <div class="thumbnail"><img src="http://www.blueridgexotics.com/images/gallery3.jpg" alt="foo" /></div> <div class="thumbnail"><img src="http://www.blueridgexotics.com/images/gallery4.jpg" alt="foo" /></div> <div class="thumbnail"><img src="http://www.blueridgexotics.com/Gallery-Pics/kitten3.jpg" alt="foo" /></div> <div class="thumbnail"><img src="http://www.blueridgexotics.com/Gallery-Pics/kitten1.jpg" alt="foo" /></div> </div> <div id="current_image_container"> <img src="http://www.whitetailrun.com/Pixiebobs/PBkittenpics/shani-kits/Cats0031a.jpg" alt="foo" /> </div> </div>

    Read the article

  • Rails after_create callback can't access model's attributes

    - by tybro0103
    I can't access my model's attributes in the after_create callback... seems like I should be able to right? controller: @dog = Dog.new(:color => 'brown', :gender => 'male') @dog.user_id = current_user.id @dog.save model: class Dog < ActiveRecord::Base def after_create logger.debug "[DOG CREATED] color:#{color} gender:#{gender} user:#{user_id}" end end console: (all seems well) >>Dog.last =>#<Dog id: 1, color: "brown", gender: "male", user_id: 1> log: (wtf!?) ... [DOG CREATED] color: gender:male user ... Some of my attributes show up and others don't! oh no! Anyone know what I'm doing wrong? I've always been able to user after_create in such ways in the past. Note: The actual variable names and values I used were different, but the methods and code are the same.

    Read the article

  • Rails find_or_create by more than one attribute?

    - by tybro0103
    There is a handy dynamic attribute in active-record called find_or_create_by: Model.find_or_create_by_<attribute>(:<attribute> => "") But what if I need to find_or_create by more than one attribute? Say I have a model to handle a M:M relationship between Group and Member called GroupMember. I could have many instances where member_id = 4, but I don't ever want more than once instance where member_id = 4 and group_id = 7. I'm trying to figure out if it's possible to do something like this: GroupMember.find_or_create(:member_id => 4, :group_id => 7) I realize there may be better ways to handle this, but I like the convenience of the idea of find_or_create.

    Read the article

  • Why doesn't Rails' "errors.full_messages" replace attribute and message variables?

    - by tybro0103
    Having a strange problem with a rails model I just created. Here are my validations: validates_presence_of :from_name, :message => 'Please provide a from name.' validates_presence_of :from_email validates_presence_of :giftition_plan_id I'm having issues using errors.full_messages as well as f.error_messages in my form: g = Giftition.create g.errors.first => ["from_name", "Please provide a from name."] >> g.errors.full_messages => ["{{attribute}} {{message}}", "{{attribute}} {{message}}", "{{attribute}} {{message}}"] I'm just getting "{{attribute}} {{message}}". Any ideas? UPDATE: I've uninstalled rails 3 and all the gems that were installed with it and that made the problem go away. It's not a fix though... I would still like to have rails 3 installed.

    Read the article

1