Skip to content

Instantly share code, notes, and snippets.

View doombongo's full-sized avatar

Michael Lussier doombongo

  • GitLab
  • Fayetteville, Arkansas
View GitHub Profile
NoMethodError
undefined method `POST' for #<ActionDispatch::Routing::Mapper:0x00000102b73ec0>
Rails.root: /Users/Mike/rails_projects/digsite
Application Trace | Framework Trace | Full Trace
config/routes.rb:6:in `block in <top (required)>'
config/routes.rb:1:in `<top (required)>'
This error occurred while loading the following files:
/Users/Mike/rails_projects/digsite/config/routes.rb
Digsite::Application.routes.draw do
resources :line_items
resources :carts
POST "donate/index"
get "about/index"
get "home/index"
resources :teams
resources :volunteers
ArgumentError
missing :controller
Rails.root: /Users/Mike/rails_projects/digsite
Application Trace | Framework Trace | Full Trace
config/routes.rb:6:in `block in <top (required)>'
config/routes.rb:1:in `<top (required)>'
This error occurred while loading the following files:
/Users/Mike/rails_projects/digsite/config/routes.rb
@doombongo
doombongo / application.html.erb
Created November 30, 2012 07:52
Multiple paths for a current_page?(path) helper
<li> <%= link_to "Get involved", involves_path, class: "#{cp(involves_path, new_volunteer_path)} link" %></li>
@doombongo
doombongo / application.html.erb
Created November 30, 2012 07:52
Multiple paths for a current_page?(path) helper
<li> <%= link_to "Get involved", involves_path, class: "#{cp(involves_path, new_volunteer_path)} link" %></li>
module ApplicationHelper
def cp(*path)
"current" if current_page?(path)
end
end
<%= link_to "Get involved", involves_path, class: "#{cp(involves_path,new_volunteer_path)} link"
@doombongo
doombongo / application.html.erb
Created December 3, 2012 19:12
current is a red arrow sitting next to the nav link
<li> <%= link_to "About Us", about_path, class: "#{cp(about_path)} link" %></li>
@doombongo
doombongo / index.html.erb
Created December 11, 2012 17:34
link to image
<% @blogs.each do |blog| %>
<div class="index_image">
<%= link_to image_tag("blog.image.thumb.to_s"), blog %>
</div>
<%end%>
text = "bIg mouse"
redacted = "big"
words = text.split(" ")
words.each do |word|
if word != redacted
print word + " "