This file contains hidden or 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
| >> { :hello => "<span>world</span>" }.to_json | |
| => "{\"hello\":\"\\u003Cspan\\u003Eworld\\u003C/span\\u003E\"}" |
This file contains hidden or 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
| # POST /calls | |
| # POST /calls.json | |
| def create | |
| @call = Call.new(params[:call]) | |
| @call.user_id = current_user.id | |
| respond_to do |format| | |
| if @call.save | |
| format.html { redirect_to @call, notice: 'Call was successfully created.' } | |
| format.json { render json: @call, status: :created, location: @call } |
This file contains hidden or 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
| def tagged | |
| if current_user | |
| @fb_user = FbGraph::User.me(current_user.fb_token) | |
| @photos_of_you = @fb_user.photos({"limit" => "0"}) | |
| @count = @photos_of_you.count | |
| end | |
| render :layout => false | |
| end |
This file contains hidden or 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
| respond_to :html, :js | |
| def destroy | |
| @student = User.find(params[:id]) | |
| if @student.destroy | |
| render json: { student: @student, student_id: dom_id(@student) } | |
| else | |
| render nothing: true | |
| end |
This file contains hidden or 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
| require 'formula' | |
| class MacvimDrawer < Formula | |
| homepage 'https://github.com/alloy/macvim' | |
| head 'git://github.com/alloy/macvim.git', :branch => 'split-browser' | |
| def options | |
| [ | |
| # Building custom icons fails for many users, so off by default. | |
| ["--custom-icons", "Try to generate custom document icons."], |
This file contains hidden or 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
| <%= f.input :text %> | |
| <%= f.input :tag_list %> | |
| <% if params[:reply_to_id] %> | |
| <%= f.hidden_field :reply_to_id, :value => params[:reply_to_id] %> | |
| <% end %> |
This file contains hidden or 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
| class UsersController < ApplicationController | |
| respond_with :html | |
| def create | |
| @user = User.new(params[:user]) | |
| if @user.save | |
| respond_with [:admin, @user], notice: "User succesfully created!" | |
| else | |
| redirect_to 'admin/users/new', alert: "User was not created: #{@user.errors.full_messages.join(',')}" | |
| end |
This file contains hidden or 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
| <div class="span2"> | |
| <ul class="nav nav-list well"> | |
| <li class="nav-header">Главное меню</li> | |
| <li class="active simple-navigation-active-leaf"> | |
| <a href="/tsp/organizations?locale=ru" class="active">Организации</a></li> | |
| <li><a href="/tsp/content/conferences?locale=ru">Конференции</a></li> | |
| <li><a href="/tsp?locale=ru">Мой профиль</a></li> | |
| <li class="nav-header">Система</li> | |
| <li> <a href="/tsp/scheduler?locale=ru">Очередь заданий</a></li> | |
| <li><a href="/tsp/admin?locale=ru">База данных</a></li></ul> |
This file contains hidden or 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
| var groupSelect = $('#user_group_id'), | |
| groupSelectField = $('.field.group-select'); | |
| groupSelect.children().first().after($('<option></option>').attr('value', 'new').text('<%= t("form.user.new_group") %>')); | |
| groupSelectField.children().last().after($('<form></form>').attr('class', 'inner-form')); | |
| var innerForm = $('.inner-form'); | |
This file contains hidden or 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
| class UserDeliveryAgent | |
| def initialize(email) | |
| @email = email | |
| end | |
| def deliver! | |
| if @email.present? | |
| puts "Email: #{@email}" | |
| true | |
| else |