LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-15-2014, 08:37 AM   #1
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Chef/Ruby gui code - trying to make a change to gui webpage


(Did the programming forum disappear?)

Anyway, I have chef which is a ruby program, and I have a hard time understanding ruby. I need a class! But anyway, if someone could answer my question, i would appreciate it.

I want to add a small 'YAY.jpg' next to the node name, if it has 'detroit' in the name. Anyone have an idea how to modify this to do so?

Code:
.block#block-tables
  .content
    %h2.title
      Node List
    .inner
      = render('navigation', :active => 'index')
    .content
      .inner
        %table.table
          %tr
            %th.first{:colspan => 2} Name
            %th  
            %th.last  
          - even = false
          - if @node_list.empty?
            - if session[:environment]
              %td{:colspan => 4}= "The environment #{session[:environment]} has no nodes"
            - else
              %td{:colspan => 4}= "You have no nodes - try connecting one, or creating or editing a #{link_to('node', nodes_path)}".html_safe
          - else
            - @node_list.sort_by {|value| value.downcase}.each do |node|
              %tr{:class => even ? "even": "odd" }
                %td{:colspan => 2}= link_to node, node_path(node)
                %td
                  = link_to('Edit', edit_node_path(node))
                  |
                  = link_to('Delete', node_path(node), :method => "delete", :confirm => "Really delete Node #{node}?  There is no undo.")
                - even = (not even)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby code on Chef as a "ruby_block" not working sparc86 Programming 16 11-12-2013 08:48 AM
Shoes Forum [Ruby GUI] lmcilwain Programming 5 12-11-2010 04:13 PM
Favourite Ruby GUI samjh Programming 4 05-23-2010 07:45 PM
Which toolkit to choose for a web GUI (in ruby) wrapster Programming 1 01-18-2009 10:58 AM
separating GUI from code Four Programming 2 08-10-2008 09:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration