1. Ruby / Говнокод #7104

    −104

    1. 1
    <%= !!@case[:img] ? image_tag(@case[:img]) : "" %>

    pavel_so, 29 Июня 2011

    Комментарии (7)
  2. Ruby / Говнокод #6864

    −99

    1. 1
    2. 2
    <%= @album.playlist.gsub('
    ','<br />') %>

    Тогда, видимо, не догадался написать "\n" :)

    Actine, 05 Июня 2011

    Комментарии (21)
  3. Ruby / Говнокод #6751

    −99

    1. 1
    2. 2
    3. 3
    4. 4
    respond_with_error("Lat can't be blank.", :unprocessable_entity) and return if params[:lat].blank?
        respond_with_error("Lon can't be blank.", :unprocessable_entity) and return if params[:lon].blank?
        respond_with_error("Lat is not a number.", :unprocessable_entity) and return if !is_float?(params[:lat])
        respond_with_error("Lon is not a number.", :unprocessable_entity) and return if !is_float?(params[:lon])

    индусский кот от Фет Фрумоса

    sumskyi, 25 Мая 2011

    Комментарии (13)
  4. Ruby / Говнокод #6750

    −95

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    def space(n)
        str = ''
        n.times do
          str += '&nbsp;'
        end
        str
      end

    whitequark, 25 Мая 2011

    Комментарии (12)
  5. Ruby / Говнокод #6612

    −106

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    def parse_response(object)
        return Hashie::Mash.new(JSON.parse(object))
      rescue => e
        #should handle here different error types/levels or else throw the exceptions to the upper layer (client)
        if e.is_a?(JSON::ParserError) && e.message =~ /<html>/
          raise "Invalid response from Platform server - #{self.class.parse_json_error(response.body)}"
        else
          raise e
        end
      end

    sumskyi, 10 Мая 2011

    Комментарии (4)
  6. Ruby / Говнокод #6569

    −110

    1. 1
    2. 2
    3. 3
    def parse_time(input, minutes = false)
        TimeParser.parse_time(current_user, input, minutes)
     end

    intale, 06 Мая 2011

    Комментарии (9)
  7. Ruby / Говнокод #6568

    −105

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    def index
        list
        render :action => 'list'
      end
    
      def list
      end

    intale, 06 Мая 2011

    Комментарии (16)
  8. Ruby / Говнокод #6567

    −102

    1. 1
    Task.joins(:owners).where(:users => {:id => current_user}).order("tasks.weight DESC").limit(1).first

    intale, 06 Мая 2011

    Комментарии (15)
  9. Ruby / Говнокод #6489

    −102

    1. 1
    2. 2
    3. 3
    def route_match? origin, destination
      origin.iata == origin and destination.iata == destination
    end

    В классе конечно определены методы origin и destination

    rakoth3d, 27 Апреля 2011

    Комментарии (15)
  10. Ruby / Говнокод #6419

    −100

    1. 1
    File.basename(File.basename(name, '.jpg'), '.png')

    Файл либо с расширением .png, либо .jpg

    e2718, 20 Апреля 2011

    Комментарии (4)