Skip to content

Instantly share code, notes, and snippets.

@RemiBa
RemiBa / Output
Created November 7, 2012 09:07
Problems getting notices
<p>NO FUCKING MESSAGE</p>
@RemiBa
RemiBa / application.html.erb
Created November 7, 2012 09:42
Problems getting notices
<% flash.each do |name, message| %>
<%= content_tag :div, message, :id => "flash_#{name}" %>
<% end %>
@RemiBa
RemiBa / _changePassword.html.erb
Created November 7, 2012 11:57
Retrieve associated errors in form
<%= form_for @customer do |c| %>
<% if @customer.errors.any? %>
<div class="form_errors">
<ul>
<% @customer.errors.full_messages.each do |msg| %>
<li>
<%= msg %>
</li>
<%end%>
</ul>
@RemiBa
RemiBa / Output params
Created November 7, 2012 14:23
Form differences
CHECKING ERROR VALIDATION CHANGEPASSWORD
{"utf8"=>"✓", "_method"=>"put", "authenticity_token"=>"LiCv6shHTr8gXVk/fNPmhGk2pJ2uUM2WmQ0mm0OWeLs=", "customer"=>{"authentication_attributes"=>{"password"=>"qdsfqsdf", "password_confirmation"=>"dfqsd", "id"=>"2"}}, "commit"=>"Save your changes", "action"=>"update", "controller"=>"customers", "id"=>"2110002"}
-> Customer
- authentication_attributes
-password
-password_confirmation
Gives following errors:
Password doesn't match confirmation
require 'spec_helper'
describe "customers" do
describe "signup" do
#FactoryGirl.find_definitions
let(:user) { FactoryGirl.create(:signup_customer)}
it "has right data" do
visit signup_path
fill_in :id, :with => 2110001
@RemiBa
RemiBa / _signupform.html.erb
Created November 8, 2012 09:35
Test data wrong
<%= form_for @customer do |c|%>
<% if @customer.errors.any?%>
<div id="form_errors">
<ul>
<% @customer.errors.full_messages.each do |msg| %>
<li>
<%= msg %>
</li>
<%end%>
</ul>
@RemiBa
RemiBa / browser:no_proxy
Created November 20, 2012 13:21
zend framework
Index of /
[ICO] Name Last modified Size Description
[TXT] LICENSE.txt 10-Nov-2012 16:20 1.5K
[ ] composer.json 10-Nov-2012 16:20 336
[ ] composer.lock 20-Nov-2012 13:42 5.0K
[ ] composer.phar 10-Nov-2012 16:20 557K
[DIR] config/ 20-Nov-2012 13:13 -
[DIR] data/ 20-Nov-2012 13:13 -
[TXT] dxDNrd_U.htm.part.htm 20-Nov-2012 13:51 849
@RemiBa
RemiBa / products.js
Created December 19, 2012 15:15
Updating my filter selects not working... why is that?
$(document).ready(function(){
selectionChanges();
});
function selectionChanges(){
$('#filters select').change(function(){
//Do some stuff and do an ajax request
});
}
@RemiBa
RemiBa / exception
Last active December 10, 2015 05:29
Routing Error
No route matches {:controller=>"orderitems"}
Try running rake routes for more information on available routes.
@RemiBa
RemiBa / ERROR
Last active December 10, 2015 06:58
NoMethodError in OrderitemsController#create
undefined method `stringify_keys' for #<Order:0x2c630a0>
Application Trace | Framework Trace | Full Trace
app/controllers/orderitems_controller.rb:11:in `create'