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 | |
def create | |
@user = User.new(user_params) | |
respond_to do |format| | |
if @user.save | |
format.html { redirect_to @user, notice: 'User was successfully created.' } | |
format.json { render :show, status: :created, location: @user } | |
else | |
format.html { render :new } |
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 Phone < ActiveRecord::Base | |
belongs_to :user | |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Socket.IO chat</title> | |
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script> | |
<style> | |
* { margin: 0; padding: 0; box-sizing: border-box; } | |
body { font: 13px Helvetica, Arial; } | |
form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; } | |
form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; } |
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
<header> | |
<div class="logo" > | |
<a itemprop="url" href="http://ledyair.com" href="/"><img itemprop="logo" src="<%= asset_path("vineLogo.png") %>" alt="LEDYair logo" /></a> | |
</div> | |
<nav> | |
<div id="nav-xs"> | |
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav-lg" aria-expanded="false" aria-controls="navbar"> |
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 Question < ActiveRecord::Base | |
has_many :answers | |
end | |
class Answer < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :question | |
end | |
class User < ActiveRecord::Base |
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 LampsController < ApplicationController | |
before_action :set_lamp, only: [:show, :edit, :update, :destroy] | |
def edit | |
@lamps = Lamp.all | |
end | |
private | |
def set_lamp | |
@lamp = Lamp.friendly.find(params[:id]) |
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
NameError in LampsController#index | |
uninitialized constant Lamp::Constituents | |
Extracted source (around line #158): | |
156 | |
157 | |
158 | |
159 | |
160 | |
161 |
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
<h1><%= @download %></h1> | |
<%= link_to "download", download_path(:ydit => "SB8-YY2DyHI") %> | |
<ul> | |
<% @mp3s.each do |m| %> | |
<li><%= m %></li> | |
<% end %> | |
</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
<% @sections.each do |s| %> | |
<tr> | |
<td><%= s.header %></td> | |
<td><%= truncate(sanitize(s.content), length: 80) %> | |
</td> | |
<td><%= link_to "edit", edit_admin_section_path(s) %></td> | |
</tr> | |
<% 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 PagesController < ApplicationController | |
def store | |
@products = Product.all | |
end | |
end |