Fully embrace Ruby 1.9 hash syntax

Didn't bother with files in db/, config/, or features/
This commit is contained in:
Robert Speicher 2012-08-10 18:07:50 -04:00
parent 1413c23c50
commit 7754189187
257 changed files with 1449 additions and 1449 deletions

View file

@ -10,22 +10,22 @@
.clearfix
= f.label :title
.input= f.text_field :title, :placeholder => "Example Snippet"
.input= f.text_field :title, placeholder: "Example Snippet"
.clearfix
= f.label :file_name
.input= f.text_field :file_name, :placeholder => "example.rb"
.input= f.text_field :file_name, placeholder: "example.rb"
.clearfix
= f.label "Lifetime"
.input= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;"
.input= f.select :expires_at, lifetime_select_options, {}, style: "width:200px;"
.clearfix
= f.label :content, "Code"
.input= f.text_area :content, :class => "span8"
.input= f.text_area :content, class: "span8"
.actions
= f.submit 'Save', :class => "primary btn"
= link_to "Cancel", project_snippets_path(@project), :class => " btn"
= f.submit 'Save', class: "primary btn"
= link_to "Cancel", project_snippets_path(@project), class: " btn"
- unless @snippet.new_record?
.right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "btn right danger delete-snippet", :id => "destroy_snippet_#{@snippet.id}"
.right= link_to 'Destroy', [@project, @snippet], confirm: 'Are you sure?', method: :delete, class: "btn right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}"

View file

@ -1,7 +1,7 @@
%tr
%td
%a{:href => project_snippet_path(snippet.project, snippet)}
%strong= truncate(snippet.title, :length => 60)
%a{href: project_snippet_path(snippet.project, snippet)}
%strong= truncate(snippet.title, length: 60)
%td
= snippet.file_name
%td

View file

@ -2,7 +2,7 @@
- if can? current_user, :write_snippet, @project
.alert-message.block-message
= link_to new_project_snippet_path(@project), :class => "btn small add_new right", :title => "New Snippet" do
= link_to new_project_snippet_path(@project), class: "btn small add_new right", title: "New Snippet" do
Add new snippet
Share code pastes with others if it cant be in a git repository
%br
@ -17,5 +17,5 @@
= render @snippets.fresh
- if @snippets.fresh.empty?
%tr
%td{:colspan => 3}
%td{colspan: 3}
%h3.nothing_here_message Nothing here.

View file

@ -4,7 +4,7 @@
= @snippet.title
%small= @snippet.file_name
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to "Edit", edit_project_snippet_path(@project, @snippet), :class => "btn small right"
= link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn small right"
%br
.file_holder
@ -12,9 +12,9 @@
%i.icon-file
%strong= @snippet.file_name
%span.options
= link_to "raw", raw_project_snippet_path(@project, @snippet), :class => "btn very_small", :target => "_blank"
= link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank"
.file_content.code
%div{:class => current_user.dark_scheme ? "black" : ""}
%div{class: current_user.dark_scheme ? "black" : ""}
= raw @snippet.colorize(options: { linenos: 'True'})
= render "notes/notes", :tid => @snippet.id, :tt => "snippet"
= render "notes/notes", tid: @snippet.id, tt: "snippet"