Created
September 19, 2012 01:00
-
-
Save rkellermeyer/3747017 to your computer and use it in GitHub Desktop.
Form Nested on non-Modal view
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
Routing Error | |
No route matches {:action=>"new", :controller=>"messages"} | |
Try running rake routes for more information on available routes. |
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
# ... | |
belongs_to :user | |
# ... |
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
# ... | |
resources :users do | |
resources :messages | |
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
# In app/views/users/show.html.erb | |
<div class="formInputWrapper"> | |
<%= semantic_form_for [@user,@message] do |f| %> | |
<%= f.input :content, id: "newMessageInput" %> | |
<%= f.button_tag(type: 'button', class: "messageSubmit") do %> | |
<%= image_tag("chatSubmit.png") %> | |
<% end %> | |
<% end %> | |
</div> |
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
# ... | |
attribute_accessible :message_attributes # ... | |
has_many :messages | |
accepts_nested_attributes_for :messages | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment