Created
April 11, 2010 19:33
-
-
Save zenom/363005 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for @owner do |form| %> | |
<%= form.text_field :username %> | |
<%= form.password_field :password %> | |
<%= form.submit %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## error | |
NoMethodError in Owners#edit | |
class OwnersController < ApplicationController | |
respond_to :html | |
def index | |
@owners = Owner.order("created_at desc") | |
respond_with @owners | |
end | |
def new | |
@owner = Owner.new | |
end | |
def create | |
Owner.create(params[:owner]) | |
redirect_to owners_path | |
end | |
def edit | |
@owner == Owner.find_by_id(params[:id]) | |
end | |
def update | |
owner = Owner.find_by_id(params[:id]) | |
owner.update_attributes(params[:owner]) | |
redirect_to owners_path | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment