Skip to content

Instantly share code, notes, and snippets.

View jeromegn's full-sized avatar
🏠
Rusting it up

Jerome Gravel-Niquet jeromegn

🏠
Rusting it up
View GitHub Profile
<%= form.label :name %><br />
<%= form.text_field :name %><br />
<br />
<%= form.label :website %><br />
<%= form.text_field :website %><br />
<br />
<%= form.label :bio %><br />
<%= form.text_area :bio %><br />
<br />
<%= form.label :email %><br />
Then /^I should be logged in$/ do
session = UserSession.find
return true if session
end
Given /^I am not logged in$/ do
session = UserSession.find
return true if !session
end
jgn@jgn ~/sites/investapp/investapp.com[master*]$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
#
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: README.textile
# modified: app/controllers/application.rb
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Participation::ArticlesController do
before(:each) do
activate_authlogic
@current_user = Factory.create(:user)
@article = Factory.build(:article)
@new_article = Factory.stub(:article)
end
class Participation::ArticlesController < Participation::ApplicationController
def new
@article || @article = Article.new
end
def create
@article = Article.new(params[:article])
respond_to do |format|
if @article.save
<div id="login_fields">
<h3>
Login
</h3>
<form action="/login" method="post" accept-charset="utf-8" id="login_form" name="login_form">
<input type="hidden" name="site_id" value="58519132" id="site_id"> <input type="hidden" name="_method" value="PUT">
<div class="formRow">
<label>Login: <input type="text" name="login" value="" id="login"></label>
</div>
<div class="formRow">
Structure
=========
Form
Fields
Elements
Label (optional but most common)
Element
Label (optional in case of a a checkbox or radio)
Input Checkbox/Radio
<%= form_for(@user, :action => "/users/#{@user.login}") %>
<%= hidden_field :value => "DELETE", :name => "_method" %>
<div class="actions">
<input type="image" name="submit" src="/images/btn-delete_user.png" id="deleteUser" />
or <%= link_to "cancel", resource(:users) %>
</div>
<% end =%>
var app = $.sammy(function() { with(this) {
get('#/repondre/:comment_id', function() { with(this) {
partial('/templates/comments/new.html.erb', {parent_id: params['comment_id']}, function(content){
$("#comment_"+params['comment_id']).append(content);
});
}});
}});
var cont = $(jetpack.tabs.focused.contentDocument).find("body");
// Loading the default active corners template
$.ajax({
url: "http://test.jeromegn.is-a-geek.com/widget/base",
type: "GET",
success: function(data, textStatus) {
cont.append(data);
},