Skip to content

Instantly share code, notes, and snippets.

@HeroicEric
Created September 26, 2011 01:39
Show Gist options
  • Save HeroicEric/1241430 to your computer and use it in GitHub Desktop.
Save HeroicEric/1241430 to your computer and use it in GitHub Desktop.
# keywords_controller.rb
class KeywordsController < ApplicationController
def new
@domain = Domain.find(params[:domain_id])
@keyword = @domain.keywords.new
end
end
# domains/new.html.haml
%h1= @domain.name
= link_to @domain.url, @domain.url
%br
= link_to "Edit this domain", edit_domain_path(@domain)
%h2 Keywords
= link_to "New keyword", new_domain_keyword_path(@domain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment