Skip to content

Instantly share code, notes, and snippets.

@jordanisip
Created June 24, 2009 20:48
Show Gist options
  • Save jordanisip/135505 to your computer and use it in GitHub Desktop.
Save jordanisip/135505 to your computer and use it in GitHub Desktop.
===VIEW===
<%- form_for @credential, user_external_credentials_path(@user), :class => "horizontal" do -%>
<div class="input-wrapper">
<%= f.label :login, "Twitter Username" -%>
<%= f.text_field :login, :class => 'text' -%>
</div>
<div class="input-wrapper">
<%= f.label :password, "Twitter Password" -%>
<%= f.password_field :password, :class => 'text' -%>
</div>
<div class="btn-wrapper">
<%= f.submit "Save", :class => "button" %>
</div>
<%- end -%>
<%- end -%>
=== CONTROLLER ===
def sharing
@credential = @user.external_credentials.new
end
=== ERROR ===
ActionView::TemplateError (undefined method `external_credentials_path' for #<ActionView::Base:0x102f76e0>) on line #8 of app/views/users/sharing.html.erb:
5: <%- if @user.twitter_credential.present? -%>
6: Your Twitter credentials have been stored for username <strong><%= @user.twitter_credential.login %></strong>.
7: <%- else -%>
8: <%- form_for @credential, user_external_credentials_path(@user) do -%>
9: <div class="input-wrapper">
10: <%= f.label :login, "Twitter Username" -%>
11: <%= f.text_field :login, :class => 'text' -%>
vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb:109:in `__send__'
vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb:109:in `polymorphic_url'
vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb:116:in `polymorphic_path'
vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:298:in `apply_form_for_options!'
vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:277:in `form_for_without_haml'
vendor/gems/haml-edge-2.1.13/rails/./lib/haml/helpers/action_view_mods.rb:171:in `form_for'
app/views/users/sharing.html.erb:8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment